Add htpdate package
authorNicolas Thill <nico@openwrt.org>
Sat, 14 May 2005 21:19:23 +0000 (21:19 +0000)
committerNicolas Thill <nico@openwrt.org>
Sat, 14 May 2005 21:19:23 +0000 (21:19 +0000)
SVN-Revision: 899

openwrt/package/Config.in
openwrt/package/Makefile
openwrt/package/htpdate/Config.in [new file with mode: 0644]
openwrt/package/htpdate/Makefile [new file with mode: 0644]
openwrt/package/htpdate/files/htpdate.default [new file with mode: 0644]
openwrt/package/htpdate/files/htpdate.init [new file with mode: 0644]
openwrt/package/htpdate/ipkg/htpdate.conffiles [new file with mode: 0644]
openwrt/package/htpdate/ipkg/htpdate.control [new file with mode: 0644]
openwrt/package/htpdate/patches/no-time-delta-check.patch [new file with mode: 0644]

index 7cc6c6e3ed526caa46ffd02e14657668da1e8d3e..a221e5b03a450cad8ad398d5fa2cdf24502f5a8d 100644 (file)
@@ -64,6 +64,7 @@ source "package/ttcp/Config.in"
 source "package/robocfg/Config.in"
 source "package/siproxd/Config.in"
 source "package/sipsak/Config.in"
+source "package/htpdate/Config.in"
 
 comment "Libraries"
 source "package/libpthread/Config.in"
index b92938b9310152fc0a988776fa3c30a11e80ba0b..1ff67060efb040ce84833d78ed2360e93a2061c9 100644 (file)
@@ -86,6 +86,7 @@ package-$(BR2_PACKAGE_LIBLTDL) += libtool
 package-$(BR2_PACKAGE_LIBOSIP2) += libosip2
 package-$(BR2_PACKAGE_SIPROXD) += siproxd
 package-$(BR2_PACKAGE_SIPSAK) += sipsak
+package-$(BR2_PACKAGE_HTPDATE) += htpdate
 
 DEV_LIBS:=tcp_wrappers glib ncurses openssl pcre popt zlib libnet libpcap mysql postgresql iptables matrixssl lzo gmp fuse portmap libelf uclibc++ speex libpng libgd
 DEV_LIBS_COMPILE:=$(patsubst %,%-compile,$(DEV_LIBS))
diff --git a/openwrt/package/htpdate/Config.in b/openwrt/package/htpdate/Config.in
new file mode 100644 (file)
index 0000000..dc60ec4
--- /dev/null
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_HTPDATE
+       tristate "htpdate - an HTP (Hypertext Time Protocol) implementation"
+       default m if CONFIG_DEVEL
+       help
+         An HTP (Hypertext Time Protocol) implementation
+         
+         http://www.clevervest.com/htp/
+         
+
diff --git a/openwrt/package/htpdate/Makefile b/openwrt/package/htpdate/Makefile
new file mode 100644 (file)
index 0000000..0324eb5
--- /dev/null
@@ -0,0 +1,39 @@
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=htpdate
+PKG_VERSION:=0.7.2
+PKG_RELEASE:=1
+PKG_MD5SUM:=5b5ab483bdb3ebe155c72197e1b885f6
+
+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 $(TOPDIR)/package/rules.mk
+
+$(eval $(call PKG_template,HTPDATE,htpdate,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+$(PKG_BUILD_DIR)/.configured:
+       touch $(PKG_BUILD_DIR)/.configured
+
+$(PKG_BUILD_DIR)/.built:
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS)"
+       touch $(PKG_BUILD_DIR)/.built
+
+$(IPKG_HTPDATE):
+       install -d -m0755 $(IDIR_HTPDATE)/etc/default/
+       install -m0644 ./files/htpdate.default $(IDIR_HTPDATE)/etc/default/htpdate
+       install -d -m0755 $(IDIR_HTPDATE)/etc/init.d/
+       install -m0755 ./files/htpdate.init $(IDIR_HTPDATE)/etc/init.d/htpdate
+       install -d -m0755 $(IDIR_HTPDATE)/usr/sbin
+       cp -fpR $(PKG_BUILD_DIR)/htpdate $(IDIR_HTPDATE)/usr/sbin/
+       $(RSTRIP) $(IDIR_HTPDATE)
+       $(IPKG_BUILD) $(IDIR_HTPDATE) $(PACKAGE_DIR)
+
diff --git a/openwrt/package/htpdate/files/htpdate.default b/openwrt/package/htpdate/files/htpdate.default
new file mode 100644 (file)
index 0000000..8c182b3
--- /dev/null
@@ -0,0 +1 @@
+OPTIONS="-D www.google.com www.yahoo.com www.linux.org www.freebsd.org"
diff --git a/openwrt/package/htpdate/files/htpdate.init b/openwrt/package/htpdate/files/htpdate.init
new file mode 100644 (file)
index 0000000..9af0e55
--- /dev/null
@@ -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 $OPTIONS
+  ;;
+ stop)
+  [ -f $PID_F ] && kill $(cat $PID_F)
+  ;;
+ *)
+  echo "usage: $0 (start|stop)"
+  exit 1
+esac
+
+exit $?
diff --git a/openwrt/package/htpdate/ipkg/htpdate.conffiles b/openwrt/package/htpdate/ipkg/htpdate.conffiles
new file mode 100644 (file)
index 0000000..cbbc558
--- /dev/null
@@ -0,0 +1 @@
+/etc/default/htpdate
diff --git a/openwrt/package/htpdate/ipkg/htpdate.control b/openwrt/package/htpdate/ipkg/htpdate.control
new file mode 100644 (file)
index 0000000..c9e44b0
--- /dev/null
@@ -0,0 +1,8 @@
+Package: htpdate
+Priority: optional
+Section: net
+Version: [TBDL]
+Architecture: [TBDL]
+Maintainer: Nico <nthill@free.fr>
+Source: http://nthill.free.fr/openwrt/sources/htpdate/
+Description: an HTP (Hypertext Time Protocol) implementation
diff --git a/openwrt/package/htpdate/patches/no-time-delta-check.patch b/openwrt/package/htpdate/patches/no-time-delta-check.patch
new file mode 100644 (file)
index 0000000..f459295
--- /dev/null
@@ -0,0 +1,14 @@
+--- htpdate-0.7.2-orig/htpdate.c       2005-05-05 20:53:13.000000000 +0200
++++ htpdate-0.7.2-1/htpdate.c  2005-05-07 15:31:21.000000000 +0200
+@@ -411,11 +411,8 @@
+               timestamp = getHTTPdate( host, port, proxy, proxyport, when );
+-              /* Only include valid responses in timedelta[], |delta time| < year */
+-              if ( labs(timestamp) < 31536000 ) {
+                       timedelta[validtime] = timestamp;
+                       validtime++;
+-              }
+               /* Sleep for a while, unless we detect a time offset */
+               if ( daemonize && (timestamp == 0) )