Gentoo Archives: gentoo-commits

From: "Robert Piasek (dagger)" <dagger@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-fs/samba: samba-3.6.0_rc2.ebuild
Date: Thu, 30 Jun 2011 15:50:39
Message-Id: 20110630155029.0377820057@flycatcher.gentoo.org
1 dagger 11/06/30 15:50:28
2
3 Added: samba-3.6.0_rc2.ebuild
4 Log:
5 add RC2 of Samba 3.6
6
7 (Portage version: 2.1.10.3/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 net-fs/samba/samba-3.6.0_rc2.ebuild
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-fs/samba/samba-3.6.0_rc2.ebuild?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-fs/samba/samba-3.6.0_rc2.ebuild?rev=1.1&content-type=text/plain
14
15 Index: samba-3.6.0_rc2.ebuild
16 ===================================================================
17 # Copyright 1999-2011 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19 # $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.6.0_rc2.ebuild,v 1.1 2011/06/30 15:50:28 dagger Exp $
20
21 EAPI=4
22
23 inherit pam versionator multilib eutils
24
25 MY_PV=${PV/_/}
26 MY_P="${PN}-${MY_PV}"
27
28 DESCRIPTION="Library bits of the samba network filesystem"
29 HOMEPAGE="http://www.samba.org/"
30 SRC_URI="mirror://samba/rc/${MY_P}.tar.gz"
31 LICENSE="GPL-3"
32 SLOT="0"
33 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
34 IUSE="acl addns ads +aio avahi caps +client cluster cups debug doc examples fam
35 ldap ldb +netapi pam quota +readline +server +smbclient smbsharemodes
36 swat syslog winbind"
37
38 DEPEND="dev-libs/popt
39 !net-fs/samba-client
40 !net-fs/samba-libs
41 !net-fs/samba-server
42 >=sys-libs/talloc-2.0.5
43 >=sys-libs/tdb-1.2.9
44 virtual/libiconv
45 ads? ( virtual/krb5 sys-fs/e2fsprogs
46 client? ( sys-apps/keyutils
47 net-fs/cifs-utils[ads] ) )
48 avahi? ( net-dns/avahi[dbus] )
49 caps? ( sys-libs/libcap )
50 client? ( !net-fs/mount-cifs
51 dev-libs/iniparser
52 net-fs/cifs-utils )
53 cluster? ( >=dev-db/ctdb-1.0.114_p1 )
54 cups? ( net-print/cups )
55 debug? ( dev-libs/dmalloc )
56 fam? ( virtual/fam )
57 ldap? ( net-nds/openldap )
58 pam? ( virtual/pam
59 winbind? ( dev-libs/iniparser )
60 )
61 readline? ( >=sys-libs/readline-5.2 )
62 syslog? ( virtual/logger )"
63
64 RDEPEND="${DEPEND}"
65
66 # Disable tests since we don't want to build that much here
67 RESTRICT="test"
68
69 SBINPROGS=""
70 BINPROGS=""
71 KRBPLUGIN=""
72 PLUGINEXT=".so"
73 SHAREDMODS=""
74
75 S="${WORKDIR}/${MY_P}/source3"
76
77 # TODO:
78 # - enable iPrint on Prefix/OSX and Darwin?
79 # - selftest-prefix? selftest?
80 # - AFS?
81
82 CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
83
84 REQUIRED_USE="
85 ads? ( ldap )
86 swat? ( server )
87 "
88
89 pkg_setup() {
90 if use server ; then
91 SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
92 BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
93 bin/profiles bin/sharesec bin/eventlogadm bin/smbta-util"
94
95 use swat && SBINPROGS="${SBINPROGS} bin/swat"
96 use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
97 use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
98 fi
99
100 if use client ; then
101 BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
102 bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
103 bin/ntlm_auth"
104
105 fi
106
107 use cups && BINPROGS="${BINPROGS} bin/smbspool"
108 use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
109
110 if use winbind ; then
111 BINPROGS="${BINPROGS} bin/wbinfo"
112 SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
113 use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
114 use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
115 fi
116
117 if use winbind &&
118 [[ $(tc-getCC)$ == *gcc* ]] &&
119 [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
120 then
121 eerror "It is a known issue that ${P} will not build with "
122 eerror "winbind use flag enabled when using gcc < 4.3 ."
123 eerror "Please use at least the latest stable gcc version."
124 die "Using sys-devel/gcc < 4.3 with winbind use flag."
125 fi
126 }
127
128 src_prepare() {
129 cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
130
131 # ensure that winbind has correct ldflags (QA notice)
132 sed -i \
133 -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
134 configure || die "sed failed"
135 cd "${WORKDIR}/${MY_P}" && epatch "${CONFDIR}"/smb.conf.default.patch
136 }
137
138 src_configure() {
139 local myconf
140
141 # Filter out -fPIE
142 [[ ${CHOST} == *-*bsd* ]] && myconf+=" --disable-pie"
143
144 # Upstream refuses to make this configurable
145 use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
146
147 # Notes:
148 # - automount is only needed in conjunction with NIS and we don't have that
149 # anymore => LDAP?
150 # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
151 econf ${myconf} \
152 --with-piddir=/var/run/samba \
153 --sysconfdir=/etc/samba \
154 --localstatedir=/var \
155 $(use_enable debug developer) \
156 --enable-largefile \
157 --enable-socket-wrapper \
158 --enable-nss-wrapper \
159 $(use_enable swat) \
160 $(use_enable debug dmalloc) \
161 $(use_enable cups) \
162 --disable-iprint \
163 $(use_enable fam) \
164 --enable-shared-libs \
165 --disable-dnssd \
166 $(use_enable avahi) \
167 --with-fhs \
168 --with-privatedir=/var/lib/samba/private \
169 --with-rootsbindir=/var/cache/samba \
170 --with-lockdir=/var/cache/samba \
171 --with-swatdir=/usr/share/doc/${PF}/swat \
172 --with-configdir=/etc/samba \
173 --with-logfilebase=/var/log/samba \
174 --with-pammodulesdir=$(getpam_mod_dir) \
175 --without-afs \
176 --without-fake-kaserver \
177 --without-vfs-afsacl \
178 $(use_with ldap) \
179 $(use_with ads) \
180 $(use_with ads krb5 /usr) \
181 $(use_with ads dnsupdate) \
182 --without-automount \
183 $(use_with pam) \
184 $(use_with pam pam_smbpass) \
185 $(use_with syslog) \
186 $(use_with quota quotas) \
187 $(use_with quota sys-quotas) \
188 --without-utmp \
189 --without-lib{talloc,tdb} \
190 $(use_with netapi libnetapi) \
191 $(use_with smbclient libsmbclient) \
192 $(use_with smbsharemodes libsmbsharemodes) \
193 $(use_with addns libaddns) \
194 $(use_with cluster ctdb /usr) \
195 $(use_with cluster cluster-support) \
196 $(use_with acl acl-support) \
197 $(use_with aio aio-support) \
198 --with-sendfile-support \
199 $(use_with winbind) \
200 --with-shared-modules=${SHAREDMODS} \
201 --without-included-popt \
202 --without-included-iniparser
203 }
204
205 src_compile() {
206 # compile libs
207 if use addns ; then
208 einfo "make addns library"
209 emake libaddns
210 fi
211 if use netapi ; then
212 einfo "make netapi library"
213 emake libnetapi
214 fi
215 if use smbclient ; then
216 einfo "make smbclient library"
217 emake libsmbclient
218 fi
219 if use smbsharemodes ; then
220 einfo "make smbsharemodes library"
221 emake libsmbsharemodes
222 fi
223
224 # compile modules
225 emake modules
226
227 # compile pam moudles
228 if use pam ; then
229 einfo "make pam modules"
230 emake pam_modules
231 fi
232
233 # compile winbind nss modules
234 if use winbind ; then
235 einfo "make nss modules"
236 emake nss_modules
237 fi
238
239 # compile utilities
240 if [ -n "${BINPROGS}" ] ; then
241 einfo "make binprogs"
242 emake ${BINPROGS}
243 fi
244 if [ -n "${SBINPROGS}" ] ; then
245 einfo "make sbinprogs"
246 emake ${SBINPROGS}
247 fi
248
249 if [ -n "${KRBPLUGIN}" ] ; then
250 einfo "make krbplugin"
251 emake ${KRBPLUGIN}${PLUGINEXT}
252 fi
253
254 }
255
256 src_install() {
257 # install libs
258 if use addns ; then
259 einfo "install addns library"
260 emake installlibaddns DESTDIR="${D}"
261 fi
262 if use netapi ; then
263 einfo "install netapi library"
264 emake installlibnetapi DESTDIR="${D}"
265 fi
266 if use smbclient ; then
267 einfo "install smbclient library"
268 emake installlibsmbclient DESTDIR="${D}"
269 fi
270 if use smbsharemodes ; then
271 einfo "install smbsharemodes library"
272 emake installlibsmbsharemodes DESTDIR="${D}"
273 fi
274
275 # install modules
276 emake installmodules DESTDIR="${D}"
277
278 if use pam ; then
279 einfo "install pam modules"
280 emake installpammodules DESTDIR="${D}"
281
282 if use winbind ; then
283 newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
284 doman ../docs/manpages/pam_winbind.8
285 fi
286
287 newpamd "${CONFDIR}/samba.pam" samba
288 dodoc pam_smbpass/README
289 fi
290
291 # Nsswitch extensions. Make link for wins and winbind resolvers
292 if use winbind ; then
293 einfo "install libwbclient"
294 emake installlibwbclient DESTDIR="${D}"
295 dolib.so ../nsswitch/libnss_wins.so
296 dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
297 dolib.so ../nsswitch/libnss_winbind.so
298 dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
299 einfo "install libwbclient related manpages"
300 doman ../docs/manpages/idmap_rid.8
301 doman ../docs/manpages/idmap_hash.8
302 if use ldap ; then
303 doman ../docs/manpages/idmap_adex.8
304 doman ../docs/manpages/idmap_ldap.8
305 fi
306 if use ads ; then
307 doman ../docs/manpages/idmap_ad.8
308 fi
309 fi
310
311 # install binaries
312 insinto /usr
313 for prog in ${SBINPROGS} ; do
314 dosbin ${prog}
315 doman ../docs/manpages/${prog/bin\/}*
316 done
317
318 for prog in ${BINPROGS} ; do
319 dobin ${prog}
320 doman ../docs/manpages/${prog/bin\/}*
321 done
322
323 # install krbplugin
324 if [ -n "${KRBPLUGIN}" ] ; then
325 if has_version app-crypt/mit-krb5 ; then
326 insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
327 doins ${KRBPLUGIN}${PLUGINEXT}
328 elif has_version app-crypt/heimdal ; then
329 insinto /usr/$(get_libdir)/plugin/krb5
330 doins ${KRBPLUGIN}${PLUGINEXT}
331 fi
332 insinto /usr
333 for prog in ${KRBPLUGIN} ; do
334 doman ../docs/manpages/${prog/bin\/}*
335 done
336 fi
337
338 # install server components
339 if use server ; then
340 doman ../docs/manpages/vfs* ../docs/manpages/samba.7
341
342 diropts -m0700
343 keepdir /var/lib/samba/private
344
345 diropts -m1777
346 keepdir /var/spool/samba
347
348 diropts -m0755
349 keepdir /var/{cache,log}/samba
350 keepdir /var/lib/samba/{netlogon,profiles}
351 keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
352 keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
353
354 newconfd "${CONFDIR}/samba.confd" samba
355 newinitd "${CONFDIR}/samba.initd" samba
356
357 insinto /etc/samba
358 doins "${CONFDIR}"/{smbusers,lmhosts}
359
360 if use ldap ; then
361 insinto /etc/openldap/schema
362 doins ../examples/LDAP/samba.schema
363 fi
364
365 if use swat ; then
366 insinto /etc/xinetd.d
367 newins "${CONFDIR}/swat.xinetd" swat
368 script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}"
369 fi
370
371 dodoc ../MAINTAINERS.txt ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
372 fi
373
374 # install the spooler to cups
375 if use cups ; then
376 dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb
377 fi
378
379 # install misc files
380 insinto /etc/samba
381 doins ../examples/smb.conf.default
382 doman ../docs/manpages/smb.conf.5
383
384 insinto /usr/"$(get_libdir)"/samba
385 doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
386
387 # install docs
388 if use doc ; then
389 dohtml -r ../docs/htmldocs/*
390 dodoc ../docs/*.pdf
391 fi
392
393 # install examples
394 if use examples ; then
395 insinto /usr/share/doc/${PF}/examples
396
397 if use smbclient ; then
398 doins -r ../examples/libsmbclient
399 fi
400
401 if use winbind ; then
402 doins -r ../examples/pam_winbind ../examples/nss
403 fi
404
405 if use server ; then
406 cd ../examples
407 doins -r auth autofs dce-dfs LDAP logon misc pdb \
408 perfcounter printer-accounting printing scripts tridge \
409 validchars VFS
410 fi
411 fi
412
413 # Remove empty installation directories
414 rmdir --ignore-fail-on-non-empty \
415 "${D}/usr/$(get_libdir)/samba" \
416 "${D}/usr"/{sbin,bin} \
417 "${D}/usr/share"/{man,locale,} \
418 "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
419 # || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
420 }
421
422 pkg_postinst() {
423 elog "The default value of 'wide links' has been changed to 'no' in samba 3.5"
424 elog "to avoid an insecure default configuration"
425 elog "('wide links = yes' and 'unix extensions = yes'). For more details,"
426 elog "please see http://www.samba.org/samba/news/symlink_attack.html ."
427 elog ""
428 elog "An EXPERIMENTAL implementation of the SMB2 protocol has been added."
429 elog "SMB2 can be enabled by setting 'max protocol = smb2'. SMB2 is a new "
430 elog "implementation of the SMB protocol used by Windows Vista and higher"
431 elog ""
432 elog "For further information make sure to read the release notes at"
433 elog "http://samba.org/samba/history/${P}.html and "
434 elog "http://samba.org/samba/history/${PN}-3.5.0.html"
435 }