Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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