Annotation of /branches/magellan-next/core/samba/samba-3.5.9-r1.smage2
Parent Directory | Revision Log
Revision 8432 -
(hide annotations)
(download)
Mon Jul 18 18:39:29 2011 UTC (12 years, 10 months ago) by niro
File size: 7021 byte(s)
Mon Jul 18 18:39:29 2011 UTC (12 years, 10 months ago) by niro
File size: 7021 byte(s)
auto added: ver bump to 3.5.9-r1
1 | niro | 8432 | # $Id$ |
2 | |||
3 | PNAME="samba" | ||
4 | PVER="3.5.9" | ||
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-libs/popt-1.16 | ||
15 | >= sys-libs/ncurses-5.9 | ||
16 | >= sys-libs/readline-6.2 | ||
17 | >= app-admin/gamin-0.1.10 | ||
18 | >= dev-libs/openssl-1.0.0 | ||
19 | >= net-dns/avahi-0.6.30" | ||
20 | |||
21 | SDEPEND=">= sys-dev/automake-4 | ||
22 | >= sys-dev/autoconf-5 | ||
23 | >= sys-apps/sed-4" | ||
24 | |||
25 | SRCFILE="${PNAME}-${PVER}.tar.gz" | ||
26 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
27 | |||
28 | FILESDIR="${SOURCEDIR}/samba" | ||
29 | |||
30 | sminclude mtools | ||
31 | |||
32 | SRC_URI=( | ||
33 | http://us1.samba.org/samba/ftp/stable/${SRCFILE} | ||
34 | mirror://${PNAME}/${SRCFILE} | ||
35 | mirror://${PNAME}/smb.conf-3.0.14a | ||
36 | mirror://${PNAME}/lmhosts | ||
37 | mirror://${PNAME}/smbusers | ||
38 | mirror://${PNAME}/samba.rc | ||
39 | mirror://${PNAME}/nmbd.service | ||
40 | mirror://${PNAME}/smbd.service | ||
41 | ) | ||
42 | |||
43 | UP2DATE="updatecmd http://ftp.samba.org/pub/samba | grep ${PNAME}-[0-9].* | lasttarball gz" | ||
44 | |||
45 | src_prepare() | ||
46 | { | ||
47 | munpack ${SRCFILE} || die | ||
48 | cd ${SRCDIR} | ||
49 | |||
50 | # examples: to be copied as docs | ||
51 | rm -rf ${SRCDIR}/examples.ORIG || die | ||
52 | |||
53 | # add our vendor suffix | ||
54 | sed -i "s:^\(SAMBA_VERSION_VENDOR_SUFFIX=\).*:\1\"magellan\":" ${SRCDIR}/source3/VERSION || die | ||
55 | cd ${SRCDIR}/source3 | ||
56 | sh script/mkversion.sh || die | ||
57 | |||
58 | # compilation fix | ||
59 | # (u)mount.cifs is broken; missing include/version.h header | ||
60 | ln -snf ../include ${SRCDIR}/source3/client || die | ||
61 | } | ||
62 | |||
63 | src_compile() | ||
64 | { | ||
65 | cd ${SRCDIR}/source3 | ||
66 | |||
67 | # remove swat completely now; since we have no httpd server yet | ||
68 | # if really needed we make an extra package to save diskspace | ||
69 | # --disable-swat option is there, no patches needed anymore ;) | ||
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=/var/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-cifsmount \ | ||
83 | --with-automount \ | ||
84 | --with-libsmbclient \ | ||
85 | --with-syslog \ | ||
86 | --without-acl-support \ | ||
87 | --enable-cups \ | ||
88 | --without-krb5 \ | ||
89 | --without-ldap \ | ||
90 | --with-readline \ | ||
91 | --with-winbind \ | ||
92 | --without-pam \ | ||
93 | --without-pam_smbpass \ | ||
94 | --with-quotas \ | ||
95 | --with-sys-quotas \ | ||
96 | --with-cifsmount=no \ | ||
97 | --disable-swat \ | ||
98 | --enable-avahi \ | ||
99 | --disable-developer \ | ||
100 | --disable-dmalloc \ | ||
101 | || die | ||
102 | |||
103 | mmake proto || die | ||
104 | mmake everything || die | ||
105 | |||
106 | # build mount.cifs separatly to fix pic issues | ||
107 | mmake bin/mount.cifs || die | ||
108 | mmake bin/umount.cifs || die | ||
109 | } | ||
110 | |||
111 | src_install() | ||
112 | { | ||
113 | cd ${SRCDIR}/source3 | ||
114 | |||
115 | # needed directories | ||
116 | minstalldir /etc/samba || die | ||
117 | minstalldir /sbin || die | ||
118 | minstalldir /usr/$(mlibdir)/cups/backend || die | ||
119 | minstalldir /usr/share/doc/${PNAME}-${PVER}/examples || die | ||
120 | |||
121 | # needed directories by samba at runtime | ||
122 | mkeepdir /var/log/samba || die | ||
123 | mkeepdir /var/run/samba || die | ||
124 | mkeepdir /var/cache/samba || die | ||
125 | mkeepdir /var/lib/samba/netlogon || die | ||
126 | mkeepdir /var/lib/samba/profiles || die | ||
127 | mkeepdir /var/lib/samba/printers/W32X86 || die | ||
128 | mkeepdir /var/lib/samba/printers/WIN40 || die | ||
129 | mkeepdir /var/lib/samba/printers/W32ALPHA || die | ||
130 | mkeepdir /var/lib/samba/printers/W32MIPS || die | ||
131 | mkeepdir /var/lib/samba/printers/W32PPC || die | ||
132 | mkeepdir /var/lib/samba/private || die | ||
133 | mkeepdir /var/spool/samba || die | ||
134 | |||
135 | # fix permissions | ||
136 | mchmod 0700 /var/lib/samba/private || die | ||
137 | mchmod 1777 /var/spool/samba || die | ||
138 | |||
139 | make DESTDIR=${BINDIR} install-everything || die | ||
140 | |||
141 | # if exist remove *.old binaries | ||
142 | if [[ -n $(find ${BINDIR}/usr/bin -type f -name '*.old') ]] | ||
143 | then | ||
144 | for i in ${BINDIR}/usr/bin/*.old | ||
145 | do | ||
146 | [[ -e ${i} ]] && rm -f ${i} || die | ||
147 | done | ||
148 | fi | ||
149 | |||
150 | # install wins nsswitch extensions | ||
151 | minstalldir /usr/$(mlibdir) || die | ||
152 | minstallfile ${SRCDIR}/nsswitch/libnss_wins.so /usr/$(mlibdir) || die | ||
153 | mlink libnss_wins.so /usr/$(mlibdir)/libnss_wins.so.2 || die | ||
154 | minstallfile ${SRCDIR}/nsswitch/libnss_winbind.so /usr/$(mlibdir) || die | ||
155 | mlink libnss_winbind.so /usr/$(mlibdir)/libnss_winbind.so.2 || die | ||
156 | |||
157 | # install cifs tools | ||
158 | minstallexec bin/mount.cifs || die | ||
159 | minstallexec bin/umount.cifs || die | ||
160 | mchmod 4755 /usr/bin/mount.cifs || die | ||
161 | mchmod 4755 /usr/bin/umount.cifs || die | ||
162 | |||
163 | # add support for mount | ||
164 | mlink ../usr/bin/mount.cifs /sbin/mount.cifs || die | ||
165 | |||
166 | # samba doesn't create these symlinks anymore | ||
167 | mlink samba/libsmbclient.so /usr/$(mlibdir)/libsmbclient.so.0 || die | ||
168 | mlink samba/libsmbclient.so /usr/$(mlibdir)/libsmbclient.so || die | ||
169 | mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so.1 || die | ||
170 | mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so || die | ||
171 | mlink samba/libtdb.so /usr/$(mlibdir)/libtdb.so.1 || die | ||
172 | mlink samba/libtdb.so /usr/$(mlibdir)/libtdb.so || die | ||
173 | mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so.0 || die | ||
174 | mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so || die | ||
175 | |||
176 | # add cups printing support | ||
177 | mlink ../../../bin/smbspool /usr/$(mlibdir)/cups/backend/smb || die | ||
178 | |||
179 | # install our config files | ||
180 | # fake smb.conf to get smbmount work | ||
181 | memptyfile /etc/samba/smb.conf || die | ||
182 | |||
183 | # our smb example config | ||
184 | minstalletc smb.conf-3.0.14a smb.conf.example /etc/samba || die | ||
185 | |||
186 | # our lmhosts and smbusers config | ||
187 | minstalletc lmhosts lmhosts /etc/samba || die | ||
188 | minstalletc smbusers smbusers /etc/samba || die | ||
189 | |||
190 | # our initscript | ||
191 | minstallrc samba.rc samba || die | ||
192 | |||
193 | # install systemd units | ||
194 | minstallunit nmbd.service || die | ||
195 | minstallunit smbd.service || die | ||
196 | |||
197 | # # install example docs - not wanted anymore to save some space | ||
198 | # cp -a ${SRCDIR}/examples/* ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples || die | ||
199 | # | ||
200 | # # fix all permissions | ||
201 | # chmod -R 755 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples -type d) || die | ||
202 | # chmod -R 644 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples ! -type d) || die | ||
203 | |||
204 | # # remove unneeded docs, this saves some space ;) | ||
205 | # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/help/{guide,howto,devel} || die | ||
206 | # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/using_samba || die | ||
207 | |||
208 | # using a patch now | ||
209 | # # remove swat completely now; since we have no httpd server yet | ||
210 | # # if really needed we make an extra package to save diskspace | ||
211 | # rm -f ${BINDIR}/usr/sbin/swat || die | ||
212 | # rm -f ${BINDIR}/usr/share/man/man8/swat.8 || die | ||
213 | # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat || die | ||
214 | |||
215 | # other docs | ||
216 | cd ${SRCDIR} | ||
217 | minstalldocs COPYING Manifest README REVISION Read-Manifest-Now Roadmap WHATSNEW.txt || die | ||
218 | } | ||
219 | |||
220 | postinstall() | ||
221 | { | ||
222 | mstartunit nmbd.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 smbd.service | ||
241 | } |