--- /dev/null
+#
+# 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:=openser
+PKG_VERSION:=1.0.1
+PKG_RELEASE:=1
+PKG_MD5SUM:=eebc16665003ee92daf96b216d6f9563
+# PKG_VARIANT:=-tls # for tls version
+PKG_VARIANT:=
+
+PKG_SOURCE_URL:=http://openser.org/pub/openser/$(PKG_VERSION)/src
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VARIANT)_src.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/openser
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Configurable, free SIP server
+ URL:=http://www.openser.org
+ MENU:=1
+endef
+
+define Package/openser/conffiles
+/etc/openser/openser.cfg
+endef
+
+define Package/openser-mod-acc
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Accounting support
+ MENU:=0
+endef
+
+define Package/openser-mod-auth
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Authentication support
+endef
+
+define Package/openser-mod-auth-db
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Authentication with database support
+endef
+
+define Package/openser-mod-auth-radius
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser +libradiusclient-ng
+ TITLE:=Authentication with RADIUS support
+endef
+
+define Package/openser-mod-avp-radius
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser +libradiusclient-ng
+ TITLE:=AVP with RADIUS support
+endef
+
+define Package/openser-mod-avpops
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=AVP options support
+endef
+
+define Package/openser-mod-dispatcher
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Dispatcher support
+endef
+
+define Package/openser-mod-diversion
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Diversion support
+endef
+
+define Package/openser-mod-flatstore
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Flatstore support
+endef
+
+define Package/openser-mod-gflags
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Gflags support
+endef
+
+define Package/openser-mod-group
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Group support
+endef
+
+define Package/openser-mod-group-radius
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser +libradiusclient-ng
+ TITLE:=Group with RADIUS support
+endef
+
+define Package/openser-mod-lcr
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser openser-mod-mysql
+ TITLE:=Least Cost Routing support
+endef
+
+define Package/openser-mod-mediaproxy
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Mediaproxy support
+endef
+
+define Package/openser-mod-msilo
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=MSilo support
+endef
+
+define Package/openser-mod-mysql
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser +libmysqlclient
+ TITLE:=MySQL support
+endef
+
+define Package/openser-mod-nathelper
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=NAT helper support
+endef
+
+define Package/openser-mod-options
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Options support
+endef
+
+define Package/openser-mod-pdt
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=PDT support
+endef
+
+define Package/openser-mod-permissions
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Permissions support
+endef
+
+define Package/openser-mod-pike
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=PIKE support
+endef
+
+define Package/openser-mod-sms
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=SMS support
+endef
+
+define Package/openser-mod-speeddial
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Speeddial supporte
+endef
+
+define Package/openser-mod-uac
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=UAC support
+endef
+
+define Package/openser-mod-uac-redirect
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=UAC with redirect support
+endef
+
+define Package/openser-mod-uri
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=URI support
+endef
+
+define Package/openser-mod-uri-db
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser +openser-mod-mysql
+ TITLE:=URI with database support
+endef
+
+define Package/openser-mod-uri-radius
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser +libradiusclient-ng
+ TITLE:=URI with RADIUS support
+endef
+
+define Package/openser-mod-xlog
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=openser
+ TITLE:=Advanced logging support
+endef
+
+# Select here the modules for the ipk package
+OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec
+
+OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),modules/$(module)/$(module).so)
+OPENSER_MODULES := $(patsubst %,modules/%,$(OPENSER_MODULES))
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ prefix=/ \
+ extra_defs="-DUSE_PTHREAD_MUTEX " \
+ CC="$(TARGET_CC)" \
+ ARCH="$(ARCH)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LOCALBASE="$(STAGING_DIR)/usr" \
+ all utils/gen_ha1/gen_ha1
+endef
+
+define Package/openser/install
+ mkdir -p $(1)/usr/sbin
+ $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
+ $(CP) $(PKG_BUILD_DIR)/utils/gen_ha1/gen_ha1 $(1)/usr/sbin/openser_gen_ha1
+ $(CP) $(PKG_BUILD_DIR)/scripts/sc $(1)/usr/sbin/openserctl
+ chmod 744 $(1)/usr/sbin/openserctl
+ $(CP) $(PKG_BUILD_DIR)/scripts/sc.dbtext $(1)/usr/sbin/dbtextctl
+ chmod 744 $(1)/usr/sbin/dbtextctl
+ mkdir -p $(1)/usr/lib/openser/modules
+ (cd $(PKG_BUILD_DIR);\
+ $(CP) $(OPENSER_MODULE_FILES) $(1)/usr/lib/openser/modules/; \
+ )
+ mkdir -p $(1)/etc/openser
+ $(CP) $(PKG_BUILD_DIR)/etc/openser.cfg $(1)/etc/openser/
+endef
+
+define BuildPlugin
+ define Package/$(1)/install
+ [ -z "$(2)" ] || install -d -m0755 $$(1)/usr/lib/openser/modules/
+ $(CP) $(PKG_BUILD_DIR)/modules/$(2)/$(2).so \
+ $$(1)/usr/lib/openser/modules/ ;
+ endef
+
+ $$(eval $$(call BuildPackage,$(1)))
+endef
+
+$(eval $(call BuildPackage,openser))
+$(eval $(call BuildPlugin,openser-mod-acc,acc))
+$(eval $(call BuildPlugin,openser-mod-auth,auth))
+$(eval $(call BuildPlugin,openser-mod-auth-db,auth_db))
+$(eval $(call BuildPlugin,openser-mod-auth-radius,auth_radius))
+$(eval $(call BuildPlugin,openser-mod-avp-radius,avp_radius))
+$(eval $(call BuildPlugin,openser-mod-avpops,avpops))
+$(eval $(call BuildPlugin,openser-mod-dispatcher,dispatcher))
+$(eval $(call BuildPlugin,openser-mod-diversion,diversion))
+$(eval $(call BuildPlugin,openser-mod-flatstore,flatstore))
+$(eval $(call BuildPlugin,openser-mod-gflags,gflags))
+$(eval $(call BuildPlugin,openser-mod-group,group))
+$(eval $(call BuildPlugin,openser-mod-group-radius,group_radius))
+$(eval $(call BuildPlugin,openser-mod-lcr,lcr))
+$(eval $(call BuildPlugin,openser-mod-mediaproxy,mediaproxy))
+$(eval $(call BuildPlugin,openser-mod-msilo,msilo))
+$(eval $(call BuildPlugin,openser-mod-mysql,mysql))
+$(eval $(call BuildPlugin,openser-mod-nathelper,nathelper))
+$(eval $(call BuildPlugin,openser-mod-options,options))
+$(eval $(call BuildPlugin,openser-mod-pdt,pdt))
+$(eval $(call BuildPlugin,openser-mod-permissions,permissions))
+$(eval $(call BuildPlugin,openser-mod-pike,pike))
+$(eval $(call BuildPlugin,openser-mod-sms,sms))
+$(eval $(call BuildPlugin,openser-mod-speeddial,speeddial))
+$(eval $(call BuildPlugin,openser-mod-uac,uac))
+$(eval $(call BuildPlugin,openser-mod-uac-redirect,uac_redirect))
+$(eval $(call BuildPlugin,openser-mod-uri,uri))
+$(eval $(call BuildPlugin,openser-mod-uri-db,uri_db))
+$(eval $(call BuildPlugin,openser-mod-uri-radius,uri_radius))
+$(eval $(call BuildPlugin,openser-mod-xlog,xlog))
--- /dev/null
+--- openser-1.0.0-tls.orig/Makefile.defs 2005-10-28 18:32:39.000000000 +0200
++++ openser-1.0.0-tls/Makefile.defs 2006-01-15 23:40:18.391547040 +0100
+@@ -917,7 +917,7 @@
+ endif
+ YACC_FLAGS=-d -b cfg
+ # on solaris add -lxnet (e.g. LIBS= -lxnet)
+-LIBS= -lfl -ldl -lresolv
++LIBS= -ldl -lresolv
+
+
+ #os specific stuff
+@@ -955,7 +955,7 @@
+ endif
+ OLD_SOLARIS= $(shell echo "$(OSREL)" | \
+ sed -e 's/^5\.[0-6][^0-9]*$$/yes/' )
+- LIBS+= -L$(LOCALBASE)/lib -lfl -lxnet -lnsl
++ LIBS+= -L$(LOCALBASE)/lib -lxnet -lnsl
+ ifeq ($(OLD_SOLARIS), yes)
+ LIBS+=-lposix4
+ else
+@@ -970,9 +970,9 @@
+ ifneq ($(found_lock_method), yes)
+ DEFS+= -DUSE_PTHREAD_MUTEX # try pthread sems
+ found_lock_method=yes
+- LIBS= -pthread -lfl #dlopen is in libc
++ LIBS= -pthread #dlopen is in libc
+ else
+- LIBS= -lfl #dlopen is in libc
++ LIBS= #dlopen is in libc
+ endif
+ YACC=yacc
+ endif
+@@ -987,7 +987,7 @@
+ # (symbols on openbsd are prefixed by "_")
+ YACC=yacc
+ # no sched_yield on openbsd unless linking with c_r (not recommended)
+- LIBS= -lfl
++ LIBS=
+ OPENBSD_IS_AOUT= $(shell echo "$(OSREL)" | \
+ sed -e 's/^3\.[0-3][^0-9]*$$/yes/' |sed -e 's/^[0-2]\..*/yes/')
+ # exception: on sparc openbsd 3.2 is elf and not aout
+@@ -1014,7 +1014,7 @@
+ found_lock_method=yes
+ endif
+ YACC=yacc
+- LIBS= -lfl
++ LIBS=
+ endif
+
+ # OS X support, same as freebsd
+@@ -1028,9 +1028,9 @@
+ ifneq ($(found_lock_method), yes)
+ DEFS+= -DUSE_PTHREAD_MUTEX # try pthread sems
+ found_lock_method=yes
+- LIBS= -pthread -lfl -lresolv #dlopen is in libc
++ LIBS= -pthread -lresolv #dlopen is in libc
+ else
+- LIBS= -lfl -lresolv #dlopen is in libc
++ LIBS= -lresolv #dlopen is in libc
+ endif
+ LDFLAGS= # darwin doesn't like -O2 or -E
+ MOD_LDFLAGS= -bundle -bundle_loader ../../$(MAIN_NAME)
+@@ -1047,7 +1047,7 @@
+
+ #add libssl if needed
+ ifneq ($(TLS),)
+-DEFS+= -I$(LOCALBASE)/ssl/include
++DEFS+= -I$(LOCALBASE)/include
+ LIBS+= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -lssl -lcrypto
+ endif
+
--- /dev/null
+--- openser-1.0.1/Makefile 2006-02-15 20:52:21.000000000 +0100
++++ openser-1.0.1.new/Makefile 2006-03-17 11:01:27.417488936 +0100
+@@ -46,8 +46,7 @@
+ skip_modules?=
+
+ # if not set on the cmd. line or the env, exclude this modules:
+-exclude_modules?= jabber cpl-c pa postgres mysql \
+- avp_radius auth_radius group_radius uri_radius
++exclude_modules?= jabber cpl-c pa
+ # always exclude the CVS dir
+ override exclude_modules+= CVS $(skip_modules)
+
+diff -urN openser-1.0.1/modules/acc/Makefile openser-1.0.1.new/modules/acc/Makefile
+--- openser-1.0.1/modules/acc/Makefile 2005-09-05 21:32:02.000000000 +0200
++++ openser-1.0.1.new/modules/acc/Makefile 2006-03-17 10:38:14.333269928 +0100
+@@ -14,8 +14,8 @@
+ DEFS+=-DSQL_ACC
+
+ # uncomment the next two lines if you wish to enable RADIUS accounting
+-#DEFS+=-DRAD_ACC -I$(LOCALBASE)/include
+-#LIBS=-L$(LOCALBASE)/lib -lradiusclient-ng
++DEFS+=-DRAD_ACC -I$(LOCALBASE)/include
++LIBS=-L$(LOCALBASE)/lib -lradiusclient-ng
+
+ # uncomment the next two lines if you wish to enable DIAMETER accounting
+ #DEFS+=-DDIAM_ACC
+diff -urN openser-1.0.1/modules/mysql/Makefile openser-1.0.1.new/modules/mysql/Makefile
+--- openser-1.0.1/modules/mysql/Makefile 2005-06-13 18:47:40.000000000 +0200
++++ openser-1.0.1.new/modules/mysql/Makefile 2006-03-17 11:12:16.218856136 +0100
+@@ -9,14 +9,12 @@
+ # mysql.h locations (freebsd,openbsd solaris)
+ DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/mysql \
+ -I$(LOCALBASE)/mysql/include \
+- -I/usr/include/mysql
+
+ # libmysqlclient locations on RH/Suse, Solaris /OpenBSD, FreeBSD
+ # (Debian does the right thing and puts it in /usr/lib)
+ LIBS=-L/usr/lib/mysql -L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/mysql \
+ -L$(LOCALBASE)/mysql/lib/mysql/ \
+ -L$(LOCALBASE)/mysql/lib \
+- -L/usr/lib64/mysql \
+ -lmysqlclient -lz
+
+ include ../../Makefile.modules
+diff -urN openser-1.0.1/modules/postgres/Makefile openser-1.0.1.new/modules/postgres/Makefile
+--- openser-1.0.1/modules/postgres/Makefile 2005-07-01 16:52:34.000000000 +0200
++++ openser-1.0.1.new/modules/postgres/Makefile 2006-03-17 11:13:22.150832952 +0100
+@@ -7,8 +7,7 @@
+ NAME=postgres.so
+
+ # libpq-fe.h locations
+-DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/pgsql/include \
+- -I/usr/include/postgresql -I/usr/include/postgresql/8.0
++DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/pgsql/include -I$(LOCALBASE)/include/postgresql
+ LIBS=-L$(LOCALBASE)/lib -L$(LOCALBASE)/pgsql/lib -L$(LOCALBASE)/lib/pgsql \
+ -lpq
+