Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15459 - (show annotations) (download)
Wed Jan 2 12:13:17 2013 UTC (11 years, 5 months ago) by niro
File size: 7055 byte(s)
-release branches/R11-stable
1 # $Id$
2
3 PNAME="samba"
4 PVER="3.6.9"
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.5
14 >= dev-db/tdb-1.2.10
15 >= dev-libs/popt-1.16
16 >= dev-libs/talloc-2.0.7
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.6"
23
24 SDEPEND=">= sys-dev/automake-4
25 >= sys-dev/autoconf-5
26 >= sys-apps/sed-4"
27
28 SRCFILE="${PNAME}-${PVER}.tar.gz"
29 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
30
31 FILESDIR="${SOURCEDIR}/samba"
32
33 sminclude mtools
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 cd ${SRCDIR}
57
58 # examples: to be copied as docs
59 rm -rf ${SRCDIR}/examples.ORIG || die
60
61 # add our vendor suffix
62 sed -i "s:^\(SAMBA_VERSION_VENDOR_SUFFIX=\).*:\1\"magellan\":" ${SRCDIR}/source3/VERSION || die
63 cd ${SRCDIR}/source3
64 sh script/mkversion.sh || die
65
66 # compilation fix
67 # (u)mount.cifs is broken; missing include/version.h header
68 ln -snf ../include ${SRCDIR}/source3/client || die
69 }
70
71 src_compile()
72 {
73 cd ${SRCDIR}/source3
74
75 # remove swat completely now; since we have no httpd server yet
76 # if really needed we make an extra package to save diskspace
77 mconfigure \
78 --with-fhs \
79 --sysconfdir=/etc/samba \
80 --localstatedir=/var \
81 --with-configdir=/etc/samba \
82 --libdir=/usr/$(mlibdir)/samba \
83 --with-swatdir=/usr/share/doc/${PNAME}-${PVER}/swat \
84 --with-piddir=/run/samba \
85 --with-lockdir=/var/cache/samba \
86 --with-logfilebase=/var/log/samba \
87 --with-privatedir=/var/lib/samba/private \
88 --enable-shared-libs \
89 --with-automount \
90 --with-libsmbclient \
91 --with-syslog \
92 --without-acl-support \
93 --enable-cups \
94 --without-krb5 \
95 --without-ldap \
96 --with-readline \
97 --with-winbind \
98 --without-pam \
99 --without-pam_smbpass \
100 --without-libtdb \
101 --enable-external-libtdb \
102 --without-libtalloc \
103 --enable-external-libtalloc \
104 --with-quotas \
105 --with-sys-quotas \
106 --with-cifsmount=no \
107 --disable-swat \
108 --enable-avahi \
109 --disable-developer \
110 --disable-dmalloc \
111 || die
112
113 mmake || die
114 }
115
116 src_install()
117 {
118 cd ${SRCDIR}/source3
119
120 # needed directories
121 minstalldir /etc/samba || 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 /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 # samba doesn't create these symlinks anymore
162 mlink samba/libsmbclient.so /usr/$(mlibdir)/libsmbclient.so.0 || die
163 mlink samba/libsmbclient.so /usr/$(mlibdir)/libsmbclient.so || die
164 mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so.1 || die
165 mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so || die
166 mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so.0 || die
167 mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so || die
168
169 # add cups printing support
170 mlink ../../../bin/smbspool /usr/$(mlibdir)/cups/backend/smb || die
171
172 # install our config files
173 # fake smb.conf to get smbmount work
174 memptyfile /etc/samba/smb.conf || die
175
176 # our smb example config
177 minstalletc smb.conf-3.0.14a smb.conf.example /etc/samba || die
178
179 # our lmhosts and smbusers config
180 minstalletc lmhosts lmhosts /etc/samba || die
181 minstalletc smbusers smbusers /etc/samba || die
182
183 # install systemd units
184 minstallconf samba.confd samba || die
185 minstallunit nmbd.service-${NMBD_SVC_VER} nmbd.service || die
186 minstallunit smbd.service-${SMBD_SVC_VER} smbd.service || die
187 minstallunit winbindd.service || die
188 minstalldir /etc/tmpfiles.d || die
189 MCONFIG=/etc/tmpfiles.d/samba.conf
190 mclearconfig || die
191 maddconfig 'd /run/samba 0755 root root -'
192
193 # install logrotate config
194 minstalllog samba.logrotate samba || die
195
196 # # install example docs - not wanted anymore to save some space
197 # cp -a ${SRCDIR}/examples/* ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples || die
198 #
199 # # fix all permissions
200 # chmod -R 755 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples -type d) || die
201 # chmod -R 644 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples ! -type d) || die
202
203 # # remove unneeded docs, this saves some space ;)
204 # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/help/{guide,howto,devel} || die
205 # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/using_samba || die
206
207 # using a patch now
208 # # remove swat completely now; since we have no httpd server yet
209 # # if really needed we make an extra package to save diskspace
210 # rm -f ${BINDIR}/usr/sbin/swat || die
211 # rm -f ${BINDIR}/usr/share/man/man8/swat.8 || die
212 # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat || die
213
214 # other docs
215 cd ${SRCDIR}
216 minstalldocs COPYING Manifest README REVISION Read-Manifest-Now Roadmap WHATSNEW.txt || die
217 }
218
219 postinstall()
220 {
221 mstartunit nmbd.service
222 mstartunit winbindd.service
223 mstartunit smbd.service
224
225 echo
226 echo "To initialize samba's password database, please run:"
227 echo " pdbedit --force-initialized-passwords"
228 echo
229 echo "If you experience client locks in file transfers _only_, try the parameter"
230 echo " use sendfile = no (man smb.conf(5), man sendfile(2))"
231 echo
232 echo "There also seem some problems with the smbfs implementation of the recent 2.6 kernels."
233 echo "If you experience problems (lockups) with smbfs, try cifs as an alternative."
234 echo
235 }
236
237 postremove()
238 {
239 mstopunit nmbd.service
240 mstopunit winbindd.service
241 mstopunit smbd.service
242 }