/[gentoo-x86]/net-fs/samba/samba-3.5.14.ebuild
Gentoo

Contents of /net-fs/samba/samba-3.5.14.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Tue Oct 2 08:00:47 2012 UTC (23 months, 2 weeks ago) by polynomial-c
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
Version bump. Removed old

(Portage version: 2.2.0_alpha134/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20