| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-libs/libpwquality/libpwquality-1.2.0-r2.ebuild,v 1.5 2013/01/01 14:10:55 ago Exp $
|
| 4 |
|
| 5 |
EAPI="5"
|
| 6 |
PYTHON_COMPAT=( python2_7 )
|
| 7 |
|
| 8 |
inherit eutils multilib pam python-r1 toolchain-funcs
|
| 9 |
|
| 10 |
DESCRIPTION="Library for password quality checking and generating random passwords"
|
| 11 |
HOMEPAGE="https://fedorahosted.org/libpwquality/"
|
| 12 |
SRC_URI="https://fedorahosted.org/releases/l/i/${PN}/${P}.tar.bz2"
|
| 13 |
|
| 14 |
LICENSE="|| ( BSD GPL-2 )"
|
| 15 |
SLOT="0"
|
| 16 |
KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
|
| 17 |
IUSE="pam python static-libs"
|
| 18 |
|
| 19 |
RDEPEND=">=sys-libs/cracklib-2.8:=
|
| 20 |
pam? ( virtual/pam )
|
| 21 |
python? ( ${PYTHON_DEPS} )"
|
| 22 |
DEPEND="${RDEPEND}
|
| 23 |
sys-devel/libtool
|
| 24 |
virtual/pkgconfig"
|
| 25 |
|
| 26 |
src_prepare() {
|
| 27 |
# ensure pkgconfig files go in /usr
|
| 28 |
sed -e 's:\(pkgconfigdir *=\).*:\1 '${EPREFIX}/usr/$(get_libdir)'/pkgconfig:' \
|
| 29 |
-i src/Makefile.{am,in} || die "sed failed"
|
| 30 |
use python && python_copy_sources
|
| 31 |
}
|
| 32 |
|
| 33 |
src_configure() {
|
| 34 |
# Install library in /lib for pam
|
| 35 |
configuring() {
|
| 36 |
local sitedir
|
| 37 |
econf \
|
| 38 |
--libdir="${EPREFIX}/$(get_libdir)" \
|
| 39 |
$(use_enable pam) \
|
| 40 |
--with-securedir="${EPREFIX}/$(getpam_mod_dir)" \
|
| 41 |
$(use_enable python python-bindings) \
|
| 42 |
$(usex python "--with-pythonsitedir=$(use python && python_get_sitedir)" "") \
|
| 43 |
$(use_enable static-libs static)
|
| 44 |
}
|
| 45 |
if_use_python_python_foreach_impl configuring
|
| 46 |
}
|
| 47 |
|
| 48 |
src_compile() {
|
| 49 |
if_use_python_python_foreach_impl default
|
| 50 |
}
|
| 51 |
|
| 52 |
src_test() {
|
| 53 |
if_use_python_python_foreach_impl default
|
| 54 |
}
|
| 55 |
|
| 56 |
src_install() {
|
| 57 |
if_use_python_python_foreach_impl default
|
| 58 |
if use static-libs; then
|
| 59 |
# Do not install static libs in /lib
|
| 60 |
mkdir -p "${ED}usr/$(get_libdir)"
|
| 61 |
mv "${ED}$(get_libdir)/libpwquality.a" "${ED}/usr/$(get_libdir)/" || die
|
| 62 |
gen_usr_ldscript libpwquality.so
|
| 63 |
fi
|
| 64 |
prune_libtool_files --modules
|
| 65 |
}
|
| 66 |
|
| 67 |
if_use_python_python_foreach_impl() {
|
| 68 |
run_in_build_dir() {
|
| 69 |
pushd "${BUILD_DIR}" > /dev/null || die
|
| 70 |
"$@"
|
| 71 |
popd > /dev/null
|
| 72 |
}
|
| 73 |
|
| 74 |
if use python; then
|
| 75 |
python_foreach_impl run_in_build_dir "$@"
|
| 76 |
else
|
| 77 |
"$@"
|
| 78 |
fi
|
| 79 |
}
|