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