# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils PNC="${PN}-5.0a3" DESCRIPTION="RPM, the RPM Package Manager." HOMEPAGE="http://rpm5.org/" SRC_URI="http://rpm5.org/files/rpm/rpm-5.0/${PNC}.tar.gz" LICENSE="LGPL" SLOT="0" KEYWORDS="~amd64 ~ppc ~ppc64 ~s390 ~sparc ~x86" IUSE="bzip2 crypt debug elf gzip keyutils lua file neon nls pcre python sqlite xar" DEPEND=">=dev-lang/perl-5.8.0 >=dev-libs/popt-1.9 >=dev-libs/beecrypt-4.0 neon? (>=net-misc/neon-0.26) sqlite? (>=dev-db/sqlite-3.3) lua? (>=lua-5.1) file? (>=sys-apps/file-4.0) nls? (>=sys-devel/gettext-0.16) pcre? (>=dev-libs/libpcre-7.0) debug? (>=dev-libs/dmalloc-5 >=dev-util/efence-2.1) keyutils? (>=sys-apps/keyutils-1.2) elf? ( dev-libs/elfutils) xar? ( >=app-arch/xar-1.6 )" # Use only bundled db because # external db is unsupported. #berkdb? (=sys-libs/db-4.6.19) # Use bundled lua because external # lua is not recommended. #lua? (>=dev-lang/lua-5.1) # Use bundled zlib because # external zlib is not recommeded. #zlib? (>=sys-libs/zlib-1.2) src_unpack() { unpack ${A} || die "failed to unpack" cp "$FILESDIR/librpmmisc.vers" "${WORKDIR}/${PNC}/misc" } src_compile() { cd "${WORKDIR}/${PNC}" local conf if use sqlite; then conf="--with-dbapi=sqlite" fi econf --prefix=/usr \ --without-selinux \ $(use_enable nls) \ $(use_with elf libelf) \ $(use_with python) \ $(use_with debug dmalloc efense) \ $(use_with bzip2) \ $(use_with keyutils) \ $(use_with file) \ $(use_with neon) \ $(use_with sqlite sqlite) \ $(use_with lua) \ $(use_with xar) \ ${conf} \ || die "configure failed" emake || die "emake failed" } src_install() { cd "${WORKDIR}/${PNC}" emake DESTDIR="${D}" install || die "make install failed" } pkg_preinst() { enewgroup ${PN} ${GUID} enewuser ${PN} ${GUID} /bin/bash /var/lib/rpm rpm } pkg_postinst() { chown -R rpm:rpm "${ROOT}"/{usr,var}/lib/rpm chown rpm:rpm "${ROOT}"/usr/bin/rpm{,2cpio,build,constant} if [[ -f "${ROOT}"/var/lib/rpm/Packages ]] ; then einfo "RPM database found... Rebuilding database (may take a while)..." "${ROOT}"/usr/bin/rpm --rebuilddb --root="${ROOT}" else einfo "No RPM database found... Creating database..." "${ROOT}"/usr/bin/rpm --initdb --root="${ROOT}" fi chown rpm:rpm "${ROOT}"/var/lib/rpm/* }