source: packages/net/ntpd/Makefile @ 10920

Last change on this file since 10920 was 10920, checked in by agb, 9 years ago

[packages] ntpd

-Split ntpdate off of ntpd's init-script, ntpd works properly without it
-Make ntpd start just after ntpdate (if both are installed)
-UCI config for ntpdate may be added, but ntpdate will be retired upstream in the future

  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1#
2# Copyright (C) 2006-2008 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7# $Id$
8
9include $(TOPDIR)/rules.mk
10
11PKG_NAME:=ntp
12PKG_VERSION:=4.2.4p4
13PKG_RELEASE:=4
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/
17PKG_MD5SUM:=fcb32a01e1ae3f9ed5bac86b12c7a1cc
18
19PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20PKG_BUILD_DEPENDS:=libelf
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/ntpdate
49  $(call Package/ntpd/Default)
50  TITLE+=date
51endef
52
53define Package/ntpdate/description
54        $(call Package/ntpd/Default/description)
55        This package contains ntpdate.
56endef
57
58define Package/ntp-utils
59  $(call Package/ntpd/Default)
60  DEPENDS:=+libreadline +libncurses
61  TITLE+= utilities
62endef
63
64define Package/ntp-utils/description
65        $(call Package/ntpd/Default/description)
66        This package contains ntpdc and ntpq.
67endef
68
69define Package/ntpd/conffiles
70/etc/ntp.conf
71endef
72
73define Package/ntpd/Default/postinst
74#!/bin/sh
75grep -q '^ntp[[:space:]]*123/udp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
76[ $$? -ne 0 ] && echo "ntp            123/udp     # Network Time Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0
77grep -q '^ntp[[:space:]]*123/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
78[ $$? -ne 0 ] && echo "ntp            123/tcp     # Network Time Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0
79endef
80
81define Package/ntpdate/postinst
82  $(call Package/ntpd/Default/postinst)
83endef
84
85define Package/ntpd/postinst
86  $(call Package/ntpd/Default/postinst)
87endef
88
89define Package/ntp-utils/postinst
90  $(call Package/ntpd/Default/postinst)
91endef
92
93TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libelf
94
95define Build/Configure
96        $(call Build/Configure/Default, \
97                --disable-all-clocks \
98                --disable-parse-clocks \
99                --enable-NMEA \
100                --enable-LOCAL-CLOCK \
101                --enable-SHM \
102                --enable-linuxcaps \
103        )
104endef
105
106define Build/Compile
107        $(MAKE) -C $(PKG_BUILD_DIR) \
108                CFLAGS="$(TARGET_CFLAGS)"
109endef
110
111define Package/ntpd/install
112        $(INSTALL_DIR) $(1)/usr/sbin/
113        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/usr/sbin/
114        $(INSTALL_DIR) $(1)/etc
115        $(INSTALL_DATA) ./files/ntp.conf $(1)/etc/
116        $(INSTALL_DIR) $(1)/etc/init.d
117        $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd
118        $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
119        $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd
120endef
121
122define Package/ntpdate/install
123        $(INSTALL_DIR) $(1)/usr/sbin/
124        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdate/ntpdate $(1)/usr/sbin/
125endef
126
127define Package/ntp-utils/install
128        $(INSTALL_DIR) $(1)/usr/sbin/
129        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdc/ntpdc $(1)/usr/sbin/
130        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
131endef
132
133$(eval $(call BuildPackage,ntpd))
134$(eval $(call BuildPackage,ntpdate))
135$(eval $(call BuildPackage,ntp-utils))
Note: See TracBrowser for help on using the repository browser.