add missing ipkg/ files for rrdcollect-example
[openwrt.git] / package / asterisk / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=asterisk
6 PKG_VERSION:=1.0.9
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=0d7f1c680ae53a739f26a069ef8b580a
9
10 PKG_SOURCE_URL:=http://www.asterisk.org/html/downloads ftp://ftp.asterisk.org/pub/asterisk
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
13 PKG_CAT:=zcat
14
15 include $(TOPDIR)/package/rules.mk
16 $(eval $(call PKG_template,ASTERISK,asterisk,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
17 $(eval $(call PKG_template,ASTERISK_MYSQL,asterisk-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
18 $(eval $(call PKG_template,ASTERISK_PGSQL,asterisk-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
19 $(eval $(call PKG_template,ASTERISK_VOICEMAIL,asterisk-voicemail,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
20 $(eval $(call PKG_template,ASTERISK_SOUNDS,asterisk-sounds,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
21 $(eval $(call PKG_template,ASTERISK_CODEC_ILBC,asterisk-codec-ilbc,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
22 $(eval $(call PKG_template,ASTERISK_CODEC_LPC10,asterisk-codec-lpc10,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
23 $(eval $(call PKG_template,ASTERISK_CODEC_SPEEX,asterisk-codec-speex,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
24 $(eval $(call PKG_template,ASTERISK_PBX_DUNDI,asterisk-pbx-dundi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
25
26 ifneq ($(DEVELOPER),)
27 APPS:=app_sql_mysql.so app_sql_postgres.so
28 MODS:=cdr_mysql.so cdr_pgsql.so
29 SPEEX:=codec_speex.so
30 else
31 APPS:=
32 MODS:=
33 ifneq ($(BR2_PACKAGE_ASTERISK_MYSQL),)
34 APPS += app_sql_mysql.so
35 MODS += cdr_mysql.so
36 endif
37 ifneq ($(BR2_PACKAGE_ASTERISK_PGSQL),)
38 APPS += app_sql_postgres.so
39 MODS += cdr_pgsql.so
40 endif
41 ifneq ($(BR2_PACKAGE_ASTERISK_CODEC_SPEEX),)
42 SPEEX:=codec_speex.so
43 endif
44 endif
45
46 $(PKG_BUILD_DIR)/.configured:
47 touch $@
48
49 $(PKG_BUILD_DIR)/.built:
50 $(MAKE) -C "$(PKG_BUILD_DIR)/channels" \
51 CC="$(HOSTCC)" \
52 gentone
53 $(MAKE) -C "$(PKG_BUILD_DIR)" \
54 CC_FOR_BUILD="$(HOSTCC)" \
55 $(TARGET_CONFIGURE_OPTS) \
56 OPTIMIZE="$(TARGET_CFLAGS)" \
57 PROC="$(ARCH)" \
58 CFLAGS_EXTRA="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/speex" \
59 LDFLAGS_EXTRA="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/mysql" \
60 CRYPTO_LIBS="-L$(STAGING_DIR)/usr/lib -Wl,-Bstatic -lssl -lcrypto -Wl,-Bdynamic" \
61 EXTRA_APPS="$(APPS)" \
62 EXTRA_MODS="$(MODS)" \
63 MODSPEEX="$(SPEEX)"
64 touch $@
65
66 $(IPKG_ASTERISK):
67 $(MAKE) -C $(PKG_BUILD_DIR) \
68 DESTDIR="$(IDIR_ASTERISK)" \
69 install samples
70 rm -rf $(IDIR_ASTERISK)/usr/sbin/astgenkey
71 rm -rf $(IDIR_ASTERISK)/usr/bin
72 rm -rf $(IDIR_ASTERISK)/usr/share
73 rm -rf $(IDIR_ASTERISK)/usr/include
74 rm -rf $(IDIR_ASTERISK)/var
75 (cd $(IDIR_ASTERISK)/usr/lib/asterisk; \
76 rm -rf agi-bin/*; \
77 rm -rf firmware; \
78 rm -rf images; \
79 rm -rf keys/*; \
80 rm -rf mohmp3; \
81 rm -rf sounds/*; \
82 cd modules; \
83 rm -rf *adsi* *festival* *modem* *meetme* *oss* *phone* *intercom* \
84 *mp3* *nbscat* *mysql* *postgres* *pgsql* *voicemail* *speex* \
85 *musiconhold* *zapateller* *jpeg*; \
86 rm -f {codec,format}_ilbc.so ; \
87 rm -f codec_lpc10.so ; \
88 rm -f pbx_dundi.so ; \
89 )
90 (cd $(IDIR_ASTERISK)/etc/asterisk; \
91 rm -f *odbc* *mysql* *postgres* *pgsql* *voicemail* *adsi* *oss* *alsa* \
92 *festival* *modem* *meetme* *phone* *tds* *vofr* *rpt* *vpb* \
93 *zapata* *musiconhold*; \
94 rm -f dundi.conf ; \
95 )
96 install -d -m0755 $(IDIR_ASTERISK)/etc/default
97 install -m0644 ./files/asterisk.default $(IDIR_ASTERISK)/etc/default/asterisk
98 install -d -m0755 $(IDIR_ASTERISK)/etc/init.d
99 install -m0755 ./files/asterisk.init $(IDIR_ASTERISK)/etc/init.d/asterisk
100 ln -sf asterisk $(IDIR_ASTERISK)/etc/init.d/S60asterisk
101 $(RSTRIP) $(IDIR_ASTERISK)
102 $(IPKG_BUILD) $(IDIR_ASTERISK) $(PACKAGE_DIR)
103
104 $(IPKG_ASTERISK_MYSQL):
105 install -d -m0755 $(IDIR_ASTERISK_MYSQL)/etc/asterisk
106 install -m0600 $(PKG_BUILD_DIR)/configs/cdr_mysql.conf.sample $(IDIR_ASTERISK_MYSQL)/etc/asterisk/cdr_mysql.conf
107 install -d -m0755 $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules
108 install -m0755 $(PKG_BUILD_DIR)/apps/app_sql_mysql.so $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/
109 install -m0755 $(PKG_BUILD_DIR)/cdr/cdr_mysql.so $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/
110 $(RSTRIP) $(IDIR_ASTERISK_MYSQL)
111 $(IPKG_BUILD) $(IDIR_ASTERISK_MYSQL) $(PACKAGE_DIR)
112
113 $(IPKG_ASTERISK_PGSQL):
114 install -d -m0755 $(IDIR_ASTERISK_PGSQL)/etc/asterisk
115 install -m0600 $(PKG_BUILD_DIR)/configs/cdr_pgsql.conf.sample $(IDIR_ASTERISK_PGSQL)/etc/asterisk/cdr_pgsql.conf
116 install -d -m0755 $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules
117 install -m0755 $(PKG_BUILD_DIR)/apps/app_sql_postgres.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
118 install -m0755 $(PKG_BUILD_DIR)/cdr/cdr_pgsql.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
119 $(RSTRIP) $(IDIR_ASTERISK_PGSQL)
120 $(IPKG_BUILD) $(IDIR_ASTERISK_PGSQL) $(PACKAGE_DIR)
121
122 $(IPKG_ASTERISK_SOUNDS):
123 install -d -m0755 $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds
124 cp -fpR $(PKG_BUILD_DIR)/sounds/* $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/
125 rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/*.mp3
126 rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/vm-*
127 $(IPKG_BUILD) $(IDIR_ASTERISK_SOUNDS) $(PACKAGE_DIR)
128
129 $(IPKG_ASTERISK_VOICEMAIL):
130 install -d -m0755 $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk
131 install -m0644 $(PKG_BUILD_DIR)/configs/voicemail.conf.sample $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk/voicemail.conf
132 install -d -m0755 $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules
133 install -m0755 $(PKG_BUILD_DIR)/apps/*voicemail.so $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules/
134 $(RSTRIP) $(IDIR_ASTERISK_VOICEMAIL)
135 $(IPKG_BUILD) $(IDIR_ASTERISK_VOICEMAIL) $(PACKAGE_DIR)
136
137 $(IPKG_ASTERISK_CODEC_ILBC):
138 install -d -m0755 $(IDIR_ASTERISK_CODEC_ILBC)/usr/lib/asterisk/modules
139 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_ilbc.so $(IDIR_ASTERISK_CODEC_ILBC)/usr/lib/asterisk/modules/
140 install -m0755 $(PKG_BUILD_DIR)/formats/format_ilbc.so $(IDIR_ASTERISK_CODEC_ILBC)/usr/lib/asterisk/modules/
141 $(RSTRIP) $(IDIR_ASTERISK_CODEC_ILBC)
142 $(IPKG_BUILD) $(IDIR_ASTERISK_CODEC_ILBC) $(PACKAGE_DIR)
143
144 $(IPKG_ASTERISK_CODEC_LPC10):
145 install -d -m0755 $(IDIR_ASTERISK_CODEC_LPC10)/usr/lib/asterisk/modules
146 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_lpc10.so $(IDIR_ASTERISK_CODEC_LPC10)/usr/lib/asterisk/modules/
147 $(RSTRIP) $(IDIR_ASTERISK_CODEC_LPC10)
148 $(IPKG_BUILD) $(IDIR_ASTERISK_CODEC_LPC10) $(PACKAGE_DIR)
149
150 $(IPKG_ASTERISK_CODEC_SPEEX):
151 install -d -m0755 $(IDIR_ASTERISK_CODEC_SPEEX)/usr/lib/asterisk/modules
152 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_speex.so $(IDIR_ASTERISK_CODEC_SPEEX)/usr/lib/asterisk/modules/
153 $(RSTRIP) $(IDIR_ASTERISK_CODEC_SPEEX)
154 $(IPKG_BUILD) $(IDIR_ASTERISK_CODEC_SPEEX) $(PACKAGE_DIR)
155
156 $(IPKG_ASTERISK_PBX_DUNDI):
157 install -d -m0755 $(IDIR_ASTERISK_PBX_DUNDI)/etc/asterisk
158 install -m0644 $(PKG_BUILD_DIR)/configs/dundi.conf.sample $(IDIR_ASTERISK_PBX_DUNDI)/etc/asterisk/dundi.conf
159 install -d -m0755 $(IDIR_ASTERISK_PBX_DUNDI)/usr/lib/asterisk/modules
160 install -m0755 $(PKG_BUILD_DIR)/pbx/pbx_dundi.so $(IDIR_ASTERISK_PBX_DUNDI)/usr/lib/asterisk/modules/
161 $(RSTRIP) $(IDIR_ASTERISK_PBX_DUNDI)
162 $(IPKG_BUILD) $(IDIR_ASTERISK_PBX_DUNDI) $(PACKAGE_DIR)
163
This page took 0.060427 seconds and 5 git commands to generate.