source: packages/net/ntpd/Makefile @ 22159

Last change on this file since 22159 was 22159, checked in by nico, 6 years ago

[packages] ntpd: update to 4.2.6p2, add missing conffiles & postinst for ntpd-ssl, reformat

  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
File size: 4.1 KB
Line 
1#
2# Copyright (C) 2006-2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=ntp
11PKG_VERSION:=4.2.6p2
12PKG_RELEASE:=1
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
16PKG_MD5SUM:=cf73cd85f248232c62f8029e6eb05938
17
18PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19
20PKG_BUILD_DEPENDS:=libelf
21PKG_FIXUP:=libtool
22PKG_LIBTOOL_PATHS:=. sntp
23
24include $(INCLUDE_DIR)/package.mk
25
26define Package/ntpd/Default
27  SUBMENU:=Time Synchronization
28  SECTION:=net
29  CATEGORY:=Network
30  TITLE:=ISC ntp
31  URL:=http://www.ntp.org/
32endef
33
34define Package/ntpd/Default/description
35 The ISC ntp suite is a collection of tools used to synchronize the
36 system clock with remote NTP time servers and run/montior local NTP
37 servers.
38endef
39
40define Package/ntpd
41$(call Package/ntpd/Default)
42  TITLE+= server
43  VARIANT:=nossl
44endef
45
46define Package/ntpd/description
47$(call Package/ntpd/Default/description)
48 .
49 This package contains the ntpd server.
50endef
51
52define Package/ntpd-ssl
53$(call Package/ntpd/Default)
54  TITLE+= server (with OpenSSL support)
55  VARIANT:=ssl
56  DEPENDS:=+libopenssl
57endef
58
59define Package/ntpd-ssl/description
60$(call Package/ntpd/Default/description)
61 .
62 This package contains the ntpd server with OpenSSL support.
63endef
64
65define Package/ntpdate
66$(call Package/ntpd/Default)
67  TITLE+=date
68  VARIANT:=nossl
69endef
70
71define Package/ntpdate/description
72$(call Package/ntpd/Default/description)
73 .
74 This package contains ntpdate.
75endef
76
77define Package/ntp-utils
78$(call Package/ntpd/Default)
79  TITLE+= utilities
80  VARIANT:=nossl
81  DEPENDS:=+libncurses
82endef
83
84define Package/ntp-utils/description
85$(call Package/ntpd/Default/description)
86 .
87 This package contains ntpdc and ntpq.
88endef
89
90define Package/ntpd/conffiles
91/etc/ntp.conf
92endef
93
94define Package/ntpd/Default/postinst
95#!/bin/sh
96grep -q '^ntp[[:space:]]*123/udp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
97[ $$? -ne 0 ] && echo "ntp            123/udp     # Network Time Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0
98grep -q '^ntp[[:space:]]*123/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
99[ $$? -ne 0 ] && echo "ntp            123/tcp     # Network Time Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0
100endef
101
102define Package/ntpdate/postinst
103$(call Package/ntpd/Default/postinst)
104endef
105
106define Package/ntpd/postinst
107$(call Package/ntpd/Default/postinst)
108endef
109
110define Package/ntp-utils/postinst
111$(call Package/ntpd/Default/postinst)
112endef
113
114TARGET_CPPFLAGS += \
115        -I$(STAGING_DIR)/usr/include/libelf
116
117CONFIGURE_VARS += \
118        ac_cv_header_md5_h=no \
119        ac_cv_lib_rt_sched_setscheduler=no \
120        ac_cv_header_dns_sd_h=no
121
122CONFIGURE_ARGS += \
123        --disable-all-clocks \
124        --disable-parse-clocks \
125        --enable-NMEA \
126        --enable-LOCAL-CLOCK \
127        --enable-SHM \
128        --disable-linuxcaps \
129        --without-ntpsnmpd \
130
131ifeq ($(BUILD_VARIANT),ssl)
132  CONFIGURE_ARGS += \
133        --with-crypto \
134        --with-openssl-incdir="$(STAGING_DIR)/usr/include" \
135        --with-openssl-libdir="$(STAGING_DIR)/usr/lib"
136endif
137
138define Package/ntpd/install
139        $(INSTALL_DIR) $(1)/usr/sbin
140        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/usr/sbin/
141        $(INSTALL_DIR) $(1)/etc
142        $(INSTALL_CONF) ./files/ntp.conf $(1)/etc/
143        $(INSTALL_DIR) $(1)/etc/init.d
144        $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd
145        $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
146        $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd
147endef
148
149Package/ntpd-ssl/conffiles = $(Package/ntpd/conffiles)
150Package/ntpd-ssl/install = $(Package/ntpd/install)
151Package/ntpd-ssl/postinst = $(Package/ntpd/postinst)
152
153define Package/ntpdate/install
154        $(INSTALL_DIR) $(1)/usr/sbin
155        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdate/ntpdate $(1)/usr/sbin/
156        $(INSTALL_DIR) $(1)/etc/init.d
157        $(INSTALL_BIN) ./files/ntpdate.init $(1)/etc/init.d/ntpdate
158endef
159
160define Package/ntp-utils/install
161        $(INSTALL_DIR) $(1)/usr/sbin
162        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdc/ntpdc $(1)/usr/sbin/
163        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
164endef
165
166$(eval $(call BuildPackage,ntpd))
167$(eval $(call BuildPackage,ntpd-ssl))
168$(eval $(call BuildPackage,ntpdate))
169$(eval $(call BuildPackage,ntp-utils))
Note: See TracBrowser for help on using the repository browser.