Documented -b for brief option.
[samba.git] / examples / redhat / samba-1.9.16p11.spec.full
1 Summary: SMB client and server
2 Name: samba
3 Version: 1.9.16p11
4 Release: 2
5 Copyright: GPL
6 Group: Networking
7 Source: ftp://samba.anu.edu.au/pub/samba/samba-1.9.16p11.tar.gz
8 Patch: samba-make.patch
9 Patch2: samba-axp.patch
10 Packager: John H Terpstra [Samba-Team] <jht@aquasoft.com.au>
11 Requires: pamconfig
12
13 %description
14 Samba provides an SMB server which can be used to provide network
15 services to SMB (sometimes called "Lan Manager") clients, including
16 various versions of MS Windows, OS/2, and other Linux machines.
17 Samba also provides some SMB clients, which complement the built-in
18 SMB filesystem in Linux.
19
20 Samba uses NetBIOS over TCP/IP (NetBT) protocols and does NOT need
21 NetBEUI (Microsoft Raw NetBIOS frame) protocol.
22
23 %prep
24 %setup
25 %patch -p1
26
27 %ifarch axp
28 %patch2 -p1
29 %endif
30
31 %build
32 cd source
33 make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
34 mkdir $RPM_BUILD_ROOT/bin
35 mkdir $RPM_BUILD_ROOT/etc
36 mkdir $RPM_BUILD_ROOT/etc/logrotate.d
37 mkdir $RPM_BUILD_ROOT/sbin
38 mkdir $RPM_BUILD_ROOT/usr
39 mkdir $RPM_BUILD_ROOT/usr/sbin
40 mkdir $RPM_BUILD_ROOT/usr/bin
41 mkdir $RPM_BUILD_ROOT/usr/man
42 mkdir $RPM_BUILD_ROOT/usr/man/man1
43 mkdir $RPM_BUILD_ROOT/usr/man/man5
44 mkdir $RPM_BUILD_ROOT/usr/man/man8
45 mkdir $RPM_BUILD_ROOT/var
46 mkdir $RPM_BUILD_ROOT/var/spool
47 mkdir $RPM_BUILD_ROOT/var/log
48 mkdir $RPM_BUILD_ROOT/var/lock
49 mkdir $RPM_BUILD_ROOT/var/lock/samba
50
51 %install
52 cd source
53 cd ..
54 for i in addtosmbpass mksmbpasswd.sh nmblookup smbclient smbpasswd smbrun smbstatus smbtar testparm testprn
55 do
56         cp -af source/$i $RPM_BUILD_ROOT/usr/bin
57         chown 0.0 $RPM_BUILD_ROOT/usr/bin/$i
58         chmod 755 $RPM_BUILD_ROOT/usr/bin/$i
59 done
60 for i in smbd nmbd
61 do
62         cp -af source/$i $RPM_BUILD_ROOT/usr/sbin
63         chown 0.0 $RPM_BUILD_ROOT/usr/sbin/$i
64         chmod 755 $RPM_BUILD_ROOT/usr/sbin/$i
65 done
66 for i in smbclient.1 smbrun.1 smbstatus.1 smbtar.1 testparm.1 testprn.1
67 do
68         cp -af docs/$i $RPM_BUILD_ROOT/usr/man/man1
69         chown 0.0 $RPM_BUILD_ROOT/usr/man/man1/$i
70         chmod 644 $RPM_BUILD_ROOT/usr/man/man1/$i
71 done
72 cp -af docs/smb.conf.5 $RPM_BUILD_ROOT/usr/man/man5
73 chown 0.0 $RPM_BUILD_ROOT/usr/man/man5/smb.conf.5
74 chmod 644 $RPM_BUILD_ROOT/usr/man/man5/smb.conf.5
75 cp -af docs/samba.7 $RPM_BUILD_ROOT/usr/man/man7
76 chown 0.0 $RPM_BUILD_ROOT/usr/man/man7/samba.7
77 chmod 644 $RPM_BUILD_ROOT/usr/man/man7/samba.7
78 cp -af docs/smbd.8 $RPM_BUILD_ROOT/usr/man/man8
79 chown 0.0 $RPM_BUILD_ROOT/usr/man/man8/smbd.8
80 chmod 644 $RPM_BUILD_ROOT/usr/man/man8/smbd.8
81 cp -af docs/nmbd.8 $RPM_BUILD_ROOT/usr/man/man8
82 chown 0.0 $RPM_BUILD_ROOT/usr/man/man8/nmbd.8
83 chmod 644 $RPM_BUILD_ROOT/usr/man/man8/nmbd.8
84 cp -af docs/smb.conf $RPM_BUILD_ROOT/etc/smb.conf.sampl
85 chown 0.0 $RPM_BUILD_ROOT/etc/smb.conf.sampl
86 chmod 644 $RPM_BUILD_ROOT/etc/smb.conf.sampl
87 if [ -x $RPM_BUILD_ROOT/etc/smb.conf ]; then
88         target = $RPM_BUILD_ROOT/etc/smb.conf.new
89 else
90         target = $RPM_BUILD_ROOT/etc/smb.conf
91 fi
92 cp -af examples/redhat/smb.conf $target
93 chown 0.0 $target
94 chmod 644 $target
95 cp -af examples/redhat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d
96 chown 0.0 $RPM_BUILD_ROOT/etc/rc.d/init.d/smb.init
97 chmod 644 $RPM_BUILD_ROOT/etc/rc.d/init.d/smb.init
98 ln -sf $RPM_BUILD_ROOT/etc/rc.d/init.d/smb $RPM_BUILD_ROOT/etc/rc.d/rc3.d/S91smb
99 ln -sf $RPM_BUILD_ROOT/etc/rc.d/init.d/smb $RPM_BUILD_ROOT/etc/rc.d/rc0.d/K35smb
100 ln -sf $RPM_BUILD_ROOT/etc/rc.d/init.d/smb $RPM_BUILD_ROOT/etc/rc.d/rc6.d/K35smb
101 ln -sf $RPM_BUILD_ROOT/etc/rc.d/init.d/smb $RPM_BUILD_ROOT/etc/rc.d/rc1.d/K35smb
102 mkdir -p $RPM_BUILD_ROOT/home/samba
103 mkdir -p $RPM_BUILD_ROOT/var/lock/samba
104 chown root.nobody $RPM_BUILD_ROOT/home/samba
105 chmod 775 $RPM_BUILD_ROOT/home/samba
106 cp -af examples/redhat/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/samba.log
107 chown 0.0 $RPM_BUILD_ROOT/etc/logrotate.d/samba.log
108 chmod 644 $RPM_BUILD_ROOT/etc/logrotate.d/samba.log
109
110 %post
111 /sbin/pamconfig --add --service=samba --password=none --sesslist=none
112
113 if [ ! -f /var/log/samba ]; then
114         touch /var/log/samba
115         chmod 600 /var/log/samba
116 fi
117
118 %postun
119 if [ "$1" = 0 ] ; then
120   /sbin/pamconfig --remove --service=samba --password=none --sesslist=none
121 fi
122
123 %files
124 %doc docs/*.txt docs/INSTALL.sambatar docs/MIRRORS docs/PROJECTS 
125 %doc docs/README.DCEDFS docs/README.jis docs/README.sambatar 
126 %doc docs/SMBTAR.notes docs/THANKS docs/announce docs/history
127 %doc docs/samba.faq docs/samba.lsm docs/wfw_slip.htm 
128 %doc examples
129 /usr/sbin/smbd
130 /usr/bin/addtosmbpass
131 /usr/bin/mksmbpasswd.sh
132 /usr/bin/smbclient
133 /usr/sbin/nmbd
134 /usr/bin/testparm
135 /usr/bin/testprns
136 /usr/bin/smbrun
137 /usr/bin/smbstatus
138 /usr/bin/nmblookup
139 /usr/bin/smbpasswd
140 /usr/bin/smbtar
141 %config /etc/smb.conf
142 %config /etc/smb.conf.sampl
143 %config /etc/rc.d/init.d/smb
144 %config /etc/rc.d/rc3.d/S91smb
145 %config /etc/rc.d/rc0.d/K35smb
146 %config /etc/rc.d/rc1.d/K35smb
147 %config /etc/rc.d/rc6.d/K35smb
148 %config /etc/logrotate.d/samba
149 /usr/man/man1/smbstatus.1
150 /usr/man/man1/smbclient.1
151 /usr/man/man1/smbrun.1
152 /usr/man/man1/smbtar.1
153 /usr/man/man1/testparm.1
154 /usr/man/man1/testprns.1
155 /usr/man/man5/smb.conf.5
156 /usr/man/man7/samba.7
157 /usr/man/man8/smbd.8
158 /usr/man/man8/nmbd.8
159 %dir /home/samba
160 %dir /var/lock/samba