From 29cff4ef24f1bc222d975e77b54ff1f99942dc01 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Wed, 2 Aug 2006 09:09:12 +0000 Subject: [PATCH] Port htpdate to -ng SVN-Revision: 4391 --- net/htpdate/Makefile | 54 +++++++++++++++++++++++++++++++ net/htpdate/files/htpdate.default | 1 + net/htpdate/files/htpdate.init | 22 +++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 net/htpdate/Makefile create mode 100644 net/htpdate/files/htpdate.default create mode 100644 net/htpdate/files/htpdate.init diff --git a/net/htpdate/Makefile b/net/htpdate/Makefile new file mode 100644 index 0000000000..05354c68ba --- /dev/null +++ b/net/htpdate/Makefile @@ -0,0 +1,54 @@ +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=htpdate +PKG_VERSION:=0.9.0 +PKG_RELEASE:=1 +PKG_MD5SUM:=12cf883c5619cf4c13a62f77f1a55b54 + +PKG_SOURCE_URL:=http://www.clevervest.com/htp/archive/c/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(INCLUDE_DIR)/package.mk + +define Package/htpdate + SECTION:=net + CATEGORY:=Network + TITLE:=an HTP (Hypertext Time Protocol) implementation + DESCRIPTION:=an HTP (Hypertext Time Protocol) implementation + URL:=http://www.clevervest.com/htp/ +endef + +define Package/htpdate/conffiles +/etc/default/htpdate +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" +endef + + +define Package/htpdate/install + install -d -m0755 $(1)/etc/default/ + install -m0644 ./files/htpdate.default $(1)/etc/default/htpdate + install -d -m0755 $(1)/etc/init.d/ + install -m0755 ./files/htpdate.init $(1)/etc/init.d/htpdate + ln -sf htpdate $(1)/etc/init.d/S49htpdate + install -d -m0755 $(1)/usr/sbin + install -m0755 $(PKG_BUILD_DIR)/htpdate $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,htpdate)) + diff --git a/net/htpdate/files/htpdate.default b/net/htpdate/files/htpdate.default new file mode 100644 index 0000000000..94674fdd3c --- /dev/null +++ b/net/htpdate/files/htpdate.default @@ -0,0 +1 @@ +OPTIONS="www.google.com www.yahoo.com www.linux.org www.freebsd.org" diff --git a/net/htpdate/files/htpdate.init b/net/htpdate/files/htpdate.init new file mode 100644 index 0000000000..97a413f774 --- /dev/null +++ b/net/htpdate/files/htpdate.init @@ -0,0 +1,22 @@ +#!/bin/sh + +BIN=htpdate +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid +[ -f $DEFAULT ] && . $DEFAULT + +case $1 in + start) + mkdir -p $RUN_D + $BIN -l -s -t $OPTIONS && $BIN -D $OPTIONS + ;; + stop) + [ -f $PID_F ] && kill $(cat $PID_F) + ;; + *) + echo "usage: $0 (start|stop)" + exit 1 +esac + +exit $? -- 2.30.2