From 627fd83450e1283ade18f551c3ad421b97721e52 Mon Sep 17 00:00:00 2001 From: Tiziano Müller Date: Sat, 8 Sep 2007 12:05:54 +0000 Subject: Fixed init-script to correctly start daemons when not started via symlink (bug #191647, thanks to Christoph Schulz) Package-Manager: portage-2.1.3.8 --- net-fs/samba/ChangeLog | 9 +- net-fs/samba/Manifest | 30 +-- net-fs/samba/files/digest-samba-3.0.25c | 3 - net-fs/samba/files/digest-samba-3.0.25c-r1 | 3 + net-fs/samba/files/samba-init | 4 +- net-fs/samba/samba-3.0.25c-r1.ebuild | 313 +++++++++++++++++++++++++++++ net-fs/samba/samba-3.0.25c.ebuild | 313 ----------------------------- 7 files changed, 341 insertions(+), 334 deletions(-) delete mode 100644 net-fs/samba/files/digest-samba-3.0.25c create mode 100644 net-fs/samba/files/digest-samba-3.0.25c-r1 create mode 100644 net-fs/samba/samba-3.0.25c-r1.ebuild delete mode 100644 net-fs/samba/samba-3.0.25c.ebuild (limited to 'net-fs') diff --git a/net-fs/samba/ChangeLog b/net-fs/samba/ChangeLog index b999b0265744..d2be1a4c4265 100644 --- a/net-fs/samba/ChangeLog +++ b/net-fs/samba/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-fs/samba # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/ChangeLog,v 1.298 2007/09/07 21:07:39 dev-zero Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/ChangeLog,v 1.299 2007/09/08 12:05:53 dev-zero Exp $ + +*samba-3.0.25c-r1 (08 Sep 2007) + + 08 Sep 2007; Tiziano Müller files/samba-init, + -samba-3.0.25c.ebuild, +samba-3.0.25c-r1.ebuild: + Fixed init-script to correctly start daemons when not started via symlink + (bug #191647, thanks to Christoph Schulz) *samba-3.0.25c (07 Sep 2007) diff --git a/net-fs/samba/Manifest b/net-fs/samba/Manifest index fb047a6cbd26..fbcf016c53b6 100644 --- a/net-fs/samba/Manifest +++ b/net-fs/samba/Manifest @@ -66,10 +66,10 @@ AUX samba-conf 1291 RMD160 326fb4beee8105d839d23e37f4989d7e332c996b SHA1 af7cd69 MD5 341521b710d02d57a70acd49b1d4c06b files/samba-conf 1291 RMD160 326fb4beee8105d839d23e37f4989d7e332c996b files/samba-conf 1291 SHA256 dfaf474c3cbfa3d3b26d1531c6f5913739d5815c4b8083063934ee4fd6b38861 files/samba-conf 1291 -AUX samba-init 1136 RMD160 a92f7101b47f9dff9a7dc69ff8c8ed4b4fbff5ab SHA1 7c51109026c33c05541bafb770380b3ced8e0f8d SHA256 5c0d9f60214a0c7a7785d93b625e69515b7535c4876affe73fb5353662699853 -MD5 5b51e5bd96ef544228bc7ac331e64e99 files/samba-init 1136 -RMD160 a92f7101b47f9dff9a7dc69ff8c8ed4b4fbff5ab files/samba-init 1136 -SHA256 5c0d9f60214a0c7a7785d93b625e69515b7535c4876affe73fb5353662699853 files/samba-init 1136 +AUX samba-init 1144 RMD160 c5931ce7c96f024d33f8216811267db8076f919b SHA1 9533148df49a7caf6e9bfa821e23c05b65b7daed SHA256 6262052cd24190679f24d73938e9b486545d5313ec7fd7b5ba8576da709b081e +MD5 0a7447066a3423bde6b5469c24517f37 files/samba-init 1144 +RMD160 c5931ce7c96f024d33f8216811267db8076f919b files/samba-init 1144 +SHA256 6262052cd24190679f24d73938e9b486545d5313ec7fd7b5ba8576da709b081e files/samba-init 1144 AUX samba-xinetd 286 RMD160 c90bd8518082eb4c182d5f7bd223a76f8e3c7fab SHA1 b250c5ca539187d8b481bcfb6ea3a915d7e8b26b SHA256 964d06dc33beff38978a8f03cd12b05c33d8258ed73aa9ffbf137fe226de25b8 MD5 67cca34121a9cef6d7bfdff5518ae6b1 files/samba-xinetd 286 RMD160 c90bd8518082eb4c182d5f7bd223a76f8e3c7fab files/samba-xinetd 286 @@ -82,14 +82,14 @@ EBUILD samba-3.0.24-r3.ebuild 8558 RMD160 8639eaba80f753d5da2bbfa7c2b451c954b563 MD5 0c0cbf31c82035fa8a41f96dabe0ca4f samba-3.0.24-r3.ebuild 8558 RMD160 8639eaba80f753d5da2bbfa7c2b451c954b563f3 samba-3.0.24-r3.ebuild 8558 SHA256 b7179360d8560f2d28d1404bf64cb45d01af910668f4b017f2c0e127202ead4f samba-3.0.24-r3.ebuild 8558 -EBUILD samba-3.0.25c.ebuild 8979 RMD160 4513c4bc1e5619f26bc4ce136bf9c08e8714a7d8 SHA1 0a8c857d69e68d0a272e34f17b113ad17a668f4b SHA256 e5a74c54bfb0cdee32d4eb8f761f74c94298b1a404a9b4977f58932cad7f827e -MD5 7ca35e9d391ce8818cf633b9f3368927 samba-3.0.25c.ebuild 8979 -RMD160 4513c4bc1e5619f26bc4ce136bf9c08e8714a7d8 samba-3.0.25c.ebuild 8979 -SHA256 e5a74c54bfb0cdee32d4eb8f761f74c94298b1a404a9b4977f58932cad7f827e samba-3.0.25c.ebuild 8979 -MISC ChangeLog 50839 RMD160 0b3e624a2150c82eba81333ad1c04f610b226a1d SHA1 fcdcab4a422332a5afabca503cbd7f1937fa7c5a SHA256 2e04296704910b06cf34eabdcb42ad17597a2559e6163744e7a37e38ef0cb2e5 -MD5 6dbdc4fb0d81db18e365d6c2e1045082 ChangeLog 50839 -RMD160 0b3e624a2150c82eba81333ad1c04f610b226a1d ChangeLog 50839 -SHA256 2e04296704910b06cf34eabdcb42ad17597a2559e6163744e7a37e38ef0cb2e5 ChangeLog 50839 +EBUILD samba-3.0.25c-r1.ebuild 8994 RMD160 16c08e2a3acf0801e35023033aa8797d5e05679b SHA1 f5b90141df8952c16c32e16c765f2f6627777105 SHA256 550f4a2003a9cc8ea86450fc95e3b87b070de713c55a2d1a366c754d4c48ee17 +MD5 7e14a14ff37fd0d1399f7d77316d81af samba-3.0.25c-r1.ebuild 8994 +RMD160 16c08e2a3acf0801e35023033aa8797d5e05679b samba-3.0.25c-r1.ebuild 8994 +SHA256 550f4a2003a9cc8ea86450fc95e3b87b070de713c55a2d1a366c754d4c48ee17 samba-3.0.25c-r1.ebuild 8994 +MISC ChangeLog 51115 RMD160 b640865aed0c18b94215caf1c2f0750a73495e39 SHA1 52f164049c939579b722f89f48129394a1d33452 SHA256 17eba8fc3a9d79b94999bf563ba83840c8aae8e6e11e8c03a45256c871f109fb +MD5 af9e6b0633cf712d3bd9172cfdebf62e ChangeLog 51115 +RMD160 b640865aed0c18b94215caf1c2f0750a73495e39 ChangeLog 51115 +SHA256 17eba8fc3a9d79b94999bf563ba83840c8aae8e6e11e8c03a45256c871f109fb ChangeLog 51115 MISC metadata.xml 489 RMD160 36eed0edca609c521314ae415efd57ca9acfecb4 SHA1 317e61704a10a3bd888d32c6834721f5d40d00ff SHA256 6f35f13dd39bb51d304fd59b5352c92bc35a957c9c9412c5c1f3f58e98519792 MD5 324855d88a5c326d1b45b5c7719d5536 metadata.xml 489 RMD160 36eed0edca609c521314ae415efd57ca9acfecb4 metadata.xml 489 @@ -97,6 +97,6 @@ SHA256 6f35f13dd39bb51d304fd59b5352c92bc35a957c9c9412c5c1f3f58e98519792 metadata MD5 e899de085c153ac07e914eeb6e0d0ecb files/digest-samba-3.0.24-r3 768 RMD160 f62fe0036cb69a6e84304089ec8a83dc8a068199 files/digest-samba-3.0.24-r3 768 SHA256 4b66f0f4c47fbd739eb37e0a4dceb8ffd525131b9034dea75e3802ecdf06a824 files/digest-samba-3.0.24-r3 768 -MD5 ae776e7a2a73825b1040d5d39e78795c files/digest-samba-3.0.25c 247 -RMD160 c08939296c0097674a68bd340d1fa23f8d8ecbd4 files/digest-samba-3.0.25c 247 -SHA256 6772b5cc291b0f6dbd584253eabd0e7ad75966af1ff8f17c48762a65e4111a9c files/digest-samba-3.0.25c 247 +MD5 ae776e7a2a73825b1040d5d39e78795c files/digest-samba-3.0.25c-r1 247 +RMD160 c08939296c0097674a68bd340d1fa23f8d8ecbd4 files/digest-samba-3.0.25c-r1 247 +SHA256 6772b5cc291b0f6dbd584253eabd0e7ad75966af1ff8f17c48762a65e4111a9c files/digest-samba-3.0.25c-r1 247 diff --git a/net-fs/samba/files/digest-samba-3.0.25c b/net-fs/samba/files/digest-samba-3.0.25c deleted file mode 100644 index f7be3ff4f8de..000000000000 --- a/net-fs/samba/files/digest-samba-3.0.25c +++ /dev/null @@ -1,3 +0,0 @@ -MD5 87950694270b86cbc1b2074cb53dd1aa samba-3.0.25c.tar.gz 18178029 -RMD160 7c8de2c27144b2b23e7c3f4a8fceb35bddfd571b samba-3.0.25c.tar.gz 18178029 -SHA256 113144b8a035b1be289eaed3a12a3e8138e47f21fd79c9cc7bbf4f7eabc2870c samba-3.0.25c.tar.gz 18178029 diff --git a/net-fs/samba/files/digest-samba-3.0.25c-r1 b/net-fs/samba/files/digest-samba-3.0.25c-r1 new file mode 100644 index 000000000000..f7be3ff4f8de --- /dev/null +++ b/net-fs/samba/files/digest-samba-3.0.25c-r1 @@ -0,0 +1,3 @@ +MD5 87950694270b86cbc1b2074cb53dd1aa samba-3.0.25c.tar.gz 18178029 +RMD160 7c8de2c27144b2b23e7c3f4a8fceb35bddfd571b samba-3.0.25c.tar.gz 18178029 +SHA256 113144b8a035b1be289eaed3a12a3e8138e47f21fd79c9cc7bbf4f7eabc2870c samba-3.0.25c.tar.gz 18178029 diff --git a/net-fs/samba/files/samba-init b/net-fs/samba/files/samba-init index af7b7c64d29f..1793f09fcc8b 100644 --- a/net-fs/samba/files/samba-init +++ b/net-fs/samba/files/samba-init @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/files/samba-init,v 1.15 2007/09/07 21:07:39 dev-zero Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/files/samba-init,v 1.16 2007/09/08 12:05:54 dev-zero Exp $ opts="reload" @@ -12,7 +12,7 @@ depend() { } DAEMONNAME="${SVCNAME##samba.}" -if [[ -n ${DAEMONNAME} ]] ; then +if [[ ${DAEMONNAME} != "samba" ]] ; then daemon_list=${DAEMONNAME} fi diff --git a/net-fs/samba/samba-3.0.25c-r1.ebuild b/net-fs/samba/samba-3.0.25c-r1.ebuild new file mode 100644 index 000000000000..375f5b93c384 --- /dev/null +++ b/net-fs/samba/samba-3.0.25c-r1.ebuild @@ -0,0 +1,313 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.0.25c-r1.ebuild,v 1.1 2007/09/08 12:05:53 dev-zero Exp $ + +inherit eutils pam python multilib versionator confutils + +MY_P=${PN}-${PV/_/} + +DESCRIPTION="A suite of SMB and CIFS client/server programs for UNIX" +HOMEPAGE="http://www.samba.org/" +SRC_URI="mirror://samba/${MY_P}.tar.gz + mirror://samba/old-versions/${MY_P}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE_LINGUAS="linguas_ja linguas_pl" +IUSE="${IUSE_LINGUAS} acl ads async automount caps cups doc examples ipv6 kernel_linux ldap fam + pam python quotas readline selinux swat syslog winbind" + +RDEPEND="dev-libs/popt + virtual/libiconv + acl? ( kernel_linux? ( sys-apps/acl ) ) + cups? ( net-print/cups ) + ipv6? ( sys-apps/xinetd ) + ads? ( virtual/krb5 ) + ldap? ( net-nds/openldap ) + pam? ( virtual/pam ) + python? ( dev-lang/python ) + readline? ( sys-libs/readline ) + selinux? ( sec-policy/selinux-samba ) + swat? ( sys-apps/xinetd ) + syslog? ( virtual/logger ) + fam? ( virtual/fam ) + caps? ( sys-libs/libcap )" +DEPEND="${RDEPEND}" + +S=${WORKDIR}/${MY_P} +CONFDIR=${FILESDIR}/config +PRIVATE_DST=/var/lib/samba/private + +pkg_setup() { + confutils_use_depend_all ads ldap +} + +src_unpack() { + unpack ${A} + cd "${S}/source" + + # This patch adds "-Wl,-z,now" to smb{mnt,umount} + # Please read ... for further informations + epatch "${FILESDIR}/${PV}-lazyldflags.patch" + epatch "${FILESDIR}/${PV}-py_smp.patch" + + # Ok, agreed, this is ugly. But it avoids a patch we + # need for every samba version and we don't need autotools + sed -i \ + -e 's|"lib32" ||' \ + -e 's|if test -d "$i/$l" ;|if test -d "$i/$l" -o -L "$i/$l";|' \ + configure || die "sed failed" +} + +src_compile() { + cd "${S}/source" + + local myconf + local mylangs + local mymod_shared + + python_version + myconf="--with-python=no" + use python && myconf="--with-python=${python}" + + mylangs="--with-manpages-langs=en" + use linguas_ja && mylangs="${mylangs},ja" + use linguas_pl && mylangs="${mylangs},pl" + + use winbind && mymod_shared="--with-shared-modules=idmap_rid" + if use ldap ; then + myconf="${myconf} $(use_with ads)" + use winbind && mymod_shared="${mymod_shared},idmap_ad" + fi + + [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie" + use hppa && myconf="${myconf} --disable-pie" + + use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no + + # Otherwise we get the whole swat stuff installed + if ! use swat ; then + sed -i \ + -e 's/^\(install:.*\)installswat \(.*\)/\1\2/' \ + Makefile.in || die "sed failed" + fi + + econf \ + --with-fhs \ + --sysconfdir=/etc/samba \ + --localstatedir=/var \ + --with-configdir=/etc/samba \ + --with-libdir=/usr/$(get_libdir)/samba \ + --with-swatdir=/usr/share/doc/${PF}/swat \ + --with-piddir=/var/run/samba \ + --with-lockdir=/var/cache/samba \ + --with-logfilebase=/var/log/samba \ + --with-privatedir=${PRIVATE_DST} \ + --with-libsmbclient \ + --without-spinlocks \ + --enable-socket-wrapper \ + --with-cifsmount=no \ + $(use_with acl acl-support) \ + $(use_with async aio-support) \ + $(use_with automount) \ + $(use_enable cups) \ + $(use_enable fam) \ + $(use_with ads krb5) \ + $(use_with ldap) \ + $(use_with pam) $(use_with pam pam_smbpass) \ + $(use_with quotas) $(use_with quotas sys-quotas) \ + $(use_with readline) \ + $(use_with kernel_linux smbmount) \ + $(use_with syslog) \ + $(use_with winbind) \ + ${myconf} ${mylangs} ${mymod_shared} || die "econf failed" + + emake proto || die "emake proto failed" + emake everything || die "emake everything failed" + + if use python ; then + emake python_ext || die "emake python_ext failed" + fi +} + +src_test() { + cd "${S}/source" + emake test || die "tests failed" +} + +src_install() { + cd "${S}/source" + + emake DESTDIR="${D}" install-everything || die "emake install-everything failed" + + # Extra rpctorture progs + local extra_bins="rpctorture" + for i in ${extra_bins} ; do + [[ -x "${S}/bin/${i}" ]] && dobin "${S}/bin/${i}" + done + + # remove .old stuff from /usr/bin: + rm -f "${D}"/usr/bin/*.old + + # Nsswitch extensions. Make link for wins and winbind resolvers + if use winbind ; then + dolib.so nsswitch/libnss_wins.so + dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2 + dolib.so nsswitch/libnss_winbind.so + dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2 + fi + + if use pam ; then + exeinto /$(get_libdir)/security + doexe bin/pam_smbpass.so + if use winbind ; then + exeinto /$(get_libdir)/security + doexe bin/pam_winbind.so + fi + fi + + if use kernel_linux ; then + # Warning: this can byte you if /usr is + # on a separate volume and you have to mount + # a smb volume before the local mount + dosym ../usr/bin/smbmount /sbin/mount.smbfs + fperms 4755 /usr/bin/smbmnt + fperms 4755 /usr/bin/smbumount + fi + + # bug #46389: samba doesn't create symlink anymore + # beaviour seems to be changed in 3.0.6, see bug #61046 + dosym samba/libsmbclient.so /usr/$(get_libdir)/libsmbclient.so.0 + dosym samba/libsmbclient.so /usr/$(get_libdir)/libsmbclient.so + + # make the smb backend symlink for cups printing support (bug #133133) + if use cups ; then + dodir $(cups-config --serverbin)/backend + dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb + fi + + if use python ; then + emake DESTDIR="${D}" python_install || die "emake installpython failed" + # We're doing that manually + find "${D}/usr/$(get_libdir)/python${PYVER}/site-packages" -iname "*.pyc" -delete + fi + + cd "${S}/source" + + # General config files + insinto /etc/samba + doins "${CONFDIR}"/{smbusers,lmhosts} + newins "${CONFDIR}/smb.conf.example-samba3" smb.conf.example + + newpamd "${CONFDIR}/samba.pam" samba + use winbind && doins ${CONFDIR}/system-auth-winbind + if use swat ; then + insinto /etc/xinetd.d + newins "${CONFDIR}/swat.xinetd swat" + else + rm -f "${D}/usr/sbin/swat" + rm -f "${D}/usr/share/man/man8/swat.8" + fi + + newinitd "${FILESDIR}/samba-init" samba + newconfd "${FILESDIR}/samba-conf" samba + + if use ldap ; then + insinto /etc/openldap/schema + doins "${S}/examples/LDAP/samba.schema" + fi + + if use ipv6 ; then + insinto /etc/xinetd.d + newins "${FILESDIR}/samba-xinetd" smb + fi + + # dirs + diropts -m0700 ; keepdir ${PRIVATE_DST} + diropts -m1777 ; keepdir /var/spool/samba + + diropts -m0755 + keepdir /var/{log,run,cache}/samba + keepdir /var/lib/samba/{netlogon,profiles} + keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC} + keepdir /usr/$(get_libdir)/samba/{rpc,idmap,auth} + + # docs + dodoc "${FILESDIR}/README.gentoo" + dodoc "${S}"/{COPYING,Manifest,README,Roadmap,WHATSNEW.txt} + dodoc "${CONFDIR}/nsswitch.conf-wins" + use winbind && dodoc "${CONFDIR}/nsswitch.conf-winbind" + + if use examples ; then + insinto /usr/share/doc/${PF} + doins -r "${S}/examples/" + find "${D}/usr/share/doc/${PF}" -type d -print0 | xargs -0 chmod 755 + find "${D}/usr/share/doc/${PF}/examples" ! -type d -print0 | xargs -0 chmod 644 + if use python ; then + insinto /usr/share/doc/${PF}/python + doins -r "${S}/source/python/examples" + fi + fi + + if ! use doc ; then + if ! use swat ; then + rm -rf "${D}/usr/share/doc/${PF}/swat" + else + rm -rf "${D}/usr/share/doc/${PF}/swat/help"/{guide,howto,devel} + rm -rf "${D}/usr/share/doc/${PF}/swat/using_samba" + fi + fi + +} + +pkg_preinst() { + local PRIVATE_SRC=/etc/samba/private + if [[ ! -r ${ROOT}/${PRIVATE_DST}/secrets.tdb \ + && -r ${ROOT}/${PRIVATE_SRC}/secrets.tdb ]] ; then + ebegin "Copying ${ROOT}/${PRIVATE_SRC}/* to ${ROOT}/${PRIVATE_DST}/" + mkdir -p "${D}"/${PRIVATE_DST} + cp -pPRf "${ROOT}"/${PRIVATE_SRC}/* "${D}"/${PRIVATE_DST}/ + eend $? + fi + + if [[ ! -f "${ROOT}/etc/samba/smb.conf" ]] ; then + touch "${D}/etc/samba/smb.conf" + fi +} + +pkg_postinst() { + if use python ; then + python_version + python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/samba + fi + + if use swat ; then + einfo "swat must be enabled by xinetd:" + einfo " change the /etc/xinetd.d/swat configuration" + fi + + if use ipv6 ; then + einfo "ipv6 support must be enabled by xinetd:" + einfo " change the /etc/xinetd.d/smb configuration" + fi + + elog "It is possible to start/stop daemons seperately:" + elog " Create a symlink from /etc/init.d/samba.{smbd,nmbd,winbind} to" + elog " /etc/init.d/samba. Calling /etc/init.d/samba directly will start" + elog " the daemons configured in /etc/conf.d/samba" + + elog "The mount/umount.cifs helper applications are not included anymore." + elog "Please install net-fs/mount-cifs instead." +} + +pkg_postrm() { + if use python ; then + python_version + python_mod_cleanup /usr/$(get_libdir)/python${PYVER}/site-packages/samba + fi + + # If stale docs, and one isn't re-emerging the latest version, removes + # (this is actually a portage bug, though) + [[ -n ${PF} && ! -f ${ROOT}/usr/$(get_libdir)/${PN}/en.msg ]] && \ + rm -rf "${ROOT}"/usr/share/doc/${PF} +} diff --git a/net-fs/samba/samba-3.0.25c.ebuild b/net-fs/samba/samba-3.0.25c.ebuild deleted file mode 100644 index 3d6a8c7ff9b9..000000000000 --- a/net-fs/samba/samba-3.0.25c.ebuild +++ /dev/null @@ -1,313 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.0.25c.ebuild,v 1.1 2007/09/07 21:07:39 dev-zero Exp $ - -inherit eutils pam python multilib versionator confutils - -MY_P=${PN}-${PV/_/} - -DESCRIPTION="A suite of SMB and CIFS client/server programs for UNIX" -HOMEPAGE="http://www.samba.org/" -SRC_URI="mirror://samba/${MY_P}.tar.gz - mirror://samba/old-versions/${MY_P}.tar.gz" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd" -IUSE_LINGUAS="linguas_ja linguas_pl" -IUSE="${IUSE_LINGUAS} acl ads async automount caps cups doc examples ipv6 kernel_linux ldap fam - pam python quotas readline selinux swat syslog winbind" - -RDEPEND="dev-libs/popt - virtual/libiconv - acl? ( kernel_linux? ( sys-apps/acl ) ) - cups? ( net-print/cups ) - ipv6? ( sys-apps/xinetd ) - ads? ( virtual/krb5 ) - ldap? ( net-nds/openldap ) - pam? ( virtual/pam ) - python? ( dev-lang/python ) - readline? ( sys-libs/readline ) - selinux? ( sec-policy/selinux-samba ) - swat? ( sys-apps/xinetd ) - syslog? ( virtual/logger ) - fam? ( virtual/fam ) - caps? ( sys-libs/libcap )" -DEPEND="${RDEPEND}" - -S=${WORKDIR}/${MY_P} -CONFDIR=${FILESDIR}/config -PRIVATE_DST=/var/lib/samba/private - -pkg_setup() { - confutils_use_depend_all ads ldap -} - -src_unpack() { - unpack ${A} - cd "${S}/source" - - # This patch adds "-Wl,-z,now" to smb{mnt,umount} - # Please read ... for further informations - epatch "${FILESDIR}/${PV}-lazyldflags.patch" - epatch "${FILESDIR}/${PV}-py_smp.patch" - - # Ok, agreed, this is ugly. But it avoids a patch we - # need for every samba version and we don't need autotools - sed -i \ - -e 's|"lib32" ||' \ - -e 's|if test -d "$i/$l" ;|if test -d "$i/$l" -o -L "$i/$l";|' \ - configure || die "sed failed" -} - -src_compile() { - cd "${S}/source" - - local myconf - local mylangs - local mymod_shared - - python_version - myconf="--with-python=no" - use python && myconf="--with-python=${python}" - - mylangs="--with-manpages-langs=en" - use linguas_ja && mylangs="${mylangs},ja" - use linguas_pl && mylangs="${mylangs},pl" - - use winbind && mymod_shared="--with-shared-modules=idmap_rid" - if use ldap ; then - myconf="${myconf} $(use_with ads)" - use winbind && mymod_shared="${mymod_shared},idmap_ad" - fi - - [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie" - use hppa && myconf="${myconf} --disable-pie" - - use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no - - # Otherwise we get the whole swat stuff installed - if ! use swat ; then - sed -i \ - -e 's/^\(install:.*\)installswat \(.*\)/\1\2/' \ - Makefile.in || die "sed failed" - fi - - econf \ - --with-fhs \ - --sysconfdir=/etc/samba \ - --localstatedir=/var \ - --with-configdir=/etc/samba \ - --with-libdir=/usr/$(get_libdir)/samba \ - --with-swatdir=/usr/share/doc/${PF}/swat \ - --with-piddir=/var/run/samba \ - --with-lockdir=/var/cache/samba \ - --with-logfilebase=/var/log/samba \ - --with-privatedir=${PRIVATE_DST} \ - --with-libsmbclient \ - --without-spinlocks \ - --enable-socket-wrapper \ - --with-cifsmount=no \ - $(use_with acl acl-support) \ - $(use_with async aio-support) \ - $(use_with automount) \ - $(use_enable cups) \ - $(use_enable fam) \ - $(use_with ads krb5) \ - $(use_with ldap) \ - $(use_with pam) $(use_with pam pam_smbpass) \ - $(use_with quotas) $(use_with quotas sys-quotas) \ - $(use_with readline) \ - $(use_with kernel_linux smbmount) \ - $(use_with syslog) \ - $(use_with winbind) \ - ${myconf} ${mylangs} ${mymod_shared} || die "econf failed" - - emake proto || die "emake proto failed" - emake everything || die "emake everything failed" - - if use python ; then - emake python_ext || die "emake python_ext failed" - fi -} - -src_test() { - cd "${S}/source" - emake test || die "tests failed" -} - -src_install() { - cd "${S}/source" - - emake DESTDIR="${D}" install-everything || die "emake install-everything failed" - - # Extra rpctorture progs - local extra_bins="rpctorture" - for i in ${extra_bins} ; do - [[ -x "${S}/bin/${i}" ]] && dobin "${S}/bin/${i}" - done - - # remove .old stuff from /usr/bin: - rm -f "${D}"/usr/bin/*.old - - # Nsswitch extensions. Make link for wins and winbind resolvers - if use winbind ; then - dolib.so nsswitch/libnss_wins.so - dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2 - dolib.so nsswitch/libnss_winbind.so - dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2 - fi - - if use pam ; then - exeinto /$(get_libdir)/security - doexe bin/pam_smbpass.so - if use winbind ; then - exeinto /$(get_libdir)/security - doexe bin/pam_winbind.so - fi - fi - - if use kernel_linux ; then - # Warning: this can byte you if /usr is - # on a separate volume and you have to mount - # a smb volume before the local mount - dosym ../usr/bin/smbmount /sbin/mount.smbfs - fperms 4755 /usr/bin/smbmnt - fperms 4755 /usr/bin/smbumount - fi - - # bug #46389: samba doesn't create symlink anymore - # beaviour seems to be changed in 3.0.6, see bug #61046 - dosym samba/libsmbclient.so /usr/$(get_libdir)/libsmbclient.so.0 - dosym samba/libsmbclient.so /usr/$(get_libdir)/libsmbclient.so - - # make the smb backend symlink for cups printing support (bug #133133) - if use cups ; then - dodir $(cups-config --serverbin)/backend - dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb - fi - - if use python ; then - emake DESTDIR="${D}" python_install || die "emake installpython failed" - # We're doing that manually - find "${D}/usr/$(get_libdir)/python${PYVER}/site-packages" -iname "*.pyc" -delete - fi - - cd "${S}/source" - - # General config files - insinto /etc/samba - doins "${CONFDIR}"/{smbusers,lmhosts} - newins "${CONFDIR}/smb.conf.example-samba3" smb.conf.example - - newpamd "${CONFDIR}/samba.pam" samba - use winbind && doins ${CONFDIR}/system-auth-winbind - if use swat ; then - insinto /etc/xinetd.d - newins "${CONFDIR}/swat.xinetd swat" - else - rm -f "${D}/usr/sbin/swat" - rm -f "${D}/usr/share/man/man8/swat.8" - fi - - newinitd "${FILESDIR}/samba-init" samba - newconfd "${FILESDIR}/samba-conf" samba - - if use ldap ; then - insinto /etc/openldap/schema - doins "${S}/examples/LDAP/samba.schema" - fi - - if use ipv6 ; then - insinto /etc/xinetd.d - newins "${FILESDIR}/samba-xinetd" smb - fi - - # dirs - diropts -m0700 ; keepdir ${PRIVATE_DST} - diropts -m1777 ; keepdir /var/spool/samba - - diropts -m0755 - keepdir /var/{log,run,cache}/samba - keepdir /var/lib/samba/{netlogon,profiles} - keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC} - keepdir /usr/$(get_libdir)/samba/{rpc,idmap,auth} - - # docs - dodoc "${FILESDIR}/README.gentoo" - dodoc "${S}"/{COPYING,Manifest,README,Roadmap,WHATSNEW.txt} - dodoc "${CONFDIR}/nsswitch.conf-wins" - use winbind && dodoc "${CONFDIR}/nsswitch.conf-winbind" - - if use examples ; then - insinto /usr/share/doc/${PF} - doins -r "${S}/examples/" - find "${D}/usr/share/doc/${PF}" -type d -print0 | xargs -0 chmod 755 - find "${D}/usr/share/doc/${PF}/examples" ! -type d -print0 | xargs -0 chmod 644 - if use python ; then - insinto /usr/share/doc/${PF}/python - doins -r "${S}/source/python/examples" - fi - fi - - if ! use doc ; then - if ! use swat ; then - rm -rf "${D}/usr/share/doc/${PF}/swat" - else - rm -rf "${D}/usr/share/doc/${PF}/swat/help"/{guide,howto,devel} - rm -rf "${D}/usr/share/doc/${PF}/swat/using_samba" - fi - fi - -} - -pkg_preinst() { - local PRIVATE_SRC=/etc/samba/private - if [[ ! -r ${ROOT}/${PRIVATE_DST}/secrets.tdb \ - && -r ${ROOT}/${PRIVATE_SRC}/secrets.tdb ]] ; then - ebegin "Copying ${ROOT}/${PRIVATE_SRC}/* to ${ROOT}/${PRIVATE_DST}/" - mkdir -p "${D}"/${PRIVATE_DST} - cp -pPRf "${ROOT}"/${PRIVATE_SRC}/* "${D}"/${PRIVATE_DST}/ - eend $? - fi - - if [[ ! -f "${ROOT}/etc/samba/smb.conf" ]] ; then - touch "${D}/etc/samba/smb.conf" - fi -} - -pkg_postinst() { - if use python ; then - python_version - python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/samba - fi - - if use swat ; then - einfo "swat must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/swat configuration" - fi - - if use ipv6 ; then - einfo "ipv6 support must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/smb configuration" - fi - - elog "It is possible to start/stop daemons seperately:" - elog " Create a symlink from /etc/init.d/samba.{smbd,nmbd,winbind} to" - elog " /etc/init.d/samba. Calling /etc/init.d/samba directly will start" - elog " the daemons configured in /etc/conf.d/samba" - - elog "The mount/umount.cifs helper applications are not included anymore." - elog "Please install net-fs/mount-cifs instead." -} - -pkg_postrm() { - if use python ; then - python_version - python_mod_cleanup /usr/$(get_libdir)/python${PYVER}/site-packages/samba - fi - - # If stale docs, and one isn't re-emerging the latest version, removes - # (this is actually a portage bug, though) - [[ -n ${PF} && ! -f ${ROOT}/usr/$(get_libdir)/${PN}/en.msg ]] && \ - rm -rf "${ROOT}"/usr/share/doc/${PF} -} -- cgit v1.2.3-65-gdbad