/[gentoo-x86]/net-misc/openntpd/openntpd-20080406-r5.ebuild
Gentoo

Contents of /net-misc/openntpd/openntpd-20080406-r5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Mon Dec 2 13:32:13 2013 UTC (6 years, 1 month ago) by ottxor
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
added pidfile support (bug #493082), fixed ignored NTPD_OPTS for USE=syslog (bug #493032)

(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key C2000586)

1 ottxor 1.1 # Copyright 1999-2013 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 ottxor 1.3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/openntpd-20080406-r5.ebuild,v 1.2 2013/12/01 21:07:36 ottxor Exp $
4 ottxor 1.1
5     EAPI=5
6    
7     inherit autotools eutils toolchain-funcs systemd user
8    
9     MY_P="${P/-/_}p"
10     DEB_VER="6"
11     DESCRIPTION="Lightweight NTP server ported from OpenBSD"
12     HOMEPAGE="http://www.openntpd.org/"
13     SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${MY_P}.orig.tar.gz
14     mirror://debian/pool/main/${PN:0:1}/${PN}/${MY_P}-${DEB_VER}.debian.tar.gz"
15    
16     LICENSE="BSD GPL-2"
17     SLOT="0"
18     KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
19 ottxor 1.2 IUSE="ssl selinux +syslog"
20 ottxor 1.1
21     RDEPEND="ssl? ( dev-libs/openssl )
22     selinux? ( sec-policy/selinux-ntp )
23     !<=net-misc/ntp-4.2.0-r2
24     !net-misc/ntp[-openntpd]"
25     DEPEND="${RDEPEND}
26     virtual/yacc"
27    
28     S="${WORKDIR}/${MY_P/_/-}"
29    
30     pkg_setup() {
31     export NTP_HOME="${NTP_HOME:=/var/lib/openntpd/chroot}"
32     enewgroup ntp
33     enewuser ntp -1 -1 "${NTP_HOME}" ntp
34    
35     # make sure user has correct HOME as flipng between
36     # the standard ntp pkg and this one was possible in
37     # the past
38     if [[ $(egethome ntp) != ${NTP_HOME} ]]; then
39     ewarn "From this version on, the homedir of the ntp user cannot be changed"
40     ewarn "dynamically after the installation. For homedir different from"
41     ewarn "/var/lib/openntpd/chroot set NTP_HOME in your make.conf and re-emerge."
42     esethome ntp "${NTP_HOME}"
43     fi
44     }
45    
46     src_prepare() {
47     sed -i '/NTPD_USER/s:_ntp:ntp:' ntpd.h || die
48    
49     epatch "${WORKDIR}"/debian/patches/*.patch
50     sed -i 's:debian:gentoo:g' ntpd.conf || die
51     eautoreconf # deb patchset touches .ac files and such
52     }
53    
54     src_configure() {
55     econf \
56     --disable-strip \
57     $(use_with !ssl builtin-arc4random) \
58     AR="$(type -p $(tc-getAR))"
59     }
60    
61     src_install() {
62     default
63    
64     cp "${FILESDIR}/${PN}.init.d-${PV}-r4" "${T}/ntpd" || die
65     use !syslog || sed -e '8,12d' -i "${T}/ntpd" || die
66     doinitd "${T}/ntpd"
67     newconfd "${FILESDIR}/${PN}.conf.d-${PV}-r3" ntpd
68    
69     insinto /etc/logrotate.d
70     newins "${FILESDIR}/${PN}.logrotate-${PVR}" "${PN}"
71    
72     systemd_newunit "${FILESDIR}/${PN}.service-${PV}-r3" ntpd.service
73     }
74    
75     pkg_postinst() {
76     # remove localtime file from previous installations
77     rm -f "${EROOT}${NTP_HOME}"/etc/localtime
78     mkdir -p "${NTP_HOME}"/etc
79     ln -s /etc/localtime "${NTP_HOME}"/etc/localtime || die
80     chown -R root:root "${EROOT}${NTP_HOME}" || die
81     }
82    
83     pkg_postrm() {
84     # remove localtime file from previous installations
85     rm -f "${EROOT}${NTP_HOME}"/etc/localtime
86     }

  ViewVC Help
Powered by ViewVC 1.1.20