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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Oct 17 22:05:43 2012 UTC (22 months, 1 week ago) by vostorga
Branch: MAIN
Version bump to 3.5.18

(Portage version: 2.1.11.9/cvs/Linux i686)

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

  ViewVC Help
Powered by ViewVC 1.1.20