Contents of /branches/magellan-next/core/samba/samba-3.6.1-r1.smage2
Parent Directory | Revision Log
Revision 9144 -
(show annotations)
(download)
Mon Nov 7 20:58:48 2011 UTC (12 years, 10 months ago) by niro
File size: 7308 byte(s)
Mon Nov 7 20:58:48 2011 UTC (12 years, 10 months ago) by niro
File size: 7308 byte(s)
-do not install libtdb symlinks -make use of cifs-utils -start winbindd
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 | >= 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=/var/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-cifsmount \ |
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 | --with-quotas \ |
103 | --with-sys-quotas \ |
104 | --with-cifsmount=no \ |
105 | --disable-swat \ |
106 | --enable-avahi \ |
107 | --disable-developer \ |
108 | --disable-dmalloc \ |
109 | || die |
110 | |
111 | mmake proto || die |
112 | mmake everything || 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 | # install systemd units |
195 | minstallconf samba.confd samba || die |
196 | minstallunit nmbd.service-${NMBD_SVC_VER} nmbd.service || die |
197 | minstallunit smbd.service-${SMBD_SVC_VER} smbd.service || die |
198 | minstallunit winbindd.service || die |
199 | |
200 | # install logrotate config |
201 | minstalllog samba.logrotate samba || die |
202 | |
203 | # # install example docs - not wanted anymore to save some space |
204 | # cp -a ${SRCDIR}/examples/* ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples || die |
205 | # |
206 | # # fix all permissions |
207 | # chmod -R 755 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples -type d) || die |
208 | # chmod -R 644 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples ! -type d) || die |
209 | |
210 | # # remove unneeded docs, this saves some space ;) |
211 | # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/help/{guide,howto,devel} || die |
212 | # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/using_samba || die |
213 | |
214 | # using a patch now |
215 | # # remove swat completely now; since we have no httpd server yet |
216 | # # if really needed we make an extra package to save diskspace |
217 | # rm -f ${BINDIR}/usr/sbin/swat || die |
218 | # rm -f ${BINDIR}/usr/share/man/man8/swat.8 || die |
219 | # rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat || die |
220 | |
221 | # other docs |
222 | cd ${SRCDIR} |
223 | minstalldocs COPYING Manifest README REVISION Read-Manifest-Now Roadmap WHATSNEW.txt || die |
224 | } |
225 | |
226 | postinstall() |
227 | { |
228 | mstartunit nmbd.service |
229 | mstartunit winbindd.service |
230 | mstartunit smbd.service |
231 | |
232 | echo |
233 | echo "To initialize samba's password database, please run:" |
234 | echo " pdbedit --force-initialized-passwords" |
235 | echo |
236 | echo "If you experience client locks in file transfers _only_, try the parameter" |
237 | echo " use sendfile = no (man smb.conf(5), man sendfile(2))" |
238 | echo |
239 | echo "There also seem some problems with the smbfs implementation of the recent 2.6 kernels." |
240 | echo "If you experience problems (lockups) with smbfs, try cifs as an alternative." |
241 | echo |
242 | } |
243 | |
244 | postremove() |
245 | { |
246 | mstopunit nmbd.service |
247 | mstopunit winbindd.service |
248 | mstopunit smbd.service |
249 | } |