Magellan Linux

Contents of /trunk/extras/samba/samba-3.6.1-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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