# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="Perl updater client for dynamic DNS services" HOMEPAGE="http://ddclient.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" IUSE="" RDEPEND="dev-lang/perl" pkg_setup() { enewgroup ${PN} enewuser ${PN} -1 -1 /dev/null ${PN} } src_unpack() { unpack ${A} cd "${S}" sed -i ${PN} \ -e 's:$etc$program.cache:/var/cache/ddclient/$program.cache:' \ || die "sed ${PN} failed" # Remove pid line, because it is specified in the init script sed -i sample-etc_${PN}.conf \ -e "/^pid=*/d" \ || die "sed sample failed" } src_install() { dosbin ${PN} || die "dosbin" dodoc README* Change* COPYRIGHT dodoc sample-etc_[c-p]* newinitd "${FILESDIR}"/${PN}.init ${PN} # Determine name of sample configuration file local sample=${PN}.conf [[ -e /etc/${PN}/${sample} ]] && sample=${PN}-sample.conf insinto /etc/${PN} insopts -m 0600 -o ${PN} -g ${PN} newins sample-etc_${PN}.conf ${sample} diropts -m 0755 -o ${PN} -g ${PN} for d in {run,cache} ; do keepdir /var/${d}/${PN} done } pkg_postinst() { # Fix permissions chown root:root /etc/ddclient/ chmod 755 /etc/ddclient/ chown ddclient:ddclient /etc/ddclient/ddclient.conf chmod 600 /etc/ddclient/ddclient.conf if [[ -e /etc/ddclient/ddclient-sample.conf ]] ; then # Sample configuration file chown ddclient:ddclient /etc/ddclient/ddclient-sample.conf chmod 600 /etc/ddclient/ddclient-sample.conf fi chown ddclient:ddclient /var/run/ddclient/ chmod 755 /var/run/ddclient/ }