summaryrefslogtreecommitdiff
blob: 8f4461b57c0372d0dbea687d9b77741a8d1a43b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/ntp-4.1.1b-r6.ebuild,v 1.10 2003/11/11 13:46:49 vapier Exp $

inherit eutils

DESCRIPTION="Network Time Protocol suite/programs"
HOMEPAGE="http://www.ntp.org/"
SRC_URI="http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/${P}.tar.gz
	mirror://gentoo/${PF}-manpages.tbz2
	mirror://gentoo/${P}.tar.gz
	http://wh0rd.info/gentoo/distfiles/${P}.tar.gz"

LICENSE="as-is"
SLOT="0"
KEYWORDS="x86 ppc sparc mips alpha arm hppa amd64"
IUSE="parse-clocks selinux"

DEPEND=">=sys-libs/ncurses-5.2
	>=sys-libs/readline-4.1
	|| (
		dev-libs/elfutils
		dev-libs/libelf
	)"
RDEPEND="${DEPEND}
	selinux? ( sec-policy/selinux-ntp )
	>=sys-apps/sed-4.0.5"

src_unpack() {
	unpack ${A} ; cd ${S}
	epatch ${FILESDIR}/ntp-bk.diff
	epatch ${FILESDIR}/linux-config-phone.patch
	use alpha && epatch ${FILESDIR}/ntp-4.1.1b-syscall-libc.patch
	aclocal -I . || die
	automake || die
	autoconf || die
}

src_compile() {
	cp configure{,.orig}
	sed -i "s:-Wpointer-arith::" configure

	# http://www.gentoo.org/proj/en/hardened/etdyn-ssp.xml
	has_version 'sys-devel/hardened-gcc' && CFLAGS="-yet_exec ${CFLAGS}"

	econf \
		--build=${CHOST} \
		`use_enable parse-clocks` \
		|| die

	has_version 'sys-devel/hardened-gcc' && find ${W} -name "Makefile" -type f -exec sed -i "s,-yet_exec,," {} \;

	emake || die
}

src_install() {
	einstall || die

	dodoc ChangeLog INSTALL NEWS README TODO WHERE-TO-START
	doman ${WORKDIR}/man/*.1
	dohtml -r html/*

	insinto /usr/share/ntp
	doins ${FILESDIR}/ntp.conf
	rm -rf `find scripts/ \
		-name '*.in' -o \
		-name 'Makefile*' -o \
		-name 'rc[12]' -o \
		-name support`
	mv scripts/* ${D}/usr/share/ntp/

	exeinto /etc/init.d ; newexe ${FILESDIR}/ntpd-${PV}.rc ntpd
	insinto /etc/conf.d ; newins ${FILESDIR}/ntpd-${PV}.confd ntpd
}

pkg_postinst() {
	ewarn "You can find an example /etc/ntp.conf in /usr/share/ntp/"
	ewarn "Review /etc/ntp.conf to setup server info."
	ewarn "Review /etc/conf.d/ntpd to setup init.d info."
}