dev-qt/qtopengl: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / net-libs / cvm / cvm-0.97.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit toolchain-funcs
7
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"
11
12 LICENSE="GPL-2+"
13 SLOT="0"
14 KEYWORDS="~amd64 ppc sparc x86"
15 IUSE="mysql postgres test vpopmail"
16 RESTRICT="!test? ( test )"
17
18 RDEPEND="dev-db/cdb:=
19         >=dev-libs/bglibs-2.04:0="
20 DEPEND="${RDEPEND}
21         mysql? ( dev-db/mysql-connector-c:0= )
22         postgres? ( dev-db/postgresql[server] )
23         vpopmail? ( net-mail/vpopmail )
24         test? (
25                 app-editors/vim
26                 dev-db/sqlite
27         )"
28 # some of the testcases use
29 # - ex/vi/xxd
30 # - cdbmake
31 # - sqlite
32
33 PATCHES=( "${FILESDIR}"/${PN}-0.96-fix-test-padding.patch )
34
35 src_prepare() {
36         default
37         # disable this test, as it breaks under Portage
38         # and there is no easy fix
39         sed -i.orig \
40                 -e '/qmail-lookup-nodomain/,/^END_OF_TEST_RESULTS/d' \
41                 tests.sh || die "sed failed"
42         # Fix the vpopmail build
43         sed -i.orig \
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' \
49                 Makefile \
50                 || die "Failed to fix vpopmail linking parts of Makefile"
51         sed -i.orig \
52                 -e '/.\/compile cvm-vchkpw/s,$, `cat /var/vpopmail/etc/inc_deps`,g' \
53                 Makefile \
54                 || die "Failed to fix vpopmail compiling parts of Makefile"
55         sed -i '/\-rpath/s|conf\-lib|conf\-rpath|' Makefile || die
56 }
57
58 src_configure() {
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
65 }
66
67 src_compile() {
68         emake -j1
69
70         if use mysql; then
71                 einfo "Building MySQL support"
72                 emake mysql
73         fi
74
75         if use postgres; then
76                 einfo "Building Postgresql support"
77                 emake pgsql
78         fi
79
80         if use vpopmail; then
81                 einfo "Building vpopmail support"
82                 emake cvm-vchkpw
83         fi
84 }
85
86 src_test() {
87         # bug 624384
88         # the test suite tests stuff that isn't potentially enabled
89         emake -j1 sqlite
90         sh tests.sh || die "Testing Failed"
91 }
92
93 src_install() {
94         # Upstreams installer is incredibly broken
95         dolib.a .libs/*.a
96         dolib.so .libs/*.so*
97
98         local i
99         for i in a so; do
100                 dosym libcvm-v2client.${i} /usr/$(get_libdir)/libcvm-client.${i}
101         done
102
103         for i in {bench,test}client chain checkpassword pwfile qmail unix \
104                         vmailmgr{,-local,-udp} v1{benchclient,checkpassword,testclient} \
105                 ; do
106                         dobin .libs/cvm-${i}
107         done
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
111
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
116
117         dodoc ANNOUNCEMENT NEWS{,.sql,.vmailmgr}
118         dodoc README{,.vchkpw,.vmailmgr}
119         dodoc TODO VERSION ChangeLog*
120         docinto html
121         dodoc *.html
122 }