2009-04-29 16:13:26 +02:00
|
|
|
# Copyright 1999-2009 Gentoo Foundation
|
2007-10-18 16:37:51 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2009-04-29 16:13:26 +02:00
|
|
|
# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.0.34.ebuild,v 1.1 2009/03/29 16:49:58 patrick Exp $
|
2007-10-18 16:37:51 +02:00
|
|
|
|
2009-04-30 13:47:22 +02:00
|
|
|
inherit autotools eutils python multilib versionator confutils
|
2007-10-18 16:37:51 +02:00
|
|
|
|
|
|
|
MY_P=${PN}-${PV/_/}
|
|
|
|
|
|
|
|
DESCRIPTION="A suite of SMB and CIFS client/server programs for UNIX"
|
|
|
|
HOMEPAGE="http://www.samba.org/"
|
2009-04-30 11:38:09 +02:00
|
|
|
SRC_URI="mirror://samba/samba4/${MY_P}.tar.gz"
|
|
|
|
LICENSE="GPL-3"
|
2007-10-18 16:37:51 +02:00
|
|
|
SLOT="0"
|
2009-04-30 13:02:04 +02:00
|
|
|
KEYWORDS="~amd64 ~x86"
|
2009-04-30 13:47:22 +02:00
|
|
|
IUSE="acl caps debug developer doc dso examples gnutls ldap readline threads"
|
2007-10-18 16:37:51 +02:00
|
|
|
|
2009-04-29 19:53:00 +02:00
|
|
|
RDEPEND="sys-libs/e2fsprogs-libs
|
2009-04-30 11:38:09 +02:00
|
|
|
dev-lang/python
|
2009-04-30 12:55:07 +02:00
|
|
|
acl? ( sys-apps/acl sys-apps/attr )
|
2009-04-29 19:53:00 +02:00
|
|
|
caps? ( sys-libs/libcap )
|
2009-04-29 19:42:10 +02:00
|
|
|
gnutls? ( >=net-libs/gnutls-2.0 )
|
|
|
|
ldap? ( >=net-nds/openldap-2.4.15 )
|
2009-04-30 13:47:22 +02:00
|
|
|
readline? ( sys-libs/readline )"
|
2009-04-30 13:16:25 +02:00
|
|
|
|
|
|
|
# Don't build, if modularized Samba 3.3 (from dev-zero overlay) is installed
|
2009-04-30 14:01:34 +02:00
|
|
|
DEPEND="!net-fs/samba-client
|
|
|
|
!net-fs/samba-server
|
|
|
|
!net-fs/samba-libs
|
|
|
|
${RDEPEND}"
|
2007-10-18 16:37:51 +02:00
|
|
|
|
2009-04-29 19:42:10 +02:00
|
|
|
RESTRICT="nomirror"
|
2009-04-29 16:13:26 +02:00
|
|
|
|
2009-04-30 13:56:41 +02:00
|
|
|
S=${WORKDIR}/${MY_P}/source4
|
2009-04-29 19:42:10 +02:00
|
|
|
CONFDIR=${FILESDIR}/config-4.0
|
2007-10-18 16:37:51 +02:00
|
|
|
PRIVATE_DST=/var/lib/samba/private
|
|
|
|
|
2009-04-29 16:13:26 +02:00
|
|
|
src_unpack() {
|
|
|
|
unpack ${A}
|
2009-04-30 13:56:41 +02:00
|
|
|
cd "${S}"
|
2009-04-29 16:13:26 +02:00
|
|
|
|
|
|
|
# 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() {
|
2009-04-30 13:56:41 +02:00
|
|
|
cd "${S}"
|
2007-10-18 16:37:51 +02:00
|
|
|
|
|
|
|
local myconf
|
|
|
|
|
|
|
|
use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
|
|
|
|
|
2009-04-30 11:38:09 +02:00
|
|
|
use doc && myconf="${myconf} --docdir=/usr/share/doc/${PF}"
|
|
|
|
|
2007-10-18 16:37:51 +02:00
|
|
|
econf \
|
|
|
|
--sysconfdir=/etc/samba \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--with-piddir=/var/run/samba \
|
|
|
|
--with-lockdir=/var/cache/samba \
|
|
|
|
--with-logfilebase=/var/log/samba \
|
|
|
|
--with-privatedir=${PRIVATE_DST} \
|
2009-04-29 19:42:10 +02:00
|
|
|
--enable-automatic-dependencies \
|
2009-04-29 16:13:26 +02:00
|
|
|
--enable-fhs \
|
2009-04-29 19:42:10 +02:00
|
|
|
--enable-socket-wrapper \
|
2009-04-30 13:02:04 +02:00
|
|
|
$(use_with threads pthreads) \
|
2009-04-29 19:42:10 +02:00
|
|
|
$(use_enable gnutls) \
|
2009-04-29 16:13:26 +02:00
|
|
|
$(use_enable debug) \
|
2009-04-29 19:42:10 +02:00
|
|
|
$(use_enable developer) \
|
|
|
|
$(use_enable dso) \
|
|
|
|
${myconf}
|
2007-10-18 16:37:51 +02:00
|
|
|
|
|
|
|
emake proto || die "emake proto failed"
|
|
|
|
emake everything || die "emake everything failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_test() {
|
2009-04-30 13:56:41 +02:00
|
|
|
cd "${S}"
|
2007-10-18 16:37:51 +02:00
|
|
|
emake test || die "tests failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2009-04-30 13:56:41 +02:00
|
|
|
cd "${S}"
|
2007-10-18 16:37:51 +02:00
|
|
|
|
2009-04-29 16:13:26 +02:00
|
|
|
emake DESTDIR="${D}" install || die "emake install failed"
|
2007-10-18 16:37:51 +02:00
|
|
|
|
2009-04-29 19:42:10 +02:00
|
|
|
newinitd "${CONFDIR}/samba-init" samba
|
|
|
|
newconfd "${CONFDIR}/samba-conf" samba
|
2007-10-18 16:37:51 +02:00
|
|
|
|
|
|
|
# dirs
|
2009-04-29 16:13:26 +02:00
|
|
|
diropts -m0700 ; keepdir "${PRIVATE_DST}"
|
2007-10-18 16:37:51 +02:00
|
|
|
|
|
|
|
diropts -m0755
|
|
|
|
keepdir /var/{log,run,cache}/samba
|
|
|
|
|
|
|
|
# docs
|
2009-04-30 13:47:22 +02:00
|
|
|
dodoc "${S}"/{BUGS,NEWS,TODO}
|
2007-10-18 16:37:51 +02:00
|
|
|
|
|
|
|
if use examples ; then
|
2009-04-30 11:38:09 +02:00
|
|
|
insinto /usr/share/doc/${PF}/python
|
|
|
|
doins -r "${S}/scripting/python/examples"
|
2007-10-18 16:37:51 +02:00
|
|
|
fi
|
|
|
|
|
2009-04-29 19:42:10 +02:00
|
|
|
insinto /usr/share/${PN}/setup
|
|
|
|
doins -r setup
|
2007-10-18 16:37:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
pkg_preinst() {
|
|
|
|
local PRIVATE_SRC=/etc/samba/private
|
2009-04-29 16:13:26 +02:00
|
|
|
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}/"
|
2007-10-18 16:37:51 +02:00
|
|
|
eend $?
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -f "${ROOT}/etc/samba/smb.conf" ]] ; then
|
|
|
|
touch "${D}/etc/samba/smb.conf"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
2009-04-30 11:38:09 +02:00
|
|
|
python_version
|
|
|
|
python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/samba
|
2007-10-18 16:37:51 +02:00
|
|
|
|
2009-04-29 19:42:10 +02:00
|
|
|
elog "Specialized mount/umount.cifs helper applications are not yet available for"
|
|
|
|
elog "Samba 4.0."
|
|
|
|
elog "You may try to install net-fs/mount-cifs at your own risk."
|
2009-04-29 16:13:26 +02:00
|
|
|
|
2009-04-30 14:07:30 +02:00
|
|
|
echo
|
|
|
|
|
2009-04-29 19:42:10 +02:00
|
|
|
elog "The provision helper scripts for setting up LDAP backends, etc. are installed"
|
|
|
|
elog "/usr/share/samba/setup."
|
|
|
|
|
2009-04-30 14:07:30 +02:00
|
|
|
echo
|
|
|
|
|
2009-04-29 19:42:10 +02:00
|
|
|
ewarn "If you're upgrading from 3.x.x, make sure to read the information on the"
|
|
|
|
ewarn "SambaWiki [http://wiki.samba.org/index.php/Samba4] to make yourself familiar"
|
|
|
|
ewarn "with the status of Samba 4 and the various differences to the 3.x branch."
|
2007-10-18 16:37:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postrm() {
|
|
|
|
if use python ; then
|
|
|
|
python_version
|
|
|
|
python_mod_cleanup /usr/$(get_libdir)/python${PYVER}/site-packages/samba
|
|
|
|
fi
|
|
|
|
}
|