fix broken openser menuconfig and package template call
[openwrt/svn-archive/archive.git] / openwrt / package / openser / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=openser
6 PKG_VERSION:=1.0.1
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=eebc16665003ee92daf96b216d6f9563
9 # PKG_VARIANT:=-tls # for tls version
10 PKG_VARIANT:=
11
12 PKG_SOURCE_URL:=http://openser.org/pub/openser/$(PKG_VERSION)/src
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz
14 PKG_CAT:=zcat
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
18
19 include $(TOPDIR)/package/rules.mk
20
21 define PKG_mod_template
22
23 $$(IPKG_$(1)):
24 [ -z "$(2)" ] || install -d -m 0755 $$(IDIR_$(1))/usr/lib/openser/modules/
25 $(CP) $(PKG_BUILD_DIR)/modules/$(2)/$(2).so \
26 $$(IDIR_$(1))/usr/lib/openser/modules/ ; \
27 $(RSTRIP) $$(IDIR_$(1))
28 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
29
30 endef
31
32 $(eval $(call PKG_template,OPENSER,openser,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
33 $(eval $(call PKG_template,OPENSER_MOD_ACCOUNTING,openser-mod-acc,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
34 $(eval $(call PKG_template,OPENSER_MOD_AUTH,openser-mod-auth,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
35 $(eval $(call PKG_template,OPENSER_MOD_AUTH_DB,openser-mod-auth-db,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
36 $(eval $(call PKG_template,OPENSER_MOD_AUTH_RADIUS,openser-mod-auth-radius,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
37 $(eval $(call PKG_template,OPENSER_MOD_AVP_RADIUS,openser-mod-avp-radius,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
38 $(eval $(call PKG_template,OPENSER_MOD_AVPOPS,openser-mod-avpops,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
39 $(eval $(call PKG_template,OPENSER_MOD_DISPATCHER,openser-mod-dispatcher,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
40 $(eval $(call PKG_template,OPENSER_MOD_DIVERSION,openser-mod-diversion,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
41 $(eval $(call PKG_template,OPENSER_MOD_FLATSTORE,openser-mod-flatstore,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
42 $(eval $(call PKG_template,OPENSER_MOD_GFLAGS,openser-mod-gflags,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
43 $(eval $(call PKG_template,OPENSER_MOD_GROUP,openser-mod-group,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
44 $(eval $(call PKG_template,OPENSER_MOD_GROUP_RADIUS,openser-mod-group-radius,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
45 $(eval $(call PKG_template,OPENSER_MOD_LCR,openser-mod-lcr,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
46 $(eval $(call PKG_template,OPENSER_MOD_MEDIAPROXY,openser-mod-mediaproxy,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
47 $(eval $(call PKG_template,OPENSER_MOD_MSILO,openser-mod-msilo,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
48 $(eval $(call PKG_template,OPENSER_MOD_MYSQL,openser-mod-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
49 $(eval $(call PKG_template,OPENSER_MOD_NATHELPER,openser-mod-nathelper,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
50 $(eval $(call PKG_template,OPENSER_MOD_OPTIONS,openser-mod-options,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
51 $(eval $(call PKG_template,OPENSER_MOD_PDT,openser-mod-pdt,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
52 $(eval $(call PKG_template,OPENSER_MOD_PERMISSIONS,openser-mod-permissions,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
53 $(eval $(call PKG_template,OPENSER_MOD_PIKE,openser-mod-pike,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
54 $(eval $(call PKG_template,OPENSER_MOD_SMS,openser-mod-sms,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
55 $(eval $(call PKG_template,OPENSER_MOD_UAC,openser-mod-uac,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
56 $(eval $(call PKG_template,OPENSER_MOD_UAC_REDIRECT,openser-mod-uac-redirect,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
57 $(eval $(call PKG_template,OPENSER_MOD_URI,openser-mod-uri,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
58 $(eval $(call PKG_template,OPENSER_MOD_URI_DB,openser-mod-uri-db,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
59 $(eval $(call PKG_template,OPENSER_MOD_URI_RADIUS,openser-mod-uri-radius,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
60 $(eval $(call PKG_template,OPENSER_MOD_XLOG,openser-mod-xlog,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
61
62 $(eval $(call PKG_mod_template,OPENSER_MOD_ACCOUNTING,acc))
63 $(eval $(call PKG_mod_template,OPENSER_MOD_AUTH,auth))
64 $(eval $(call PKG_mod_template,OPENSER_MOD_AUTH_DB,auth_db))
65 $(eval $(call PKG_mod_template,OPENSER_MOD_AUTH_RADIUS,auth_radius))
66 $(eval $(call PKG_mod_template,OPENSER_MOD_AVP_RADIUS,avp_radius))
67 $(eval $(call PKG_mod_template,OPENSER_MOD_AVPOPS,avpops))
68 $(eval $(call PKG_mod_template,OPENSER_MOD_DISPATCHER,dispatcher))
69 $(eval $(call PKG_mod_template,OPENSER_MOD_DIVERSION,diversion))
70 $(eval $(call PKG_mod_template,OPENSER_MOD_FLATSTORE,flatstore))
71 $(eval $(call PKG_mod_template,OPENSER_MOD_GFLAGS,gflags))
72 $(eval $(call PKG_mod_template,OPENSER_MOD_GROUP,group))
73 $(eval $(call PKG_mod_template,OPENSER_MOD_GROUP_RADIUS,group_radius))
74 $(eval $(call PKG_mod_template,OPENSER_MOD_LCR,lcr))
75 $(eval $(call PKG_mod_template,OPENSER_MOD_MEDIAPROXY,mediaproxy))
76 $(eval $(call PKG_mod_template,OPENSER_MOD_MSILO,msilo))
77 $(eval $(call PKG_mod_template,OPENSER_MOD_MYSQL,mysql))
78 $(eval $(call PKG_mod_template,OPENSER_MOD_NATHELPER,nathelper))
79 $(eval $(call PKG_mod_template,OPENSER_MOD_OPTIONS,options))
80 $(eval $(call PKG_mod_template,OPENSER_MOD_PDT,pdt))
81 $(eval $(call PKG_mod_template,OPENSER_MOD_PERMISSIONS,permissions))
82 $(eval $(call PKG_mod_template,OPENSER_MOD_PIKE,pike))
83 $(eval $(call PKG_mod_template,OPENSER_MOD_SMS,sms))
84 $(eval $(call PKG_mod_template,OPENSER_MOD_SPEEDIAL,speeddial))
85 $(eval $(call PKG_mod_template,OPENSER_MOD_UAC,uac))
86 $(eval $(call PKG_mod_template,OPENSER_MOD_UAC_REDIRECT,uac_redirect))
87 $(eval $(call PKG_mod_template,OPENSER_MOD_URI,uri))
88 $(eval $(call PKG_mod_template,OPENSER_MOD_URI_DB,uri_db))
89 $(eval $(call PKG_mod_template,OPENSER_MOD_URI_RADIUS,uri_radius))
90 $(eval $(call PKG_mod_template,OPENSER_MOD_XLOG,xlog))
91
92 # Select here the modules for the ipk package
93 OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec
94
95 OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),modules/$(module)/$(module).so)
96 OPENSER_MODULES := $(patsubst %,modules/%,$(OPENSER_MODULES))
97
98 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
99 touch $@
100
101 $(PKG_BUILD_DIR)/.built:
102 $(MAKE) -C $(PKG_BUILD_DIR) \
103 prefix=/ \
104 extra_defs="-DUSE_PTHREAD_MUTEX " \
105 CC="$(TARGET_CC)" \
106 ARCH="$(ARCH)" \
107 CFLAGS="$(TARGET_CFLAGS)" \
108 LOCALBASE="$(STAGING_DIR)/usr" \
109 all utils/gen_ha1/gen_ha1
110 touch $@
111
112 $(IPKG_OPENSER):
113 mkdir -p $(IDIR_OPENSER)/usr/sbin
114 $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(IDIR_OPENSER)/usr/sbin/
115 $(CP) $(PKG_BUILD_DIR)/utils/gen_ha1/gen_ha1 $(IDIR_OPENSER)/usr/sbin/openser_gen_ha1
116 $(CP) $(PKG_BUILD_DIR)/scripts/sc $(IDIR_OPENSER)/usr/sbin/openserctl
117 chmod 744 $(IDIR_OPENSER)/usr/sbin/openserctl
118 $(CP) $(PKG_BUILD_DIR)/scripts/sc.dbtext $(IDIR_OPENSER)/usr/sbin/dbtextctl
119 chmod 744 $(IDIR_OPENSER)/usr/sbin/dbtextctl
120 mkdir -p $(IDIR_OPENSER)/usr/lib/openser/modules
121 (cd $(PKG_BUILD_DIR);\
122 $(CP) $(OPENSER_MODULE_FILES) $(IDIR_OPENSER)/usr/lib/openser/modules/; \
123 )
124 mkdir -p $(IDIR_OPENSER)/etc/openser
125 $(CP) $(PKG_BUILD_DIR)/etc/openser.cfg $(IDIR_OPENSER)/etc/openser/
126 $(RSTRIP) $(IDIR_OPENSER)
127 $(IPKG_BUILD) $(IDIR_OPENSER) $(PACKAGE_DIR)