/[gentoo-x86]/net-misc/openntpd/openntpd-4.0_pre20080406.ebuild
Gentoo

Contents of /net-misc/openntpd/openntpd-4.0_pre20080406.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue May 26 14:31:03 2015 UTC (4 years, 6 months ago) by ottxor
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
silence rmdir (bug #544016)

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

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/openntpd-4.0_pre20080406.ebuild,v 1.3 2015/04/04 06:55:42 vapier Exp $
4
5 EAPI=5
6
7 inherit autotools eutils toolchain-funcs systemd user
8
9 MY_PV=${PV##*pre}
10 MY_P="${PN}_${MY_PV}p"
11 DEB_VER="6"
12 DESCRIPTION="Lightweight NTP server ported from OpenBSD"
13 HOMEPAGE="http://www.openntpd.org/"
14 SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${MY_P}.orig.tar.gz
15 mirror://debian/pool/main/${PN:0:1}/${PN}/${MY_P}-${DEB_VER}.debian.tar.gz"
16
17 LICENSE="BSD GPL-2"
18 SLOT="0"
19 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
20 IUSE="ssl selinux"
21
22 CDEPEND="ssl? ( dev-libs/openssl )
23 !<=net-misc/ntp-4.2.0-r2
24 !net-misc/ntp[-openntpd]"
25 DEPEND="${CDEPEND}
26 virtual/yacc"
27 RDEPEND="${CDEPEND}
28 selinux? ( sec-policy/selinux-ntp )
29 "
30
31 S="${WORKDIR}/${MY_P/_/-}"
32
33 pkg_setup() {
34 export NTP_HOME="${NTP_HOME:=/var/lib/openntpd/chroot}"
35 enewgroup ntp
36 enewuser ntp -1 -1 "${NTP_HOME}" ntp
37
38 # make sure user has correct HOME as flipng between
39 # the standard ntp pkg and this one was possible in
40 # the past
41 if [[ $(egethome ntp) != ${NTP_HOME} ]]; then
42 ewarn "From this version on, the homedir of the ntp user cannot be changed"
43 ewarn "dynamically after the installation. For homedir different from"
44 ewarn "/var/lib/openntpd/chroot set NTP_HOME in your make.conf and re-emerge."
45 esethome ntp "${NTP_HOME}"
46 fi
47 }
48
49 src_prepare() {
50 sed -i '/NTPD_USER/s:_ntp:ntp:' ntpd.h || die
51
52 epatch "${WORKDIR}"/debian/patches/*.patch
53 epatch "${FILESDIR}/${PN}-${MY_PV}-pidfile.patch"
54 epatch "${FILESDIR}/${PN}-${MY_PV}-signal.patch"
55 epatch "${FILESDIR}/${PN}-${MY_PV}-dns-timeout.patch"
56 sed -i 's:debian:gentoo:g' ntpd.conf || die
57 eautoreconf # deb patchset touches .ac files and such
58 }
59
60 src_configure() {
61 econf \
62 --disable-strip \
63 $(use_with !ssl builtin-arc4random) \
64 AR="$(type -p $(tc-getAR))"
65 }
66
67 src_install() {
68 default
69 rmdir "${ED}"/{var/empty,var}
70
71 newinitd "${FILESDIR}/${PN}.init.d-${MY_PV}-r6" ntpd
72 newconfd "${FILESDIR}/${PN}.conf.d-${MY_PV}-r6" ntpd
73
74 systemd_newunit "${FILESDIR}/${PN}.service-${MY_PV}-r4" ntpd.service
75 }
76
77 pkg_config() {
78 einfo "Setting up chroot for ntp in ${NTP_HOME}"
79 # remove localtime file from previous installations
80 rm -f "${EROOT%/}${NTP_HOME}"/etc/localtime
81 mkdir -p "${EROOT%/}${NTP_HOME}"/etc
82 if ! ln "${EROOT%/}"/etc/localtime "${EROOT%/}${NTP_HOME}"/etc/localtime ; then
83 cp "${EROOT%/}"/etc/localtime "${EROOT%/}${NTP_HOME}"/etc/localtime || die
84 einfo "We could not create a hardlink from /etc/localtime to ${NTP_HOME}/etc/localtime,"
85 einfo "so please run 'emerge --config =${CATEGORY}/${PF}' whenever you changed"
86 einfo "your timezone."
87 fi
88 chown -R root:root "${EROOT%/}${NTP_HOME}" || die
89 }
90
91 pkg_postinst() {
92 pkg_config
93
94 [[ -f ${EROOT}var/log/ntpd.log ]] && \
95 ewarn "There is an orphaned logfile '${EROOT}var/log/ntpd.log', please remove it!"
96
97 # bug #226491, remove <=openntpd-20080406-r7 trash
98 rm -f "${EROOT%/}${NTP_HOME}"etc/localtime
99 [-d "${EROOT%/}${NTP_HOME}"etc ] && rmdir "${EROOT%/}${NTP_HOME}"etc
100 }
101
102 pkg_postrm() {
103 # remove localtime file from previous installations
104 rm -f "${EROOT%/}${NTP_HOME}"/etc/localtime
105 }

  ViewVC Help
Powered by ViewVC 1.1.20