1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs
8 DESCRIPTION="Credential Validation Modules by Bruce Guenter"
9 HOMEPAGE="http://untroubled.org/cvm/"
10 SRC_URI="http://untroubled.org/cvm/archive/${P}.tar.gz"
14 KEYWORDS="~amd64 ppc sparc x86"
15 IUSE="mysql postgres test vpopmail"
16 RESTRICT="!test? ( test )"
19 >=dev-libs/bglibs-2.04:0="
21 mysql? ( dev-db/mysql-connector-c:0= )
22 postgres? ( dev-db/postgresql[server] )
23 vpopmail? ( net-mail/vpopmail )
28 # some of the testcases use
33 PATCHES=( "${FILESDIR}"/${PN}-0.96-fix-test-padding.patch )
37 # disable this test, as it breaks under Portage
38 # and there is no easy fix
40 -e '/qmail-lookup-nodomain/,/^END_OF_TEST_RESULTS/d' \
41 tests.sh || die "sed failed"
42 # Fix the vpopmail build
44 -e '/.\/ltload cvm-vchkpw/s,-lmysqlclient,,g' \
45 -e '/.\/ltload cvm-vchkpw/s,-L/usr/local/vpopmail/lib,,g' \
46 -e '/.\/ltload cvm-vchkpw/s,-L/var/vpopmail/lib,,g' \
47 -e '/.\/ltload cvm-vchkpw/s,-L/usr/local/lib/mysql,,g' \
48 -e '/.\/ltload cvm-vchkpw/s,\.la,.la `cat /var/vpopmail/etc/lib_deps`,g' \
50 || die "Failed to fix vpopmail linking parts of Makefile"
52 -e '/.\/compile cvm-vchkpw/s,$, `cat /var/vpopmail/etc/inc_deps`,g' \
54 || die "Failed to fix vpopmail compiling parts of Makefile"
55 sed -i '/\-rpath/s|conf\-lib|conf\-rpath|' Makefile || die
59 echo "${ED}/usr/include" > conf-include || die
60 echo "${ED}/usr/$(get_libdir)" > conf-lib || die
61 echo "${ED}/usr/bin" > conf-bin || die
62 echo "${EPREFIX}/usr/$(get_libdir)" > conf-rpath || die
63 echo "$(tc-getCC) ${CFLAGS}" > conf-cc || die
64 echo "$(tc-getCC) ${LDFLAGS} -L${EPREFIX}/usr/$(get_libdir)/bglibs -lcrypt" > conf-ld || die
71 einfo "Building MySQL support"
76 einfo "Building Postgresql support"
81 einfo "Building vpopmail support"
88 # the test suite tests stuff that isn't potentially enabled
90 sh tests.sh || die "Testing Failed"
94 # Upstreams installer is incredibly broken
100 dosym libcvm-v2client.${i} /usr/$(get_libdir)/libcvm-client.${i}
103 for i in {bench,test}client chain checkpassword pwfile qmail unix \
104 vmailmgr{,-local,-udp} v1{benchclient,checkpassword,testclient} \
108 use mysql && dobin .libs/cvm-mysql{,-local,-udp}
109 use postgres && dobin .libs/cvm-pgsql{,-local,-udp}
110 use vpopmail && dobin .libs/cvm-vchkpw
112 insinto /usr/include/cvm
113 doins {credentials,errors,facts,module,protocol,sasl,v1client,v2client}.h
114 dosym v1client.h /usr/include/cvm/client.h
115 dosym cvm/sasl.h /usr/include/cvm-sasl.h
117 dodoc ANNOUNCEMENT NEWS{,.sql,.vmailmgr}
118 dodoc README{,.vchkpw,.vmailmgr}
119 dodoc TODO VERSION ChangeLog*