net-mail/fetchmail: 6.4.3 bump
[gentoo.git] / net-mail / ezmlm-idx / ezmlm-idx-7.0.0-r3.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 qmail toolchain-funcs
7
8 DESCRIPTION="Simple yet powerful mailing list manager for qmail"
9 HOMEPAGE="http://www.ezmlm.org"
10 SRC_URI="http://www.ezmlm.org/archive/${PV}/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~alpha amd64 hppa ~mips ppc sparc x86"
15 IUSE="mysql postgres"
16
17 DEPEND="mysql? ( dev-db/mysql-connector-c:0= )
18         postgres? ( dev-db/postgresql )"
19 RDEPEND="${DEPEND}
20         virtual/qmail"
21 REQUIRED_USE="?? ( mysql postgres )"
22
23 src_prepare() {
24         default
25         echo /usr/bin > conf-bin || die
26         echo /usr/$(get_libdir)/ezmlm > conf-lib || die
27         echo /etc/ezmlm > conf-etc || die
28         echo /usr/share/man > conf-man || die
29         echo ${QMAIL_HOME} > conf-qmail || die
30
31         echo $(tc-getCC) ${CFLAGS} -I/usr/include/{my,postgre}sql > conf-cc || die
32         echo $(tc-getCC) ${CFLAGS} -Wl,-E > conf-ld || die
33
34         # fix DESTDIR and skip cat man-pages
35         sed -e "s:\(/install\) \(\"\`head\):\1 ${D}\2:" \
36                 -e "s:\(./install.*\) < MAN$:grep -v \:/cat MAN | \1:" \
37                 -e "s:\(\"\`head -n 1 conf-etc\`\"/default\):${D}\1:" \
38                 -i Makefile || die
39 }
40
41 src_compile() {
42         emake it man
43
44         if use mysql; then
45                 emake mysql
46         elif use postgres; then
47                 emake pgsql
48         fi
49 }
50
51 src_install() {
52         dodir /usr/bin /usr/$(get_libdir)/ezmlm /etc/ezmlm /usr/share/man
53         dobin ezmlm-{cgi,checksub,import,rmtab}
54
55         make DESTDIR="${D}" setup || die "make setup failed"
56 }