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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Wed Jan 9 11:42:30 2013 UTC (20 months, 2 weeks ago) by polynomial-c
Branch: MAIN
Changes since 1.7: +3 -3 lines
Fixed cups dependency in samba-3.5.15.ebuild (bug #451026). Added latest 3.5 version. Adjusted SRC_URI so source packages can still be found when they got superseded by newer versions. Removed obsolete version. Removed unused USE flag description from metadata.xml file

(Portage version: 2.2.0_alpha149/cvs/Linux x86_64, signed Manifest commit with key 0x981CA6FC)

1 # Copyright 1999-2013 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.6.9.ebuild,v 1.7 2012/12/20 13:35:59 nativemad 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/stable/${MY_P}.tar.gz"
15 LICENSE="GPL-3"
16 SLOT="0"
17 KEYWORDS="amd64 ~arm hppa x86 ~amd64-fbsd ~x86-fbsd"
18 IUSE="acl addns ads +aio avahi caps +client cluster cups debug dmapi doc examples fam
19 ldap ldb +netapi pam quota +readline selinux +server +smbclient smbsharemodes
20 swat syslog winbind"
21
22 DEPEND="dev-libs/popt
23 >=sys-libs/talloc-2.0.5
24 >=sys-libs/tdb-1.2.9
25 virtual/libiconv
26 ads? ( virtual/krb5 sys-fs/e2fsprogs
27 client? ( sys-apps/keyutils
28 kernel_linux? ( net-fs/cifs-utils[ads] ) ) )
29 avahi? ( net-dns/avahi[dbus] )
30 caps? ( sys-libs/libcap )
31 client? ( !net-fs/mount-cifs
32 dev-libs/iniparser
33 kernel_linux? ( net-fs/cifs-utils ) )
34 cluster? ( >=dev-db/ctdb-1.13 )
35 cups? ( net-print/cups )
36 debug? ( dev-libs/dmalloc )
37 dmapi? ( sys-apps/dmapi )
38 fam? ( virtual/fam )
39 ldap? ( net-nds/openldap )
40 ldb? ( sys-libs/ldb )
41 pam? ( virtual/pam
42 winbind? ( dev-libs/iniparser )
43 )
44 readline? ( >=sys-libs/readline-5.2 )
45 selinux? ( sec-policy/selinux-samba )
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_pretend() {
74 if [[ ${MERGE_TYPE} != binary ]]; then
75 if use winbind &&
76 [[ $(tc-getCC)$ == *gcc* ]] &&
77 [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
78 then
79 eerror "It is a known issue that ${P} will not build with "
80 eerror "winbind use flag enabled when using gcc < 4.3 ."
81 eerror "Please use at least the latest stable gcc version."
82 die "Using sys-devel/gcc < 4.3 with winbind use flag."
83 fi
84 fi
85 }
86
87 pkg_setup() {
88 if use server ; then
89 SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
90 BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
91 bin/profiles bin/sharesec bin/eventlogadm bin/smbta-util"
92
93 use swat && SBINPROGS="${SBINPROGS} bin/swat"
94 use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
95 use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
96 fi
97
98 if use client ; then
99 BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
100 bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
101 bin/ntlm_auth"
102
103 fi
104
105 use cups && BINPROGS="${BINPROGS} bin/smbspool"
106 # use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
107
108 if use winbind ; then
109 BINPROGS="${BINPROGS} bin/wbinfo"
110 SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
111 use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
112 use cluster && SHAREDMODS="${SHAREDMODS},idmap_tdb2"
113 use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
114 fi
115 }
116
117 src_prepare() {
118 cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
119
120 # ensure that winbind has correct ldflags (QA notice)
121 sed -i \
122 -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
123 configure || die "sed failed"
124 cd "${WORKDIR}/${MY_P}" && 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 # http://wiki.samba.org/index.php/CTDB_Setup
134 use cluster && myconf+=" --disable-pie"
135
136 # Upstream refuses to make this configurable
137 use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
138
139 #bug #399141 wrap newer iniparser version
140 has_version ">=dev-libs/iniparser-3.0.0" && \
141 export CPPFLAGS+=" -Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\)"
142
143 # Notes:
144 # - automount is only needed in conjunction with NIS and we don't have that
145 # anymore => LDAP?
146 # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
147 econf ${myconf} \
148 --with-piddir=/var/run/samba \
149 --sysconfdir=/etc/samba \
150 --localstatedir=/var \
151 $(use_enable debug developer) \
152 --enable-largefile \
153 --enable-socket-wrapper \
154 --enable-nss-wrapper \
155 $(use_enable swat) \
156 $(use_enable debug dmalloc) \
157 $(use_enable cups) \
158 --disable-iprint \
159 $(use_enable fam) \
160 --enable-shared-libs \
161 --disable-dnssd \
162 $(use_enable avahi) \
163 --with-fhs \
164 --with-privatedir=/var/lib/samba/private \
165 --with-rootsbindir=/var/cache/samba \
166 --with-lockdir=/var/cache/samba \
167 --with-swatdir=/usr/share/doc/${PF}/swat \
168 --with-configdir=/etc/samba \
169 --with-logfilebase=/var/log/samba \
170 --with-pammodulesdir=$(getpam_mod_dir) \
171 $(use_with dmapi) \
172 --without-afs \
173 --without-fake-kaserver \
174 --without-vfs-afsacl \
175 $(use_with ldap) \
176 $(use_with ads) \
177 $(use_with ads krb5 /usr) \
178 $(use_with ads dnsupdate) \
179 --without-automount \
180 $(use_with pam) \
181 $(use_with pam pam_smbpass) \
182 $(use_with syslog) \
183 $(use_with quota quotas) \
184 $(use_with quota sys-quotas) \
185 --without-utmp \
186 --without-lib{talloc,tdb} \
187 $(use_with netapi libnetapi) \
188 $(use_with smbclient libsmbclient) \
189 $(use_with smbsharemodes libsmbsharemodes) \
190 $(use_with addns libaddns) \
191 $(use_with cluster ctdb /usr) \
192 $(use_with cluster cluster-support) \
193 $(use_with acl acl-support) \
194 $(use_with aio aio-support) \
195 --with-sendfile-support \
196 $(use_with winbind) \
197 --with-shared-modules=${SHAREDMODS} \
198 --without-included-popt \
199 --without-included-iniparser
200 }
201
202 src_compile() {
203 # compile libs
204 if use addns ; then
205 einfo "make addns library"
206 emake libaddns
207 fi
208 if use netapi ; then
209 einfo "make netapi library"
210 emake libnetapi
211 fi
212 if use smbclient ; then
213 einfo "make smbclient library"
214 emake libsmbclient
215 fi
216 if use smbsharemodes ; then
217 einfo "make smbsharemodes library"
218 emake libsmbsharemodes
219 fi
220
221 # compile modules
222 emake modules
223
224 # compile pam moudles
225 if use pam ; then
226 einfo "make pam modules"
227 emake pam_modules
228 fi
229
230 # compile winbind nss modules
231 if use winbind ; then
232 einfo "make nss modules"
233 emake nss_modules
234 fi
235
236 # compile utilities
237 if [ -n "${BINPROGS}" ] ; then
238 einfo "make binprogs"
239 emake ${BINPROGS}
240 fi
241 if [ -n "${SBINPROGS}" ] ; then
242 einfo "make sbinprogs"
243 emake ${SBINPROGS}
244 fi
245
246 if [ -n "${KRBPLUGIN}" ] ; then
247 einfo "make krbplugin"
248 emake ${KRBPLUGIN}${PLUGINEXT}
249 fi
250
251 }
252
253 src_install() {
254 # install libs
255 if use addns ; then
256 einfo "install addns library"
257 emake installlibaddns DESTDIR="${D}"
258 fi
259 if use netapi ; then
260 einfo "install netapi library"
261 emake installlibnetapi DESTDIR="${D}"
262 fi
263 if use smbclient ; then
264 einfo "install smbclient library"
265 emake installlibsmbclient DESTDIR="${D}"
266 fi
267 if use smbsharemodes ; then
268 einfo "install smbsharemodes library"
269 emake installlibsmbsharemodes DESTDIR="${D}"
270 fi
271
272 # install modules
273 emake installmodules DESTDIR="${D}"
274
275 if use pam ; then
276 einfo "install pam modules"
277 emake installpammodules DESTDIR="${D}"
278
279 if use winbind ; then
280 newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
281 doman ../docs/manpages/pam_winbind.8
282 # bug #376853
283 insinto /etc/security
284 doins ../examples/pam_winbind/pam_winbind.conf || die
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 scripts
324 if use client ; then
325 dobin script/findsmb
326 doman ../docs/manpages/findsmb.1
327 fi
328
329 # install krbplugin
330 if [ -n "${KRBPLUGIN}" ] ; then
331 if has_version app-crypt/mit-krb5 ; then
332 insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
333 doins ${KRBPLUGIN}${PLUGINEXT}
334 elif has_version app-crypt/heimdal ; then
335 insinto /usr/$(get_libdir)/plugin/krb5
336 doins ${KRBPLUGIN}${PLUGINEXT}
337 fi
338 insinto /usr
339 for prog in ${KRBPLUGIN} ; do
340 doman ../docs/manpages/${prog/bin\/}*
341 done
342 fi
343
344 # install server components
345 if use server ; then
346 doman ../docs/manpages/vfs* ../docs/manpages/samba.7
347
348 diropts -m0700
349 keepdir /var/lib/samba/private
350
351 diropts -m1777
352 keepdir /var/spool/samba
353
354 diropts -m0755
355 keepdir /var/{cache,log}/samba
356 keepdir /var/lib/samba/{netlogon,profiles}
357 keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
358 keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
359
360 newconfd "${CONFDIR}/samba.confd" samba
361 newinitd "${CONFDIR}/samba.initd" samba
362
363 insinto /etc/samba
364 doins "${CONFDIR}"/{smbusers,lmhosts}
365
366 if use ldap ; then
367 insinto /etc/openldap/schema
368 doins ../examples/LDAP/samba.schema
369 fi
370
371 if use swat ; then
372 insinto /etc/xinetd.d
373 newins "${CONFDIR}/swat.xinetd" swat
374 script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}"
375 fi
376
377 dodoc ../MAINTAINERS.txt ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
378 fi
379
380 # install the spooler to cups
381 if use cups ; then
382 dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb
383 fi
384
385 # install misc files
386 insinto /etc/samba
387 doins ../examples/smb.conf.default
388 doman ../docs/manpages/smb.conf.5
389
390 insinto /usr/"$(get_libdir)"/samba
391 doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
392
393 # install docs
394 if use doc ; then
395 dohtml -r ../docs/htmldocs/*
396 dodoc ../docs/*.pdf
397 fi
398
399 # install examples
400 if use examples ; then
401 insinto /usr/share/doc/${PF}/examples
402
403 if use smbclient ; then
404 doins -r ../examples/libsmbclient
405 fi
406
407 if use winbind ; then
408 doins -r ../examples/pam_winbind ../examples/nss
409 fi
410
411 if use server ; then
412 cd ../examples
413 doins -r auth autofs dce-dfs LDAP logon misc pdb \
414 perfcounter printer-accounting printing scripts tridge \
415 validchars VFS
416 fi
417 fi
418
419 # Remove empty installation directories
420 rmdir --ignore-fail-on-non-empty \
421 "${D}/usr/$(get_libdir)/samba" \
422 "${D}/usr"/{sbin,bin} \
423 "${D}/usr/share"/{man,locale,} \
424 "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
425 # || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
426 }
427
428 pkg_postinst() {
429 elog "Samba 3.6 has adopted a number of improved security defaults that"
430 elog "will impact on existing users of Samba."
431 elog " client ntlmv2 auth = yes"
432 elog " client use spnego principal = no"
433 elog " send spnego principal = no"
434 elog ""
435 elog "SMB2 protocol support in 3.6.0 is fully functional and can be "
436 elog "enabled by setting 'max protocol = smb2'. SMB2 is a new "
437 elog "implementation of the SMB protocol used by Windows Vista and higher"
438 elog ""
439 elog "For further information make sure to read the release notes at"
440 elog "http://samba.org/samba/history/${P}.html and "
441 elog "http://samba.org/samba/history/${PN}-3.6.0.html"
442 }

  ViewVC Help
Powered by ViewVC 1.1.20