dev-qt/qtx11extras: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / net-dns / ndu / ndu-0.4-r4.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="DNS serial number incrementer and reverse zone builder"
9 SRC_URI="http://uranus.it.swin.edu.au/~jn/linux/${P}.tar.gz"
10 HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 ppc x86"
15 IUSE=""
16
17 RDEPEND="sys-apps/ed" # dnstouch calls ed to do the dirty work
18
19 src_prepare() {
20         default
21         eapply "${FILESDIR}"/${P}-binary-locations.patch
22
23         # match our bind config
24         sed -e 's|0.0.127.in-addr.arpa|127.in-addr.arpa|g' -i ndu.conf || die
25         # document the support for the chrooted BIND setup
26         cat >> ndu.conf <<-EOF || die
27                 // if you use a chrooted setup, then you need to uncomment these lines:
28                 //process "/chroot/dns/named.conf"
29                 //chroot "/chroot/dns"
30         EOF
31
32         cd src || die
33         # use the correct compiler
34         sed -e 's|gcc|$(CXX)|g' -i Makefile || die
35         # set correct config pathes
36         sed -e 's|#define CONFIG_PATH "/etc/"|#define CONFIG_PATH "/etc/bind/"|g' \
37                 -i ndu.cpp || die
38         sed -e 's|"/etc/ndu.conf"|"/etc/bind/ndu.conf"|g' -i dnstouch.cpp || die
39         # hack up something to work around bug #73858
40         sed -e 's|execlp("ed", "ed", filename, 0);|execlp("ed", "ed", "-s", filename, 0);|g' \
41                 -i dnstouch.cpp || die
42         # use the correct editor
43         sed -e 's|VISUAL|EDITOR|g' -i dnsedit || die
44 }
45
46 src_compile() {
47         emake -C src CFLAGS="${CFLAGS}" CXX="$(tc-getCXX)"
48 }
49
50 src_install() {
51         dobin src/{dnsedit,ndu,dnstouch}
52         insinto /etc/bind
53         doins ndu.conf
54         dodoc README INSTALL
55 }
56
57 pkg_postinst() {
58         elog "The ndu binary expects to read your configuration"
59         elog "from /etc/bind/named.conf, however the other binaries"
60         elog "are useful with BIND locally installed."
61 }