Magellan Linux

Contents of /trunk/extras/samba/samba-3.6.8-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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