summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-11-22 16:49:34 +0000
committerJoe MacDonald <joe.macdonald@windriver.com>2012-11-27 14:43:58 -0500
commit93f71dafeb7a8db2842acb7509e2bc2d01e7bf48 (patch)
tree700e9245ba9710a6ae0b4a3c796cd7017e281555 /meta-networking
parent11a6ce97f710fe6578a92edc5409b0aa315da79f (diff)
downloadmeta-openembedded-93f71dafeb7a8db2842acb7509e2bc2d01e7bf48.tar.gz
ntp: cleanup recipes and fix SSL support
* Move common definitions to the inc file * Drop override of do_configure which doesn't seem to be needed anymore * Fold ntp-ssl into the ntp recipe as a PACKAGECONFIG option for those who want it (default to off) and fix configure-time checks to detect OpenSSL properly so that it gets enabled when selected * Remove ntp-bin package and put its contents in currently empty ntp-utils package (with migration path) * Fix hardcoded paths in ntpd initscript * Specify ntpd.conf as a configuration file for packaging purposes * Rearrange so that packaging definitions are towards the end in the expected order * Delete unused "ntp" initscript file * Add SUMMARY * Update HOMEPAGE This reapplies some of the changes from the original patch by Morgan Little <morgan.little@windriver.com>. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta-networking')
-rwxr-xr-xmeta-networking/recipes-support/ntp/files/ntp31
-rw-r--r--meta-networking/recipes-support/ntp/files/openssl-check.patch59
-rw-r--r--meta-networking/recipes-support/ntp/ntp-ssl_4.2.6p5.bb11
-rw-r--r--meta-networking/recipes-support/ntp/ntp.inc87
-rw-r--r--meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb44
5 files changed, 131 insertions, 101 deletions
diff --git a/meta-networking/recipes-support/ntp/files/ntp b/meta-networking/recipes-support/ntp/files/ntp
deleted file mode 100755
index e91a52869..000000000
--- a/meta-networking/recipes-support/ntp/files/ntp
+++ /dev/null
@@ -1,31 +0,0 @@
1#! /bin/sh
2
3FLAGS="defaults 23"
4
5test -f /usr/bin/ntpd || exit 0
6
7case "$1" in
8 start)
9 echo -n "Starting NTP server: ntpd"
10 start-stop-daemon --start --quiet --exec /usr/bin/ntpd
11 echo "."
12 ;;
13 stop)
14 echo -n "Stopping NTP server: ntpd"
15 start-stop-daemon --stop --quiet --exec /usr/bin/ntpd
16 echo "."
17 ;;
18 restart|force-reload)
19 echo -n "Restarting NTP server: ntpd... "
20 start-stop-daemon --stop --quiet --exec /usr/bin/ntpd
21 sleep 2
22 start-stop-daemon --start --quiet --exec /usr/bin/ntpd
23 echo "done."
24 ;;
25 *)
26 echo "Usage: /etc/init.d/ntp {start|stop|restart|force-reload}"
27 exit 1
28 ;;
29esac
30
31exit 0
diff --git a/meta-networking/recipes-support/ntp/files/openssl-check.patch b/meta-networking/recipes-support/ntp/files/openssl-check.patch
new file mode 100644
index 000000000..8b4a6733c
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/files/openssl-check.patch
@@ -0,0 +1,59 @@
1Hack OpenSSL check to work when libssl and libcrypto aren't in same dir
2
3Upstream-Status: Inappropriate [config]
4
5Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
6---
7 configure | 4 ++--
8 m4/ntp_openssl.m4 | 4 ++--
9 sntp/configure | 4 ++--
10 3 files changed, 6 insertions(+), 6 deletions(-)
11
12diff --git a/configure b/configure
13index aae2c01..6a3c15e 100755
14--- a/configure
15+++ b/configure
16@@ -22868,8 +22868,8 @@ case "$ans" in
17 test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
18 ;;
19 *)
20- test -f $i/libcrypto.so -a -f $i/libssl.so && break
21- test -f $i/libcrypto.a -a -f $i/libssl.a && break
22+ test -f $i/libssl.so && break
23+ test -f $i/libssl.a && break
24 ;;
25 esac
26 done
27diff --git a/m4/ntp_openssl.m4 b/m4/ntp_openssl.m4
28index 7d9f477..67bdd55 100644
29--- a/m4/ntp_openssl.m4
30+++ b/m4/ntp_openssl.m4
31@@ -41,8 +41,8 @@ case "$ans" in
32 test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
33 ;;
34 *)
35- test -f $i/libcrypto.so -a -f $i/libssl.so && break
36- test -f $i/libcrypto.a -a -f $i/libssl.a && break
37+ test -f $i/libssl.so && break
38+ test -f $i/libssl.a && break
39 ;;
40 esac
41 done
42diff --git a/sntp/configure b/sntp/configure
43index 7782c29..55e82d9 100755
44--- a/sntp/configure
45+++ b/sntp/configure
46@@ -14810,8 +14810,8 @@ case "$ans" in
47 test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
48 ;;
49 *)
50- test -f $i/libcrypto.so -a -f $i/libssl.so && break
51- test -f $i/libcrypto.a -a -f $i/libssl.a && break
52+ test -f $i/libssl.so && break
53+ test -f $i/libssl.a && break
54 ;;
55 esac
56 done
57--
581.7.1
59
diff --git a/meta-networking/recipes-support/ntp/ntp-ssl_4.2.6p5.bb b/meta-networking/recipes-support/ntp/ntp-ssl_4.2.6p5.bb
deleted file mode 100644
index a15899079..000000000
--- a/meta-networking/recipes-support/ntp/ntp-ssl_4.2.6p5.bb
+++ /dev/null
@@ -1,11 +0,0 @@
1require ntp_${PV}.bb
2DEPENDS = "openssl"
3
4S = "${WORKDIR}/ntp-${PV}"
5
6EXTRA_OECONF = "--with-openssl-libdir=${STAGING_LIBDIR} \
7 --with-openssl-incdir=${STAGING_INCDIR}/openssl"
8
9
10SRC_URI[md5sum] = "98e16c7aa4ecd4c004b51bff18962e95"
11SRC_URI[sha256sum] = "9f4a5271a285d390c9225e3ea28f70049ea377d30fc6de4659007cfff278671a"
diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
index 1d740f00f..a614e3f06 100644
--- a/meta-networking/recipes-support/ntp/ntp.inc
+++ b/meta-networking/recipes-support/ntp/ntp.inc
@@ -1,35 +1,86 @@
1SUMMARY = "Network Time Protocol daemon and utilities"
1DESCRIPTION = "The Network Time Protocol (NTP) is used to \ 2DESCRIPTION = "The Network Time Protocol (NTP) is used to \
2synchronize the time of a computer client or server to \ 3synchronize the time of a computer client or server to \
3another server or reference time source, such as a radio \ 4another server or reference time source, such as a radio \
4or satellite receiver or modem." 5or satellite receiver or modem."
5HOMEPAGE = "http://ntp.isc.org/bin/view/Main/WebHome" 6HOMEPAGE = "http://support.ntp.org"
6SECTION = "console/network" 7SECTION = "console/network"
7LICENSE = "ntp" 8LICENSE = "ntp"
8LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670" 9LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670"
9RSUGGESTS_${PN} = "iana-etc"
10 10
11SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \ 11INC_PR = "r2"
12 file://ipv6only-workaround.patch \
13 file://ntpd \
14 file://ntp.conf \
15 file://ntpdate \
16 file://ntpd.service \
17"
18 12
19inherit autotools update-rc.d 13SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
14 file://tickadj.c.patch \
15 file://ntp-4.2.4_p6-nano.patch \
16 file://openssl-check.patch \
17 file://ntpd \
18 file://ntp.conf \
19 file://ntpdate \
20 "
20 21
21INITSCRIPT_NAME = "ntpd" 22inherit autotools update-rc.d
22# No dependencies, so just go in at the standard level (20)
23INITSCRIPT_PARAMS = "defaults"
24 23
25# The ac_cv_header_readline_history is to stop ntpdc depending on either 24# The ac_cv_header_readline_history is to stop ntpdc depending on either
26# readline or curses 25# readline or curses
27EXTRA_OECONF = "--without-openssl --without-crypto ac_cv_header_readline_history_h=no" 26EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no"
28CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" 27CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
29 28
30PACKAGES += "ntpdate ${PN}-bin ${PN}-tickadj ${PN}-utils" 29PACKAGECONFIG ??= ""
30PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
31 --with-openssl-incdir=${STAGING_INCDIR} \
32 --with-crypto, \
33 --without-openssl --without-crypto, \
34 openssl"
35
36do_install_append() {
37 install -d ${D}${sysconfdir}/init.d
38 install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir}
39 install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d
40
41 # Fix hardcoded paths in scripts
42 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd
43 sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd
44 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd
45 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd
46
47 install -d ${D}${sysconfdir}/network/if-up.d
48 install -m 755 ${WORKDIR}/ntpdate ${D}${sysconfdir}/network/if-up.d
49}
50
51PACKAGES += "ntpdate ${PN}-tickadj ${PN}-utils"
31# NOTE: you don't need ntpdate, use "ntpd -q -g -x" 52# NOTE: you don't need ntpdate, use "ntpd -q -g -x"
32# or the ntpdate systemd service
33 53
34# This should use rc.update 54# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
35FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/init.d/ntpdate" 55# with wonky clocks (e.g. OpenSlug)
56RDEPENDS_${PN} = "${PN}-tickadj"
57# Handle move from bin to utils package
58RPROVIDES_${PN}-utils = "${PN}-bin"
59RREPLACES_${PN}-utils = "${PN}-bin"
60RCONFLICTS_${PN}-utils = "${PN}-bin"
61
62RSUGGESTS_${PN} = "iana-etc"
63
64FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${sbindir} ${libdir}"
65FILES_${PN}-tickadj = "${bindir}/tickadj"
66FILES_${PN}-utils = "${bindir}"
67FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate"
68
69CONFFILES_${PN} = "${sysconfdir}/ntp.conf"
70
71INITSCRIPT_NAME = "ntpd"
72# No dependencies, so just go in at the standard level (20)
73INITSCRIPT_PARAMS = "defaults"
74
75pkg_postinst_ntpdate() {
76if test "x$D" != "x"; then
77 exit 1
78else
79 if ! grep -q -s ntpdate /var/spool/cron/root; then
80 echo "adding crontab"
81 test -d /var/spool/cron || mkdir -p /var/spool/cron
82 echo "30 * * * * /usr/bin/ntpdate -b -s -u pool.ntp.org" >> /var/spool/cron/root
83 fi
84fi
85}
86
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb b/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb
index f7c5b6885..f1e9ecd7a 100644
--- a/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb
+++ b/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb
@@ -1,45 +1,7 @@
1require ntp.inc 1require ntp.inc
2 2
3SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \ 3PR = "${INC_PR}.0"
4 file://tickadj.c.patch \
5 file://ntp-4.2.4_p6-nano.patch \
6 file://ntpd \
7 file://ntp.conf \
8 file://ntpdate \
9"
10 4
11SRC_URI[md5sum] = "59876a9009b098ff59767ee45a88ebd2" 5SRC_URI[md5sum] = "00df80a84ec9528fcfb09498075525bc"
12SRC_URI[sha256sum] = "6e84d4ddfa14b911c3ed88463af10867e1fa9b287e7b34d8a02e78be85a7c40e" 6SRC_URI[sha256sum] = "d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c"
13
14EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd"
15
16do_install_append() {
17 install -d ${D}/${sysconfdir}/init.d
18 install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir}
19 install -m 755 ${WORKDIR}/ntpd ${D}/${sysconfdir}/init.d
20 install -d ${D}/${sysconfdir}/network/if-up.d
21 install -m 755 ${WORKDIR}/ntpdate ${D}/${sysconfdir}/network/if-up.d
22}
23
24FILES_${PN}-bin = "${bindir}/ntp-wait ${bindir}/ntpdc ${bindir}/ntpq ${bindir}/ntptime ${bindir}/ntptrace"
25FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd"
26FILES_${PN}-tickadj = "${bindir}/tickadj"
27FILES_ntp-utils = "${bindir}/*"
28FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate"
29
30# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
31# with wonky clocks (e.g. OpenSlug)
32RDEPENDS_${PN} = "${PN}-tickadj"
33
34pkg_postinst_ntpdate() {
35if test "x$D" != "x"; then
36 exit 1
37else
38 if ! grep -q -s ntpdate /var/spool/cron/root; then
39 echo "adding crontab"
40 test -d /var/spool/cron || mkdir -p /var/spool/cron
41 echo "30 * * * * /usr/bin/ntpdate -b -s -u pool.ntp.org" >> /var/spool/cron/root
42 fi
43fi
44}
45 7