Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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