dev-qt/qttest: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / net-dns / ez-ipupdate / ez-ipupdate-3.0.11.13.3_beta8-r3.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5 inherit eutils readme.gentoo systemd user versionator
6
7 MY_BETA="$(get_version_component_range 6)"
8 MY_PATCH="$(get_version_component_range 4-5)"
9 MY_PV="$(get_version_component_range 1-3)${MY_BETA/beta/b}"
10
11 DESCRIPTION="Dynamic DNS client for lots of dynamic dns services"
12 HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
13 SRC_URI="mirror://debian/pool/main/e/ez-ipupdate/${PN}_${MY_PV}.orig.tar.gz
14         mirror://debian/pool/main/e/ez-ipupdate/${PN}_${MY_PV}-${MY_PATCH}.diff.gz"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
19 IUSE=""
20
21 DEPEND=""
22 RDEPEND=""
23
24 S="${WORKDIR}/${PN}-${MY_PV}"
25
26 DISABLE_AUTOFORMATTING="yes"
27 DOC_CONTENTS="
28 Please create one or more config files in
29 /etc/ez-ipupdate/. A bunch of samples can
30 be found in the doc directory.
31
32 All config files must have a '.conf' extension.
33
34 If you are using openRC you need to:
35 - Please do not use the 'run-as-user', 'run-as-euser',
36 'cache-file' and 'pidfile' options, since these are
37 handled internally by the init-script.
38
39 -If you want to use ez-ipupdate in daemon mode,
40 please add 'daemon' to the config file(s) and
41 add the ez-ipupdate init-script to the default runlevel.
42 Without the 'daemon' option, you can run the
43 init-script with the 'update' parameter inside
44 your PPP ip-up script.
45 "
46
47 src_prepare() {
48         # apply debian patches
49         epatch "${WORKDIR}/${PN}_${MY_PV}-${MY_PATCH}.diff"
50
51         # repair/apply additional debian patches
52         sed -i -e "s|^\(---\s*\)\.\./|\1|g" debian/patches/*.diff
53         EPATCH_SOURCE="${S}/debian/patches" EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch
54
55         # adding members.3322.org support
56         epatch "${FILESDIR}/${P}-3322.diff"
57
58         # adding www.dnsexit.com support
59         epatch "${FILESDIR}/${P}-dnsexit.diff"
60
61         # make ez-ipupdate work with iproute2/dhcpcd under linux (bug #318905)
62         epatch "${FILESDIR}/${P}-linux.diff"
63
64         # allows to set IPv6 via -a option, (bug #432764)
65         epatch "${FILESDIR}/${P}-ipv6.diff"
66
67         # repair format mask issues
68         sed -i -e "s|\(\s*\)\(strlen(putbuf)\)|\1(int)\2|g" ez-ipupdate.c || die
69
70         # comment out obsolete options
71         sed -i -e "s:^\(run-as-user.*\):#\1:g" \
72                 -e "s:^\(cache-file.*\):#\1:g" ex*conf || die
73
74         # make 'missing' executable (bug #103480)
75         chmod +x missing
76 }
77
78 src_configure() {
79         econf --bindir=/usr/sbin
80 }
81
82 src_install() {
83         emake DESTDIR="${D}" install
84         newinitd "${FILESDIR}/ez-ipupdate.initd" ez-ipupdate
85         systemd_dounit "${FILESDIR}/${PN}.service"
86         keepdir /etc/ez-ipupdate
87
88         # install docs
89         dodoc README
90         newdoc debian/README.Debian README.debian
91         newdoc debian/changelog ChangeLog.debian
92         newdoc CHANGELOG ChangeLog
93         doman debian/ez-ipupdate.8
94
95         # install example configs
96         docinto examples
97         dodoc ex*conf
98
99         readme.gentoo_create_doc
100 }
101
102 pkg_preinst() {
103         enewgroup ez-ipupd
104         enewuser ez-ipupd -1 -1 /var/cache/ez-ipupdate ez-ipupd
105 }
106
107 pkg_postinst() {
108         chmod 750 /etc/ez-ipupdate /var/cache/ez-ipupdate
109         chown ez-ipupd:ez-ipupd /etc/ez-ipupdate /var/cache/ez-ipupdate
110
111         readme.gentoo_print_elog
112
113         if [ -f /etc/ez-ipupdate.conf ]; then
114                 elog "The ez-ipupdate init-script can now handle more"
115                 elog "than one config file. New config file location is"
116                 elog "/etc/ez-ipupdate/*.conf"
117                 if [ ! -f /etc/ez-ipupdate/default.conf ]; then
118                         mv -f /etc/ez-ipupdate.conf /etc/ez-ipupdate/default.conf
119                         elog "Your old configuration has been moved to"
120                         elog "/etc/ez-ipupdate/default.conf"
121                 fi
122         fi
123 }