Added motion, thanks to Nathan True !
[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_AVPOPS,openser-mod-avpops,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
38 $(eval $(call PKG_template,OPENSER_MOD_LCR,openser-mod-lcr,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
39 $(eval $(call PKG_template,OPENSER_MOD_MEDIAPROXY,openser-mod-mediaproxy,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
40 $(eval $(call PKG_template,OPENSER_MOD_MYSQL,openser-mod-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
41 $(eval $(call PKG_template,OPENSER_MOD_NATHELPER,openser-mod-nathelper,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
42 $(eval $(call PKG_template,OPENSER_MOD_SMS,openser-mod-sms,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
43 $(eval $(call PKG_template,OPENSER_MOD_SPEEDDIAL,openser-mod-speeddial,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
44 $(eval $(call PKG_template,OPENSER_MOD_XLOG,openser-mod-xlog,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
45
46 $(eval $(call PKG_mod_template,OPENSER_MOD_ACCOUNTING,acc))
47 $(eval $(call PKG_mod_template,OPENSER_MOD_AUTH,auth))
48 $(eval $(call PKG_mod_template,OPENSER_MOD_AUTH_DB,auth_db))
49 $(eval $(call PKG_mod_template,OPENSER_MOD_AUTH_RADIUS,auth_radius))
50 $(eval $(call PKG_mod_template,OPENSER_MOD_AVPOPS,avpops))
51 $(eval $(call PKG_mod_template,OPENSER_MOD_LCR,lcr))
52 $(eval $(call PKG_mod_template,OPENSER_MOD_MEDIAPROXY,mediaproxy))
53 $(eval $(call PKG_mod_template,OPENSER_MOD_MYSQL,mysql))
54 $(eval $(call PKG_mod_template,OPENSER_MOD_NATHELPER,nathelper))
55 $(eval $(call PKG_mod_template,OPENSER_MOD_SMS,sms))
56 $(eval $(call PKG_mod_template,OPENSER_MOD_SPEEDIAL,speeddial))
57 $(eval $(call PKG_mod_template,OPENSER_MOD_XLOG,xlog))
58
59 # Select here the modules for the ipk package
60 OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec
61
62 OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),modules/$(module)/$(module).so)
63 OPENSER_MODULES := $(patsubst %,modules/%,$(OPENSER_MODULES))
64
65 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
66 touch $@
67
68 $(PKG_BUILD_DIR)/.built:
69 $(MAKE) -C $(PKG_BUILD_DIR) \
70 prefix=/ \
71 extra_defs="-DUSE_PTHREAD_MUTEX " \
72 CC="$(TARGET_CC)" \
73 ARCH="$(ARCH)" \
74 CFLAGS="$(TARGET_CFLAGS)" \
75 LOCALBASE="$(STAGING_DIR)/usr" \
76 all utils/gen_ha1/gen_ha1
77 touch $@
78
79 $(IPKG_OPENSER):
80 mkdir -p $(IDIR_OPENSER)/usr/sbin
81 $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(IDIR_OPENSER)/usr/sbin/
82 $(CP) $(PKG_BUILD_DIR)/utils/gen_ha1/gen_ha1 $(IDIR_OPENSER)/usr/sbin/openser_gen_ha1
83 $(CP) $(PKG_BUILD_DIR)/scripts/sc $(IDIR_OPENSER)/usr/sbin/openserctl
84 chmod 744 $(IDIR_OPENSER)/usr/sbin/openserctl
85 $(CP) $(PKG_BUILD_DIR)/scripts/sc.dbtext $(IDIR_OPENSER)/usr/sbin/dbtextctl
86 chmod 744 $(IDIR_OPENSER)/usr/sbin/dbtextctl
87 mkdir -p $(IDIR_OPENSER)/usr/lib/openser/modules
88 (cd $(PKG_BUILD_DIR);\
89 $(CP) $(OPENSER_MODULE_FILES) $(IDIR_OPENSER)/usr/lib/openser/modules/; \
90 )
91 mkdir -p $(IDIR_OPENSER)/etc/openser
92 $(CP) $(PKG_BUILD_DIR)/etc/openser.cfg $(IDIR_OPENSER)/etc/openser/
93 $(RSTRIP) $(IDIR_OPENSER)
94 $(IPKG_BUILD) $(IDIR_OPENSER) $(PACKAGE_DIR)