]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/ntp/ntp.mk
ntp: drop uselss patch fixup which sometimes breaks rebuild
[coffee/buildroot.git] / package / ntp / ntp.mk
1 ################################################################################
2 #
3 # ntp
4 #
5 ################################################################################
6
7 NTP_VERSION_MAJOR = 4.2
8 NTP_VERSION = $(NTP_VERSION_MAJOR).8p3
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 endef
46
47 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_KEYGEN) += util/ntp-keygen
48 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_WAIT) += scripts/ntp-wait/ntp-wait
49 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDATE) += ntpdate/ntpdate
50 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDC) += ntpdc/ntpdc
51 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPQ) += ntpq/ntpq
52 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPSNMPD) += ntpsnmpd/ntpsnmpd
53 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPTRACE) += scripts/ntptrace/ntptrace
54 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_SNTP) += sntp/sntp
55 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_TICKADJ) += util/tickadj
56
57 define NTP_INSTALL_TARGET_CMDS
58         $(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd)
59         test -z "$(NTP_INSTALL_FILES_y)" || install -m 755 $(addprefix $(@D)/,$(NTP_INSTALL_FILES_y)) $(TARGET_DIR)/usr/bin/
60         $(INSTALL) -m 644 package/ntp/ntpd.etc.conf $(TARGET_DIR)/etc/ntp.conf
61 endef
62
63 ifeq ($(BR2_PACKAGE_NTP_NTPD),y)
64 define NTP_INSTALL_INIT_SYSV
65         $(INSTALL) -D -m 755 package/ntp/S49ntp $(TARGET_DIR)/etc/init.d/S49ntp
66 endef
67
68 define NTP_INSTALL_INIT_SYSTEMD
69         $(INSTALL) -D -m 644 package/ntp/ntpd.service $(TARGET_DIR)/usr/lib/systemd/system/ntpd.service
70         mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
71         ln -fs ../../../../usr/lib/systemd/system/ntpd.service \
72                 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
73 endef
74 endif
75
76 NTP_POST_PATCH_HOOKS += NTP_PATCH_FIXUPS
77
78 $(eval $(autotools-package))