diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-11-22 16:49:34 +0000 |
---|---|---|
committer | Joe MacDonald <joe.macdonald@windriver.com> | 2012-11-27 14:43:58 -0500 |
commit | 93f71dafeb7a8db2842acb7509e2bc2d01e7bf48 (patch) | |
tree | 700e9245ba9710a6ae0b4a3c796cd7017e281555 /meta-networking | |
parent | 11a6ce97f710fe6578a92edc5409b0aa315da79f (diff) | |
download | meta-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-x | meta-networking/recipes-support/ntp/files/ntp | 31 | ||||
-rw-r--r-- | meta-networking/recipes-support/ntp/files/openssl-check.patch | 59 | ||||
-rw-r--r-- | meta-networking/recipes-support/ntp/ntp-ssl_4.2.6p5.bb | 11 | ||||
-rw-r--r-- | meta-networking/recipes-support/ntp/ntp.inc | 87 | ||||
-rw-r--r-- | meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb | 44 |
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 | |||
3 | FLAGS="defaults 23" | ||
4 | |||
5 | test -f /usr/bin/ntpd || exit 0 | ||
6 | |||
7 | case "$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 | ;; | ||
29 | esac | ||
30 | |||
31 | exit 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 @@ | |||
1 | Hack OpenSSL check to work when libssl and libcrypto aren't in same dir | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-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 | |||
12 | diff --git a/configure b/configure | ||
13 | index 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 | ||
27 | diff --git a/m4/ntp_openssl.m4 b/m4/ntp_openssl.m4 | ||
28 | index 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 | ||
42 | diff --git a/sntp/configure b/sntp/configure | ||
43 | index 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 | -- | ||
58 | 1.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 @@ | |||
1 | require ntp_${PV}.bb | ||
2 | DEPENDS = "openssl" | ||
3 | |||
4 | S = "${WORKDIR}/ntp-${PV}" | ||
5 | |||
6 | EXTRA_OECONF = "--with-openssl-libdir=${STAGING_LIBDIR} \ | ||
7 | --with-openssl-incdir=${STAGING_INCDIR}/openssl" | ||
8 | |||
9 | |||
10 | SRC_URI[md5sum] = "98e16c7aa4ecd4c004b51bff18962e95" | ||
11 | SRC_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 @@ | |||
1 | SUMMARY = "Network Time Protocol daemon and utilities" | ||
1 | DESCRIPTION = "The Network Time Protocol (NTP) is used to \ | 2 | DESCRIPTION = "The Network Time Protocol (NTP) is used to \ |
2 | synchronize the time of a computer client or server to \ | 3 | synchronize the time of a computer client or server to \ |
3 | another server or reference time source, such as a radio \ | 4 | another server or reference time source, such as a radio \ |
4 | or satellite receiver or modem." | 5 | or satellite receiver or modem." |
5 | HOMEPAGE = "http://ntp.isc.org/bin/view/Main/WebHome" | 6 | HOMEPAGE = "http://support.ntp.org" |
6 | SECTION = "console/network" | 7 | SECTION = "console/network" |
7 | LICENSE = "ntp" | 8 | LICENSE = "ntp" |
8 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670" | 9 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670" |
9 | RSUGGESTS_${PN} = "iana-etc" | ||
10 | 10 | ||
11 | SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \ | 11 | INC_PR = "r2" |
12 | file://ipv6only-workaround.patch \ | ||
13 | file://ntpd \ | ||
14 | file://ntp.conf \ | ||
15 | file://ntpdate \ | ||
16 | file://ntpd.service \ | ||
17 | " | ||
18 | 12 | ||
19 | inherit autotools update-rc.d | 13 | SRC_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 | ||
21 | INITSCRIPT_NAME = "ntpd" | 22 | inherit autotools update-rc.d |
22 | # No dependencies, so just go in at the standard level (20) | ||
23 | INITSCRIPT_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 |
27 | EXTRA_OECONF = "--without-openssl --without-crypto ac_cv_header_readline_history_h=no" | 26 | EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no" |
28 | CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" | 27 | CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" |
29 | 28 | ||
30 | PACKAGES += "ntpdate ${PN}-bin ${PN}-tickadj ${PN}-utils" | 29 | PACKAGECONFIG ??= "" |
30 | PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ | ||
31 | --with-openssl-incdir=${STAGING_INCDIR} \ | ||
32 | --with-crypto, \ | ||
33 | --without-openssl --without-crypto, \ | ||
34 | openssl" | ||
35 | |||
36 | do_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 | |||
51 | PACKAGES += "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 |
35 | FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/init.d/ntpdate" | 55 | # with wonky clocks (e.g. OpenSlug) |
56 | RDEPENDS_${PN} = "${PN}-tickadj" | ||
57 | # Handle move from bin to utils package | ||
58 | RPROVIDES_${PN}-utils = "${PN}-bin" | ||
59 | RREPLACES_${PN}-utils = "${PN}-bin" | ||
60 | RCONFLICTS_${PN}-utils = "${PN}-bin" | ||
61 | |||
62 | RSUGGESTS_${PN} = "iana-etc" | ||
63 | |||
64 | FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${sbindir} ${libdir}" | ||
65 | FILES_${PN}-tickadj = "${bindir}/tickadj" | ||
66 | FILES_${PN}-utils = "${bindir}" | ||
67 | FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate" | ||
68 | |||
69 | CONFFILES_${PN} = "${sysconfdir}/ntp.conf" | ||
70 | |||
71 | INITSCRIPT_NAME = "ntpd" | ||
72 | # No dependencies, so just go in at the standard level (20) | ||
73 | INITSCRIPT_PARAMS = "defaults" | ||
74 | |||
75 | pkg_postinst_ntpdate() { | ||
76 | if test "x$D" != "x"; then | ||
77 | exit 1 | ||
78 | else | ||
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 | ||
84 | fi | ||
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 @@ | |||
1 | require ntp.inc | 1 | require ntp.inc |
2 | 2 | ||
3 | SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \ | 3 | PR = "${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 | ||
11 | SRC_URI[md5sum] = "59876a9009b098ff59767ee45a88ebd2" | 5 | SRC_URI[md5sum] = "00df80a84ec9528fcfb09498075525bc" |
12 | SRC_URI[sha256sum] = "6e84d4ddfa14b911c3ed88463af10867e1fa9b287e7b34d8a02e78be85a7c40e" | 6 | SRC_URI[sha256sum] = "d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c" |
13 | |||
14 | EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd" | ||
15 | |||
16 | do_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 | |||
24 | FILES_${PN}-bin = "${bindir}/ntp-wait ${bindir}/ntpdc ${bindir}/ntpq ${bindir}/ntptime ${bindir}/ntptrace" | ||
25 | FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd" | ||
26 | FILES_${PN}-tickadj = "${bindir}/tickadj" | ||
27 | FILES_ntp-utils = "${bindir}/*" | ||
28 | FILES_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) | ||
32 | RDEPENDS_${PN} = "${PN}-tickadj" | ||
33 | |||
34 | pkg_postinst_ntpdate() { | ||
35 | if test "x$D" != "x"; then | ||
36 | exit 1 | ||
37 | else | ||
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 | ||
43 | fi | ||
44 | } | ||
45 | 7 | ||