source: packages/net/ntpd/Makefile @ 19801

Last change on this file since 19801 was 19801, checked in by tripolar, 7 years ago

add new ntpd-openssl package to get a ntpd that is linked against openssl

  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
File size: 5.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.6
12PKG_RELEASE:=3
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:=4d64a99592b818aa9419fc9dcb149746
17
18PKG_BUILD_DEPENDS:=libelf
19PKG_FIXUP:=libtool
20PKG_LIBTOOL_PATHS:=. sntp
21
22include $(INCLUDE_DIR)/package.mk
23
24define Package/ntpd/Default
25  SUBMENU:=Time Synchronization
26  SECTION:=net
27  CATEGORY:=Network
28  TITLE:=ISC ntp
29  URL:=http://www.ntp.org/
30endef
31
32define Package/ntpd/Default/description
33        The ISC ntp suite is a collection of tools used to synchronize
34        the system clock with remote NTP time servers and run/montior
35        local NTP servers.
36endef
37
38define Package/ntpd
39  $(call Package/ntpd/Default)
40  TITLE+= server
41endef
42
43define Package/ntpd/description
44        $(call Package/ntpd/Default/description)
45        This package contains the ntpd server.
46endef
47
48define Package/ntpd-openssl
49  $(call Package/ntpd/Default)
50  TITLE+= server (with OpenSSL support)
51  DEPENDS:=+openssl
52endef
53
54define Package/ntpd-openssl/description
55        $(call Package/ntpd/Default/description)
56        This package contains the ntpd server with OpenSSL support.
57endef
58
59define Package/ntpdate
60  $(call Package/ntpd/Default)
61  TITLE+=date
62endef
63
64define Package/ntpdate/description
65        $(call Package/ntpd/Default/description)
66        This package contains ntpdate.
67endef
68
69define Package/ntp-utils
70  $(call Package/ntpd/Default)
71  DEPENDS:=+libncurses
72  TITLE+= utilities
73endef
74
75define Package/ntp-utils/description
76        $(call Package/ntpd/Default/description)
77        This package contains ntpdc and ntpq.
78endef
79
80define Package/ntpd/conffiles
81/etc/ntp.conf
82endef
83
84define Package/ntpd/Default/postinst
85#!/bin/sh
86grep -q '^ntp[[:space:]]*123/udp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
87[ $$? -ne 0 ] && echo "ntp            123/udp     # Network Time Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0
88grep -q '^ntp[[:space:]]*123/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
89[ $$? -ne 0 ] && echo "ntp            123/tcp     # Network Time Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0
90endef
91
92define Package/ntpdate/postinst
93  $(call Package/ntpd/Default/postinst)
94endef
95
96define Package/ntpd/postinst
97  $(call Package/ntpd/Default/postinst)
98endef
99
100define Package/ntp-utils/postinst
101  $(call Package/ntpd/Default/postinst)
102endef
103
104TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libelf
105
106CONFIGURE_VARS += \
107        ac_cv_header_md5_h=no \
108        ac_cv_lib_rt_sched_setscheduler=no \
109        ac_cv_header_dns_sd_h=no
110
111define Build/Template
112
113$(STAMP_BUILT)-$(2): $(STAMP_PREPARED)
114        -$(MAKE) -C $(PKG_BUILD_DIR) clean
115        $(call Build/Configure/Default, \
116                --disable-all-clocks \
117                --disable-parse-clocks \
118                --enable-NMEA \
119                --enable-LOCAL-CLOCK \
120                --enable-SHM \
121                --disable-linuxcaps \
122                $(3))
123        $(MAKE) -C $(PKG_BUILD_DIR) CFLAGS="$(TARGET_CFLAGS)"
124        ( cd $(PKG_BUILD_DIR); mv -f ntpd/ntpd $(PKG_NAME)-$(2) )
125        touch $$@
126
127$(STAMP_BUILT): $(STAMP_BUILT)-$(2)
128
129endef
130
131ifneq ($(SDK)$(CONFIG_PACKAGE_ntpd-openssl),)
132  define Build/with-openssl
133    $(call Build/Template,ntpd-openssl,with-openssl, \
134                --with-crypto \
135                --with-openssl-incdir="$(STAGING_DIR)/usr/include" \
136                --with-openssl-libdir="$(STAGING_DIR)/usr/lib" \
137    )
138  endef
139endif
140$(eval $(Build/with-openssl))
141
142ifneq ($(SDK)$(CONFIG_PACKAGE_ntpd),)
143  define Build/without-ssl
144    $(call Build/Template,ntpd,without-ssl)
145  endef
146endif
147
148ifneq ($(SDK)$(CONFIG_PACKAGE_ntpdate),)
149  define Build/without-ssl
150    $(call Build/Template,ntpd,without-ssl)
151  endef
152endif
153
154ifneq ($(SDK)$(CONFIG_PACKAGE_ntp-utils),)
155  define Build/without-ssl
156    $(call Build/Template,ntpd,without-ssl)
157  endef
158endif
159$(eval $(Build/without-ssl))
160
161define Package/ntpd/install
162        $(INSTALL_DIR) $(1)/usr/sbin/
163        $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME)-without-ssl $(1)/usr/sbin/$(PKG_NAME)
164        $(INSTALL_DIR) $(1)/etc
165        $(INSTALL_CONF) ./files/ntp.conf $(1)/etc/
166        $(INSTALL_DIR) $(1)/etc/init.d
167        $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd
168        $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
169        $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd
170endef
171
172define Package/ntpd-openssl/install
173        $(INSTALL_DIR) $(1)/usr/sbin/
174        $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME)-with-openssl $(1)/usr/sbin/$(PKG_NAME)
175        $(INSTALL_DIR) $(1)/etc
176        $(INSTALL_CONF) ./files/ntp.conf $(1)/etc/
177        $(INSTALL_DIR) $(1)/etc/init.d
178        $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd
179        $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
180        $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd
181endef
182
183define Package/ntpdate/install
184        $(INSTALL_DIR) $(1)/usr/sbin/
185        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdate/ntpdate $(1)/usr/sbin/
186        $(INSTALL_DIR) $(1)/etc/init.d
187        $(INSTALL_BIN) ./files/ntpdate.init $(1)/etc/init.d/ntpdate
188endef
189
190define Package/ntp-utils/install
191        $(INSTALL_DIR) $(1)/usr/sbin/
192        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdc/ntpdc $(1)/usr/sbin/
193        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
194endef
195
196$(eval $(call BuildPackage,ntpd-openssl))
197$(eval $(call BuildPackage,ntpd))
198$(eval $(call BuildPackage,ntpdate))
199$(eval $(call BuildPackage,ntp-utils))
Note: See TracBrowser for help on using the repository browser.