From 5f124de0e566984f3955a503f50204c3ed6e661a Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 23 Feb 2009 12:44:04 +0100 Subject: [PATCH] convert to Makefile.autotools.in --- package/openntpd/openntpd-4.4-01-susv3-legacy.diff | 113 ++++++++++++++++++++ package/openntpd/openntpd.mk | 117 ++++++++------------- 2 files changed, 156 insertions(+), 74 deletions(-) create mode 100644 package/openntpd/openntpd-4.4-01-susv3-legacy.diff rewrite package/openntpd/openntpd.mk (75%) diff --git a/package/openntpd/openntpd-4.4-01-susv3-legacy.diff b/package/openntpd/openntpd-4.4-01-susv3-legacy.diff new file mode 100644 index 0000000..b9920a0 --- /dev/null +++ b/package/openntpd/openntpd-4.4-01-susv3-legacy.diff @@ -0,0 +1,113 @@ +diff -rdup openntpd-4.4.orig/buffer.c openntpd-4.4/buffer.c +--- openntpd-4.4.orig/buffer.c 2005-08-11 18:26:29.000000000 +0200 ++++ openntpd-4.4/buffer.c 2009-02-23 12:29:57.000000000 +0100 +@@ -97,7 +97,7 @@ msgbuf_write(struct msgbuf *msgbuf) + int i = 0; + ssize_t n; + +- bzero(&iov, sizeof(iov)); ++ memset(&iov, 0, sizeof(iov)); + TAILQ_FOREACH(buf, &msgbuf->bufs, entry) { + if (i >= IOV_MAX) + break; +diff -rdup openntpd-4.4.orig/config.c openntpd-4.4/config.c +--- openntpd-4.4.orig/config.c 2006-05-27 19:01:07.000000000 +0200 ++++ openntpd-4.4/config.c 2009-02-23 12:30:24.000000000 +0100 +@@ -68,7 +68,7 @@ host_v4(const char *s) + struct sockaddr_in *sa_in; + struct ntp_addr *h; + +- bzero(&ina, sizeof(struct in_addr)); ++ memset(&ina, 0, sizeof(struct in_addr)); + if (inet_pton(AF_INET, s, &ina) != 1) + return (NULL); + +@@ -89,7 +89,7 @@ host_v6(const char *s) + struct sockaddr_in6 *sa_in6; + struct ntp_addr *h = NULL; + +- bzero(&hints, sizeof(hints)); ++ memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET6; + hints.ai_socktype = SOCK_DGRAM; /*dummy*/ + hints.ai_flags = AI_NUMERICHOST; +@@ -120,7 +120,7 @@ host_dns(const char *s, struct ntp_addr + struct sockaddr_in6 *sa_in6; + struct ntp_addr *h, *hh = NULL; + +- bzero(&hints, sizeof(hints)); ++ memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; /* DUMMY */ + error = getaddrinfo(s, NULL, &hints, &res0); +diff -rdup openntpd-4.4.orig/imsg.c openntpd-4.4/imsg.c +--- openntpd-4.4.orig/imsg.c 2007-03-19 11:03:25.000000000 +0100 ++++ openntpd-4.4/imsg.c 2009-02-23 12:30:34.000000000 +0100 +@@ -29,7 +29,7 @@ void + imsg_init(struct imsgbuf *ibuf, int fd) + { + msgbuf_init(&ibuf->w); +- bzero(&ibuf->r, sizeof(ibuf->r)); ++ memset(&ibuf->r, 0, sizeof(ibuf->r)); + ibuf->fd = fd; + ibuf->w.fd = fd; + ibuf->pid = getpid(); +diff -rdup openntpd-4.4.orig/ntp.c openntpd-4.4/ntp.c +--- openntpd-4.4.orig/ntp.c 2009-01-16 15:03:38.000000000 +0100 ++++ openntpd-4.4/ntp.c 2009-02-23 12:30:55.000000000 +0100 +@@ -150,7 +150,7 @@ ntp_main(int pipe_prnt[2], struct ntpd_c + TAILQ_FOREACH(p, &conf->ntp_peers, entry) + client_peer_init(p); + +- bzero(&conf->status, sizeof(conf->status)); ++ memset(&conf->status, 0, sizeof(conf->status)); + + conf->freq.num = 0; + conf->freq.samples = 0; +@@ -205,8 +205,8 @@ ntp_main(int pipe_prnt[2], struct ntpd_c + pfd_elms = new_cnt; + } + +- bzero(pfd, sizeof(struct pollfd) * pfd_elms); +- bzero(idx2peer, sizeof(void *) * idx2peer_elms); ++ memset(pfd, 0, sizeof(struct pollfd) * pfd_elms); ++ memset(idx2peer, 0, sizeof(void *) * idx2peer_elms); + nextaction = getmonotime() + 3600; + pfd[PFD_PIPE_MAIN].fd = ibuf_main->fd; + pfd[PFD_PIPE_MAIN].events = POLLIN; +diff -rdup openntpd-4.4.orig/ntpd.c openntpd-4.4/ntpd.c +--- openntpd-4.4.orig/ntpd.c 2009-01-16 15:03:38.000000000 +0100 ++++ openntpd-4.4/ntpd.c 2009-02-23 12:31:05.000000000 +0100 +@@ -94,7 +94,7 @@ main(int argc, char *argv[]) + + conffile = CONFFILE; + +- bzero(&lconf, sizeof(lconf)); ++ memset(&lconf, 0, sizeof(lconf)); + + log_init(1); /* log to stderr until daemonized */ + res_init(); /* XXX */ +diff -rdup openntpd-4.4.orig/parse.y openntpd-4.4/parse.y +--- openntpd-4.4.orig/parse.y 2009-01-16 15:03:38.000000000 +0100 ++++ openntpd-4.4/parse.y 2009-02-23 12:31:19.000000000 +0100 +@@ -286,7 +286,7 @@ weight : WEIGHT NUMBER { + void + opts_default(void) + { +- bzero(&opts, sizeof opts); ++ memset(&opts, 0, sizeof opts); + opts.weight = 1; + } + +diff -rdup openntpd-4.4.orig/server.c openntpd-4.4/server.c +--- openntpd-4.4.orig/server.c 2009-01-16 15:03:38.000000000 +0100 ++++ openntpd-4.4/server.c 2009-02-23 12:31:28.000000000 +0100 +@@ -143,7 +143,7 @@ server_dispatch(int fd, struct ntpd_conf + + version = (query.status & VERSIONMASK) >> 3; + +- bzero(&reply, sizeof(reply)); ++ memset(&reply, 0, sizeof(reply)); + if (lconf->status.synced) + reply.status = lconf->status.leap; + else diff --git a/package/openntpd/openntpd.mk b/package/openntpd/openntpd.mk dissimilarity index 75% index 9b120cf..44db61f 100644 --- a/package/openntpd/openntpd.mk +++ b/package/openntpd/openntpd.mk @@ -1,74 +1,43 @@ -############################################################# -# -# OpenNTPD -# -############################################################# -OPENNTPD_VERSION:=4.0 -OPENNTPD_SOURCE:=openntpd-$(OPENNTPD_VERSION).tgz -OPENNTPD_SITE:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD -OPENNTPD_DIR:=$(BUILD_DIR)/openntpd-$(OPENNTPD_VERSION) -OPENNTPD_CAT:=$(ZCAT) -OPENNTPD_BINARY:=ntpd -OPENNTPD_TARGET_BINARY:=usr/sbin/ntpd - -$(DL_DIR)/$(OPENNTPD_SOURCE): - $(WGET) -P $(DL_DIR) $(OPENNTPD_SITE)/$(OPENNTPD_SOURCE) - -$(OPENNTPD_DIR)/.unpacked: $(DL_DIR)/$(OPENNTPD_SOURCE) - $(ZCAT) $(DL_DIR)/$(OPENNTPD_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - #mv $(BUILD_DIR)/ntpd $(OPENNTPD_DIR) - touch $@ - -$(OPENNTPD_DIR)/.configured: $(OPENNTPD_DIR)/.unpacked - (cd $(OPENNTPD_DIR); rm -f config.cache; \ - $(AUTO_CONFIGURE_TARGET) \ - --prefix=/usr \ - --sysconfdir=/etc \ - --with-builtin-arc4random \ - ) - touch $@ - -$(OPENNTPD_DIR)/$(OPENNTPD_BINARY): $(OPENNTPD_DIR)/.configured - $(MAKE) -C $(OPENNTPD_DIR) - #(cd $(OPENNTPD_DIR); \ - # $(YACC) parse.y; \ - # $(TARGET_CC) $(TARGET_CFLAGS) $(CFLAGS_COMBINE) \ - # $(CFLAGS_WHOLE_PROGRAM) -I$(OPENNTPD_DIR) \ - # -D__dead="__attribute((__noreturn__))" -DHAVE_INTXX_T=1 \ - # -include defines.h \ - # -o $@ \ - # ntpd.c buffer.c log.c imsg.c ntp.c ntp_msg.c y.tab.c config.c \ - # server.c client.c sensors.c util.c; \ - #) - touch -c $@ - -$(TARGET_DIR)/$(OPENNTPD_TARGET_BINARY): $(OPENNTPD_DIR)/$(OPENNTPD_BINARY) - rm -f $(TARGET_DIR)/etc/ntpd.conf - $(MAKE) DESTDIR=$(TARGET_DIR) STRIP_OPT="" -C $(OPENNTPD_DIR) install - $(INSTALL) -D -m 0644 $(OPENNTPD_DIR)/ntpd.conf $(TARGET_DIR)/etc/ntpd.conf -ifneq ($(BR2_HAVE_MANPAGES),y) - rm -rf $(TARGET_DIR)/usr/share/man -endif - $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/$(OPENNTPD_TARGET_BINARY) - -ntpd: $(TARGET_DIR)/$(OPENNTPD_TARGET_BINARY) - -ntpd-source: $(DL_DIR)/$(OPENNTPD_SOURCE) - -ntpd-clean: - -$(MAKE) -C $(OPENNTPD_DIR) clean - rm -f $(TARGET_DIR)/etc/ntpd.conf \ - $(wildcard $(TARGET_DIR)/usr/share/man*/ntpd*) \ - $(OPENNTPD_TARGET_BINARY) - -ntpd-dirclean: - rm -rf $(OPENNTPD_DIR) - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_PACKAGE_OPENNTPD),y) -TARGETS+=ntpd -endif +############################################################# +# +# OpenNTPD +# +############################################################# +OPENNTPD_VERSION:=4.4 +OPENNTPD_SOURCE:=openntpd-$(OPENNTPD_VERSION).tgz +OPENNTPD_VERSION:=3.9p1 +OPENNTPD_SOURCE:=openntpd-$(OPENNTPD_VERSION).tar.gz +OPENNTPD_SITE:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD +OPENNTPD_SITE:=http://ftp.eu.openbsd.org/pub/OpenBSD/OpenNTPD/ +#OPENNTPD_DIR:=$(BUILD_DIR)/openntpd-$(OPENNTPD_VERSION) +OPENNTPD_BINARIES:=ntpd +OPENNTPD_CONF_OPT:= --with-builtin-arc4random + +$(eval $(call AUTOTARGETS,package,openntpd)) + +#$(OPENNTPD_TARGET_CONFIGURE): ; +$(OPENNTPD_TARGET_BUILD): + (cd $(@D); \ + $(TARGET_CC) $(TARGET_CC_FLAGS) $(TARGET_CFLAGS) -I$(@D) \ + -D__USE_XOPEN \ + $(if $(BR2_PREFER_IMA),$(CFLAGS_COMBINE) $(CFLAGS_WHOLE_PROGRAM)) \ + -o $(@D)/$(OPENNTPD_BINARIES) $(wildcard $(@D)/*.c $(@D)/openbsd-compat/*.c); \ + ) + +$(OPENNTPD_TARGET_INSTALL_TARGET): + rm -f $(TARGET_DIR)/etc/ntpd.conf + $(INSTALL) -D -m 0644 $(OPENNTPD_DIR)/ntpd.conf $(TARGET_DIR)/etc/ntpd.conf + $(INSTALL) -m 755 $(addprefix $(OPENNTPD_DIR)/,$(OPENNTPD_BINARIES)) $(TARGET_DIR)/usr/sbin + $(STRIPCMD) $(STRIP_STRIP_ALL) $(addprefix $(TARGET_DIR)/usr/sbin,$(OPENNTPD_BINARIES)) + touch $@ + +$(OPENNTPD_TARGET_CLEAN): + -$(MAKE) -C $(OPENNTPD_DIR) clean + rm -f $(TARGET_DIR)/etc/ntpd.conf \ + $(wildcard $(TARGET_DIR)/usr/share/man*/ntpd*) \ + $(addprefix $(TARGET_DIR)/usr/sbin,$(OPENNTPD_BINARIES)) + touch $@ + +ntpd-dirclean: + rm -rf $(OPENNTPD_DIR) + -- 2.11.4.GIT