[oe] [meta-oe][meta-networking][PATCH 3/3] ntp: Clean up recipes
Otavio Salvador
otavio at ossystems.com.br
Sat Oct 20 11:49:25 UTC 2012
On Fri, Oct 19, 2012 at 5:38 PM, Morgan Little
<morgan.little at windriver.com> wrote:
> +++ b/meta-networking/recipes-support/ntp/ntp-ssl_4.2.6p5.bb
> @@ -1,11 +1,12 @@
> -require ntp_${PV}.bb
> +require ntp.inc
> DEPENDS = "openssl"
>
> -S = "${WORKDIR}/ntp-${PV}"
> +PR = "r0"
As you are using an .inc file, please use INC_PR.
> -EXTRA_OECONF = "--with-openssl-libdir=${STAGING_LIBDIR} \
> - --with-openssl-incdir=${STAGING_INCDIR}/openssl"
> +S = "${WORKDIR}/ntp-${PV}"
>
> +EXTRA_OECONF += "--with-openssl-libdir=${STAGING_LIBDIR} \
> + --with-openssl-incdir=${STAGING_INCDIR}/openssl \
> + --with-crypto"
>
> -SRC_URI[md5sum] = "00df80a84ec9528fcfb09498075525bc"
> -SRC_URI[sha256sum] = "d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c"
> +FILES_${PN} += "${bindir}/sntp ${bindir}/ntp-keygen"
> diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
> index 1d740f0..20b9060 100644
> --- a/meta-networking/recipes-support/ntp/ntp.inc
> +++ b/meta-networking/recipes-support/ntp/ntp.inc
> @@ -8,14 +8,17 @@ LICENSE = "ntp"
> LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670"
> RSUGGESTS_${PN} = "iana-etc"
>
> -SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
> - file://ipv6only-workaround.patch \
> +SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
> + file://tickadj.c.patch \
> + file://ntp-4.2.4_p6-nano.patch \
> file://ntpd \
> file://ntp.conf \
> file://ntpdate \
> - file://ntpd.service \
> "
Use INC_PR.
> +SRC_URI[md5sum] = "00df80a84ec9528fcfb09498075525bc"
> +SRC_URI[sha256sum] = "d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c"
> +
> inherit autotools update-rc.d
>
> INITSCRIPT_NAME = "ntpd"
> @@ -24,12 +27,46 @@ INITSCRIPT_PARAMS = "defaults"
>
> # The ac_cv_header_readline_history is to stop ntpdc depending on either
> # readline or curses
> -EXTRA_OECONF = "--without-openssl --without-crypto ac_cv_header_readline_history_h=no"
> +EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no"
> CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
>
> -PACKAGES += "ntpdate ${PN}-bin ${PN}-tickadj ${PN}-utils"
> +do_configure(){
> + oe_runconf
> +}
> +
> +do_install_append() {
> + install -d ${D}/${sysconfdir}/init.d
> + install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir}
> + install -m 755 ${WORKDIR}/ntpd ${D}/${sysconfdir}/init.d
> + install -d ${D}/${sysconfdir}/network/if-up.d
> + install -m 755 ${WORKDIR}/ntpdate ${D}/${sysconfdir}/network/if-up.d
> +}
> +
> +FILES_${PN}-bin = "${bindir}/ntp-wait ${bindir}/ntpdc ${bindir}/ntpq ${bindir}/ntptime ${bindir}/ntptrace"
> +FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${sbindir} ${libdir}"
> +FILES_${PN}-tickadj = "${bindir}/tickadj"
> +FILES_${PN}-utils = "${bindir}/*"
> +FILES_${PN}-date += "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate"
> +
> +# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
> +# with wonky clocks (e.g. OpenSlug)
> +RDEPENDS_${PN} = "${PN}-tickadj"
> +
> +PACKAGES += "${PN}-date ${PN}-bin ${PN}-tickadj ${PN}-utils"
> # NOTE: you don't need ntpdate, use "ntpd -q -g -x"
> # or the ntpdate systemd service
>
> # This should use rc.update
> FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/init.d/ntpdate"
> +
> +pkg_postinst_ntpdate() {
> +if test "x$D" != "x"; then
> + exit 1
> +else
> + if ! grep -q -s ntpdate /var/spool/cron/root; then
> + echo "adding crontab"
> + test -d /var/spool/cron || mkdir -p /var/spool/cron
> + echo "30 * * * * /usr/bin/ntpdate -b -s -u pool.ntp.org" >> /var/spool/cron/root
> + fi
> +fi
> +}
> 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 c542873..9c677c3 100644
> --- a/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb
> +++ b/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb
> @@ -2,46 +2,5 @@ require ntp.inc
>
> PR = "r0"
INC_PR please.
If this didn't use an .inc file, avoid putting PR for r0.
> -SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
> - file://tickadj.c.patch \
> - file://ntp-4.2.4_p6-nano.patch \
> - file://ntpd \
> - file://ntp.conf \
> - file://ntpdate \
> -"
> -
> -SRC_URI[md5sum] = "00df80a84ec9528fcfb09498075525bc"
> -SRC_URI[sha256sum] = "d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c"
> -
> -EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd"
> -
> -do_install_append() {
> - install -d ${D}/${sysconfdir}/init.d
> - install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir}
> - install -m 755 ${WORKDIR}/ntpd ${D}/${sysconfdir}/init.d
> - install -d ${D}/${sysconfdir}/network/if-up.d
> - install -m 755 ${WORKDIR}/ntpdate ${D}/${sysconfdir}/network/if-up.d
> -}
> -
> -FILES_${PN}-bin = "${bindir}/ntp-wait ${bindir}/ntpdc ${bindir}/ntpq ${bindir}/ntptime ${bindir}/ntptrace"
> -FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd"
> -FILES_${PN}-tickadj = "${bindir}/tickadj"
> -FILES_ntp-utils = "${bindir}/*"
> -FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate"
> -
> -# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
> -# with wonky clocks (e.g. OpenSlug)
> -RDEPENDS_${PN} = "${PN}-tickadj"
> -
> -pkg_postinst_ntpdate() {
> -if test "x$D" != "x"; then
> - exit 1
> -else
> - if ! grep -q -s ntpdate /var/spool/cron/root; then
> - echo "adding crontab"
> - test -d /var/spool/cron || mkdir -p /var/spool/cron
> - echo "30 * * * * /usr/bin/ntpdate -b -s -u pool.ntp.org" >> /var/spool/cron/root
> - fi
> -fi
> -}
> +EXTRA_OECONF += "--without-openssl --without-crypto"
>
> --
> 1.7.0.4
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
More information about the Openembedded-devel
mailing list