Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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