The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / ntp / ntp.mk
1 ################################################################################
2 #
3 # ntp
4 #
5 ################################################################################
6
7 NTP_VERSION_MAJOR = 4.2
8 NTP_VERSION = $(NTP_VERSION_MAJOR).8p2
9 NTP_SITE = http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-$(NTP_VERSION_MAJOR)
10 NTP_DEPENDENCIES = host-pkgconf libevent $(if $(BR2_PACKAGE_BUSYBOX),busybox)
11 NTP_LICENSE = ntp license
12 NTP_LICENSE_FILES = COPYRIGHT
13 NTP_CONF_ENV = ac_cv_lib_md5_MD5Init=no
14 NTP_CONF_OPTS = \
15         --with-shared \
16         --program-transform-name=s,,, \
17         --disable-tickadj \
18         --with-yielding-select=yes \
19         --disable-local-libevent
20
21 ifeq ($(BR2_PACKAGE_OPENSSL),y)
22 NTP_CONF_OPTS += --with-crypto
23 NTP_DEPENDENCIES += openssl
24 else
25 NTP_CONF_OPTS += --without-crypto --disable-openssl-random
26 endif
27
28 ifeq ($(BR2_PACKAGE_NTP_NTPSNMPD),y)
29 NTP_CONF_OPTS += \
30         --with-net-snmp-config=$(STAGING_DIR)/usr/bin/net-snmp-config
31 NTP_DEPENDENCIES += netsnmp
32 else
33 NTP_CONF_OPTS += --without-ntpsnmpd
34 endif
35
36 ifeq ($(BR2_PACKAGE_NTP_NTPD_ATOM_PPS),y)
37 NTP_CONF_OPTS += --enable-ATOM
38 NTP_DEPENDENCIES += pps-tools
39 else
40 NTP_CONF_OPTS += --disable-ATOM
41 endif
42
43 define NTP_PATCH_FIXUPS
44         $(SED) "s,^#if.*__GLIBC__.*_BSD_SOURCE.*$$,#if 0," $(@D)/ntpd/refclock_pcf.c
45         $(SED) '/[[:space:](]rindex[[:space:]]*(/s/[[:space:]]*rindex[[:space:]]*(/ strrchr(/g' $(@D)/ntpd/*.c
46 endef
47
48 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_KEYGEN) += util/ntp-keygen
49 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_WAIT) += scripts/ntp-wait/ntp-wait
50 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDATE) += ntpdate/ntpdate
51 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDC) += ntpdc/ntpdc
52 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPQ) += ntpq/ntpq
53 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPSNMPD) += ntpsnmpd/ntpsnmpd
54 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPTRACE) += scripts/ntptrace/ntptrace
55 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_SNTP) += sntp/sntp
56 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_TICKADJ) += util/tickadj
57
58 define NTP_INSTALL_TARGET_CMDS
59         $(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd)
60         test -z "$(NTP_INSTALL_FILES_y)" || install -m 755 $(addprefix $(@D)/,$(NTP_INSTALL_FILES_y)) $(TARGET_DIR)/usr/bin/
61         $(INSTALL) -m 644 package/ntp/ntpd.etc.conf $(TARGET_DIR)/etc/ntp.conf
62 endef
63
64 ifeq ($(BR2_PACKAGE_NTP_NTPD),y)
65 define NTP_INSTALL_INIT_SYSV
66         $(INSTALL) -D -m 755 package/ntp/S49ntp $(TARGET_DIR)/etc/init.d/S49ntp
67 endef
68
69 define NTP_INSTALL_INIT_SYSTEMD
70         $(INSTALL) -D -m 644 package/ntp/ntpd.service $(TARGET_DIR)/usr/lib/systemd/system/ntpd.service
71         mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
72         ln -fs ../../../../usr/lib/systemd/system/ntpd.service \
73                 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
74 endef
75 endif
76
77 NTP_POST_PATCH_HOOKS += NTP_PATCH_FIXUPS
78
79 $(eval $(autotools-package))