Sorry if this came up before, but i cant find any docu via google and/or
openwrt homepage....
I have created some packages in my
~/{buildsystemdirectory}/package/{nameofpackage} directory
and some of them i would have liked before, so i wanted to contribute them
back to the community.
i tried with http://wiki.openwrt.org/oldwiki/BuildingPackagesHowTo and got a
3 mb big file for only one init script one make file and a simple patch... i
thought look into it and it contained a lot of things which are in tree so
this wy cant be correct.
i also tried with https://dev.openwrt.org/wiki/SubmittingPatches and got the
patch shown below...
now i was wondering if i am right here .. cause adding a feeds package isnt
devel for my understanding but extension...
if i should propose that somewhere else please let me now ...
anyway if i am right here:

The new Package is the dhid client for dhis.org my favorite ddns provider.
it needs a library for QRC auth, for which an additional package is created
(libgmp)
i added simple init script and Makefile patch to get it working with openwrt
build system
works like a charm on my Dlink DI825 with backfire 10.3 RC4


Index: package/libgmp/Makefile
===================================================================
--- package/libgmp/Makefile (Revision 0)
+++ package/libgmp/Makefile (Revision 0)
@@ -0,0 +1,40 @@
+# Dhid client gmp library
+# For www.dhis.org ddns service
+# Makefile created for Openwrt
+# by Philipp A. Mohrenweiser <phi...@googlemail.com>
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libgmp
+PKG_VERSION:=4.2.2
+PKG_RELEASE:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/gmp-$(PKG_VERSION)
+PKG_SOURCE:=gmp-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=ftp://ftp.dhis.org/pub/dhis/
+PKG_MD5SUM:=1def49df60248a08374ecd6cdcaa5d3d
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libgmp
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=GMP Library used by dhid client
+ URL:=http://www.dhis.org
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_BUILD_DIR)/gmp.h $(1)/usr/include/
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_BUILD_DIR)/.libs/libgmp.{a,so*} $(1)/usr/lib/
+endef
+
+
+define Package/libgmp/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_BUILD_DIR)/.libs/libgmp.{a,so*} $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
Index: package/dhid/files/dhid.init
===================================================================
--- package/dhid/files/dhid.init (Revision 0)
+++ package/dhid/files/dhid.init (Revision 0)
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+# Dhid client init script
+# For www.dhis.org ddns service
+# created by Philipp A. Mohrenweiser <phi...@googlemail.com>
+
+START=99
+STOP=5
+
+start() {
+ dhid -P /var/run/dhid.pid -f /etc/dhid.conf
+}
+
+stop() {
+ kill `cat /var/run/dhid.pid`
+}
Index: package/dhid/patches/010-correcting_Makefile_flags.patch
===================================================================
--- package/dhid/patches/010-correcting_Makefile_flags.patch (Revision 0)
+++ package/dhid/patches/010-correcting_Makefile_flags.patch (Revision 0)
@@ -0,0 +1,14 @@
+--- a/Makefile
++++ b/Makefile
+@@ -29,9 +29,9 @@ CC=cc
+ #
+ # For password mode only (no QRC), remove the -DQRC=1 statement
+ # CFLAGS=-I/usr/local/include -Wall
+-CFLAGS=-I/usr/local/include -DQRC=1 -Wall
++CFLAGS=-I$(STAGING_DIR)/usr/include -DQRC=1 -Wall
+
+-LFLAGS=-L/usr/local/lib
++LFLAGS=-L$(STAGING_DIR)/usr/lib
+
+ # For password mode only (no QRC), comment the following line and keep
LIBS
+ # empty.
Index: package/dhid/Makefile
===================================================================
--- package/dhid/Makefile (Revision 0)
+++ package/dhid/Makefile (Revision 0)
@@ -0,0 +1,39 @@
+# Dhid client Makefile for OpenWrt
+# For www.dhis.org ddns service
+# created by Philipp A. Mohrenweiser <phi...@googlemail.com>
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dhid
+PKG_VERSION:=5.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=ftp://ftp.dhis.org/pub/dhis/
+PKG_MD5SUM:=47d1a54a87653aef424ef0f8ab9a0b20
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/dhid
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libgmp
+  TITLE:=Dhid Client
+  URL:=http://www.dhis.org
+endef
+
+define Package/dhid/conffiles
+dhid.conf
+endef
+
+define Package/dhid/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(CP) $(PKG_BUILD_DIR)/dhid $(1)/usr/sbin
+ $(CP) $(PKG_BUILD_DIR)/genkeys $(1)/usr/sbin
+ $(INSTALL_DIR) $(1)/etc
+ $(CP) $(PKG_BUILD_DIR)/dhid.conf.sample $(1)/etc/dhid.conf
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/dhid.init $(1)/etc/init.d/dhid
+endef
+
+$(eval $(call BuildPackage,dhid))

Cheers
Philipp A. Mohrenweiser
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to