Magellan Linux

Contents of /branches/R11-stable/extras/samba/samba-3.6.15-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 18018 - (show annotations) (download)
Thu Jun 27 06:45:22 2013 UTC (10 years, 10 months ago) by niro
File size: 7128 byte(s)
-release branches/R11-stable
1 # $Id$
2
3 PNAME="samba"
4 PVER="3.6.15"
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.12
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 # using external talloc
157 # all-abis 'mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so.1 || die'
158 # all-abis 'mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so || die'
159 all-abis 'mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so.0 || die'
160 all-abis 'mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so || die'
161
162 # add cups printing support
163 all-abis 'mlink ../../../bin/smbspool /usr/$(mlibdir)/cups/backend/smb || die'
164
165 # install our config files
166 # fake smb.conf to get smbmount work
167 memptyfile /etc/samba/smb.conf || die
168
169 # our smb example config
170 minstalletc smb.conf-3.0.14a smb.conf.example /etc/samba || die
171
172 # our lmhosts and smbusers config
173 minstalletc lmhosts lmhosts /etc/samba || die
174 minstalletc smbusers smbusers /etc/samba || die
175
176 # install systemd units
177 minstallconf samba.confd samba || die
178 minstallunit nmbd.service-${NMBD_SVC_VER} nmbd.service || die
179 minstallunit smbd.service-${SMBD_SVC_VER} smbd.service || die
180 minstallunit winbindd.service || die
181 minstalldir /etc/tmpfiles.d || die
182 MCONFIG=/etc/tmpfiles.d/samba.conf
183 mclearconfig || die
184 maddconfig 'd /run/samba 0755 root root -'
185
186 # install logrotate config
187 minstalllog samba.logrotate samba || die
188
189 # # install example docs - not wanted anymore to save some space
190 # cp -a ${SRCDIR}/examples/* ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples || die
191 #
192 # # fix all permissions
193 # chmod -R 755 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples -type d) || die
194 # chmod -R 644 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples ! -type d) || die
195
196 # # remove unneeded docs, this saves some space ;)
197 # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/help/{guide,howto,devel} || die
198 # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/using_samba || die
199
200 # using a patch now
201 # # remove swat completely now; since we have no httpd server yet
202 # # if really needed we make an extra package to save diskspace
203 # rm -f ${BINDIR}/usr/sbin/swat || die
204 # rm -f ${BINDIR}/usr/share/man/man8/swat.8 || die
205 # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat || die
206
207 # other docs
208 minstalldocs COPYING Manifest README REVISION Read-Manifest-Now Roadmap WHATSNEW.txt || die
209 }
210
211 postinstall()
212 {
213 mstartunit nmbd.service
214 mstartunit winbindd.service
215 mstartunit smbd.service
216
217 echo
218 echo "To initialize samba's password database, please run:"
219 echo " pdbedit --force-initialized-passwords"
220 echo
221 echo "If you experience client locks in file transfers _only_, try the parameter"
222 echo " use sendfile = no (man smb.conf(5), man sendfile(2))"
223 echo
224 echo "There also seem some problems with the smbfs implementation of the recent 2.6 kernels."
225 echo "If you experience problems (lockups) with smbfs, try cifs as an alternative."
226 echo
227 }
228
229 postremove()
230 {
231 mstopunit nmbd.service
232 mstopunit winbindd.service
233 mstopunit smbd.service
234 }