Magellan Linux

Contents of /branches/magellan-next/core/samba/samba-3.6.1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9141 - (show annotations) (download)
Mon Nov 7 19:29:09 2011 UTC (12 years, 7 months ago) by niro
File size: 7214 byte(s)
-install better systemd units
-install missing logrotate
-dropped old sysV support
1 # $Id$
2
3 PNAME="samba"
4 PVER="3.6.1"
5 PBUILD="r1"
6
7 PCATEGORIE="net-fs"
8
9 DESCRIPTION="Samba provides seamless file and print services to SMB/CIFS clients."
10 HOMEPAGE="http://www.samba.org"
11
12 DEPEND=">= virtual/glibc
13 >= net-print/cups-1.4
14 >= dev-db/tdb-1.2.9
15 >= dev-libs/popt-1.16
16 >= sys-libs/ncurses-5.9
17 >= sys-libs/readline-6.2
18 >= app-admin/gamin-0.1.10
19 >= dev-libs/openssl-1.0.0
20 >= net-dns/avahi-0.6.30"
21
22 SDEPEND=">= sys-dev/automake-4
23 >= sys-dev/autoconf-5
24 >= sys-apps/sed-4"
25
26 SRCFILE="${PNAME}-${PVER}.tar.gz"
27 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
28
29 FILESDIR="${SOURCEDIR}/samba"
30
31 sminclude mtools
32
33 SMBD_SVC_VER=1.3
34 NMBD_SVC_VER=1.2
35
36 SRC_URI=(
37 http://us1.samba.org/samba/ftp/stable/${SRCFILE}
38 mirror://${PNAME}/${SRCFILE}
39 mirror://${PNAME}/smb.conf-3.0.14a
40 mirror://${PNAME}/lmhosts
41 mirror://${PNAME}/smbusers
42 mirror://${PNAME}/samba.confd
43 mirror://${PNAME}/samba.logrotate
44 mirror://${PNAME}/nmbd.service-${NMBD_SVC_VER}
45 mirror://${PNAME}/smbd.service-${SMBD_SVC_VER}
46 mirror://${PNAME}/winbindd.service
47 )
48
49 UP2DATE="updatecmd http://ftp.samba.org/pub/samba | grep ${PNAME}-[0-9].* | lasttarball gz"
50
51 src_prepare()
52 {
53 munpack ${SRCFILE} || die
54 cd ${SRCDIR}
55
56 # examples: to be copied as docs
57 rm -rf ${SRCDIR}/examples.ORIG || die
58
59 # add our vendor suffix
60 sed -i "s:^\(SAMBA_VERSION_VENDOR_SUFFIX=\).*:\1\"magellan\":" ${SRCDIR}/source3/VERSION || die
61 cd ${SRCDIR}/source3
62 sh script/mkversion.sh || die
63
64 # compilation fix
65 # (u)mount.cifs is broken; missing include/version.h header
66 ln -snf ../include ${SRCDIR}/source3/client || die
67 }
68
69 src_compile()
70 {
71 cd ${SRCDIR}/source3
72
73 # remove swat completely now; since we have no httpd server yet
74 # if really needed we make an extra package to save diskspace
75 mconfigure \
76 --with-fhs \
77 --sysconfdir=/etc/samba \
78 --localstatedir=/var \
79 --with-configdir=/etc/samba \
80 --libdir=/usr/$(mlibdir)/samba \
81 --with-swatdir=/usr/share/doc/${PNAME}-${PVER}/swat \
82 --with-piddir=/var/run/samba \
83 --with-lockdir=/var/cache/samba \
84 --with-logfilebase=/var/log/samba \
85 --with-privatedir=/var/lib/samba/private \
86 --enable-shared-libs \
87 --with-cifsmount \
88 --with-automount \
89 --with-libsmbclient \
90 --with-syslog \
91 --without-acl-support \
92 --enable-cups \
93 --without-krb5 \
94 --without-ldap \
95 --with-readline \
96 --with-winbind \
97 --without-pam \
98 --without-pam_smbpass \
99 --without-libtdb \
100 --enable-external-libtdb \
101 --with-quotas \
102 --with-sys-quotas \
103 --with-cifsmount=no \
104 --disable-swat \
105 --enable-avahi \
106 --disable-developer \
107 --disable-dmalloc \
108 || die
109
110 mmake proto || die
111 mmake everything || die
112 }
113
114 src_install()
115 {
116 cd ${SRCDIR}/source3
117
118 # needed directories
119 minstalldir /etc/samba || die
120 minstalldir /sbin || die
121 minstalldir /usr/$(mlibdir)/cups/backend || die
122 minstalldir /usr/share/doc/${PNAME}-${PVER}/examples || die
123
124 # needed directories by samba at runtime
125 mkeepdir /var/log/samba || die
126 mkeepdir /var/run/samba || die
127 mkeepdir /var/cache/samba || die
128 mkeepdir /var/lib/samba/netlogon || die
129 mkeepdir /var/lib/samba/profiles || die
130 mkeepdir /var/lib/samba/printers/W32X86 || die
131 mkeepdir /var/lib/samba/printers/WIN40 || die
132 mkeepdir /var/lib/samba/printers/W32ALPHA || die
133 mkeepdir /var/lib/samba/printers/W32MIPS || die
134 mkeepdir /var/lib/samba/printers/W32PPC || die
135 mkeepdir /var/lib/samba/private || die
136 mkeepdir /var/spool/samba || die
137
138 # fix permissions
139 mchmod 0700 /var/lib/samba/private || die
140 mchmod 1777 /var/spool/samba || die
141
142 make DESTDIR=${BINDIR} install-everything || die
143
144 # if exist remove *.old binaries
145 if [[ -n $(find ${BINDIR}/usr/bin -type f -name '*.old') ]]
146 then
147 for i in ${BINDIR}/usr/bin/*.old
148 do
149 [[ -e ${i} ]] && rm -f ${i} || die
150 done
151 fi
152
153 # install wins nsswitch extensions
154 minstalldir /usr/$(mlibdir) || die
155 minstallfile ${SRCDIR}/nsswitch/libnss_wins.so /usr/$(mlibdir) || die
156 mlink libnss_wins.so /usr/$(mlibdir)/libnss_wins.so.2 || die
157 minstallfile ${SRCDIR}/nsswitch/libnss_winbind.so /usr/$(mlibdir) || die
158 mlink libnss_winbind.so /usr/$(mlibdir)/libnss_winbind.so.2 || die
159
160 # install cifs tools
161 minstallexec bin/mount.cifs || die
162 minstallexec bin/umount.cifs || die
163 mchmod 4755 /usr/bin/mount.cifs || die
164 mchmod 4755 /usr/bin/umount.cifs || die
165
166 # add support for mount
167 mlink ../usr/bin/mount.cifs /sbin/mount.cifs || die
168
169 # samba doesn't create these symlinks anymore
170 mlink samba/libsmbclient.so /usr/$(mlibdir)/libsmbclient.so.0 || die
171 mlink samba/libsmbclient.so /usr/$(mlibdir)/libsmbclient.so || die
172 mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so.1 || die
173 mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so || die
174 mlink samba/libtdb.so /usr/$(mlibdir)/libtdb.so.1 || die
175 mlink samba/libtdb.so /usr/$(mlibdir)/libtdb.so || die
176 mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so.0 || die
177 mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so || die
178
179 # add cups printing support
180 mlink ../../../bin/smbspool /usr/$(mlibdir)/cups/backend/smb || die
181
182 # install our config files
183 # fake smb.conf to get smbmount work
184 memptyfile /etc/samba/smb.conf || die
185
186 # our smb example config
187 minstalletc smb.conf-3.0.14a smb.conf.example /etc/samba || die
188
189 # our lmhosts and smbusers config
190 minstalletc lmhosts lmhosts /etc/samba || die
191 minstalletc smbusers smbusers /etc/samba || die
192
193 # install systemd units
194 minstallconf samba.confd samba || die
195 minstallunit nmbd.service-${NMBD_SVC_VER} nmbd.service || die
196 minstallunit smbd.service-${SMBD_SVC_VER} smbd.service || die
197 minstallunit winbindd.service || die
198
199 # install logrotate config
200 minstalllog samba.logrotate samba || die
201
202 # # install example docs - not wanted anymore to save some space
203 # cp -a ${SRCDIR}/examples/* ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples || die
204 #
205 # # fix all permissions
206 # chmod -R 755 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples -type d) || die
207 # chmod -R 644 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples ! -type d) || die
208
209 # # remove unneeded docs, this saves some space ;)
210 # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/help/{guide,howto,devel} || die
211 # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/using_samba || die
212
213 # using a patch now
214 # # remove swat completely now; since we have no httpd server yet
215 # # if really needed we make an extra package to save diskspace
216 # rm -f ${BINDIR}/usr/sbin/swat || die
217 # rm -f ${BINDIR}/usr/share/man/man8/swat.8 || die
218 # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat || die
219
220 # other docs
221 cd ${SRCDIR}
222 minstalldocs COPYING Manifest README REVISION Read-Manifest-Now Roadmap WHATSNEW.txt || die
223 }
224
225 postinstall()
226 {
227 mstartunit nmbd.service
228 mstartunit smbd.service
229
230 echo
231 echo "To initialize samba's password database, please run:"
232 echo " pdbedit --force-initialized-passwords"
233 echo
234 echo "If you experience client locks in file transfers _only_, try the parameter"
235 echo " use sendfile = no (man smb.conf(5), man sendfile(2))"
236 echo
237 echo "There also seem some problems with the smbfs implementation of the recent 2.6 kernels."
238 echo "If you experience problems (lockups) with smbfs, try cifs as an alternative."
239 echo
240 }
241
242 postremove()
243 {
244 mstopunit nmbd.service
245 mstopunit smbd.service
246 }