1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils readme.gentoo systemd user versionator
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}"
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"
18 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
24 S="${WORKDIR}/${PN}-${MY_PV}"
26 DISABLE_AUTOFORMATTING="yes"
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.
32 All config files must have a '.conf' extension.
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.
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.
48 # apply debian patches
49 epatch "${WORKDIR}/${PN}_${MY_PV}-${MY_PATCH}.diff"
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
55 # adding members.3322.org support
56 epatch "${FILESDIR}/${P}-3322.diff"
58 # adding www.dnsexit.com support
59 epatch "${FILESDIR}/${P}-dnsexit.diff"
61 # make ez-ipupdate work with iproute2/dhcpcd under linux (bug #318905)
62 epatch "${FILESDIR}/${P}-linux.diff"
64 # allows to set IPv6 via -a option, (bug #432764)
65 epatch "${FILESDIR}/${P}-ipv6.diff"
67 # repair format mask issues
68 sed -i -e "s|\(\s*\)\(strlen(putbuf)\)|\1(int)\2|g" ez-ipupdate.c || die
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
74 # make 'missing' executable (bug #103480)
79 econf --bindir=/usr/sbin
83 emake DESTDIR="${D}" install
84 newinitd "${FILESDIR}/ez-ipupdate.initd" ez-ipupdate
85 systemd_dounit "${FILESDIR}/${PN}.service"
86 keepdir /etc/ez-ipupdate
90 newdoc debian/README.Debian README.debian
91 newdoc debian/changelog ChangeLog.debian
92 newdoc CHANGELOG ChangeLog
93 doman debian/ez-ipupdate.8
95 # install example configs
99 readme.gentoo_create_doc
104 enewuser ez-ipupd -1 -1 /var/cache/ez-ipupdate ez-ipupd
108 chmod 750 /etc/ez-ipupdate /var/cache/ez-ipupdate
109 chown ez-ipupd:ez-ipupd /etc/ez-ipupdate /var/cache/ez-ipupdate
111 readme.gentoo_print_elog
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"