remove -L/usr/lib in pcre-config,
[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://ftp.digium.com/pub/asterisk/ ftp://ftp.digium.com/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_CHAN_BLUETOOTH,asterisk-chan-bluetooth,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
23 $(eval $(call PKG_template,ASTERISK_CODEC_LPC10,asterisk-codec-lpc10,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
24 $(eval $(call PKG_template,ASTERISK_CODEC_SPEEX,asterisk-codec-speex,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
25 $(eval $(call PKG_template,ASTERISK_PBX_DUNDI,asterisk-pbx-dundi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
26
27 ifneq ($(DEVELOPER),)
28 APPS:=app_sql_mysql.so app_sql_postgres.so
29 MODS:=cdr_mysql.so cdr_pgsql.so
30 SPEEX:=codec_speex.so
31 else
32 APPS:=
33 MODS:=
34 ifneq ($(BR2_PACKAGE_ASTERISK_MYSQL),)
35 APPS += app_sql_mysql.so
36 MODS += cdr_mysql.so
37 endif
38 ifneq ($(BR2_PACKAGE_ASTERISK_PGSQL),)
39 APPS += app_sql_postgres.so
40 MODS += cdr_pgsql.so
41 endif
42 ifneq ($(BR2_PACKAGE_ASTERISK_CODEC_SPEEX),)
43 SPEEX:=codec_speex.so
44 endif
45 endif
46
47 $(PKG_BUILD_DIR)/.configured:
48 touch $@
49
50 $(PKG_BUILD_DIR)/.built:
51 $(MAKE) -C "$(PKG_BUILD_DIR)/channels" \
52 CC="$(HOSTCC)" \
53 gentone
54 $(MAKE) -C "$(PKG_BUILD_DIR)" \
55 CC_FOR_BUILD="$(HOSTCC)" \
56 $(TARGET_CONFIGURE_OPTS) \
57 OPTIMIZE="$(TARGET_CFLAGS)" \
58 PROC="$(ARCH)" \
59 CFLAGS_EXTRA="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/speex" \
60 LDFLAGS_EXTRA="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/mysql" \
61 CRYPTO_LIBS="-L$(STAGING_DIR)/usr/lib -Wl,-Bstatic -lssl -lcrypto -Wl,-Bdynamic" \
62 EXTRA_APPS="$(APPS)" \
63 EXTRA_MODS="$(MODS)" \
64 MODSPEEX="$(SPEEX)"
65 touch $@
66
67 $(IPKG_ASTERISK):
68 $(MAKE) -C $(PKG_BUILD_DIR) \
69 DESTDIR="$(IDIR_ASTERISK)" \
70 install samples
71 rm -rf $(IDIR_ASTERISK)/usr/sbin/astgenkey
72 rm -rf $(IDIR_ASTERISK)/usr/bin
73 rm -rf $(IDIR_ASTERISK)/usr/share
74 rm -rf $(IDIR_ASTERISK)/usr/include
75 rm -rf $(IDIR_ASTERISK)/var
76 (cd $(IDIR_ASTERISK)/usr/lib/asterisk; \
77 rm -rf agi-bin/*; \
78 rm -rf firmware; \
79 rm -rf images; \
80 rm -rf keys/*; \
81 rm -rf mohmp3; \
82 rm -rf sounds/*; \
83 cd modules; \
84 rm -rf *adsi* *festival* *modem* *meetme* *oss* *phone* *intercom* \
85 *mp3* *nbscat* *mysql* *postgres* *pgsql* *voicemail* *speex* \
86 *musiconhold* *zapateller* *jpeg*; \
87 rm -f {codec,format}_ilbc.so ; \
88 rm -f codec_lpc10.so ; \
89 rm -f chan_bluetooth.so ; \
90 rm -f pbx_dundi.so ; \
91 )
92 (cd $(IDIR_ASTERISK)/etc/asterisk; \
93 rm -f *odbc* *mysql* *postgres* *pgsql* *voicemail* *adsi* *oss* *alsa* \
94 *festival* *modem* *meetme* *phone* *tds* *vofr* *rpt* *vpb* \
95 *zapata* *musiconhold*; \
96 rm -f bluetooth.conf ; \
97 rm -f dundi.conf ; \
98 )
99 install -d -m0755 $(IDIR_ASTERISK)/etc/default
100 install -m0644 ./files/asterisk.default $(IDIR_ASTERISK)/etc/default/asterisk
101 install -d -m0755 $(IDIR_ASTERISK)/etc/init.d
102 install -m0755 ./files/asterisk.init $(IDIR_ASTERISK)/etc/init.d/asterisk
103 ln -sf asterisk $(IDIR_ASTERISK)/etc/init.d/S60asterisk
104 $(RSTRIP) $(IDIR_ASTERISK)
105 $(IPKG_BUILD) $(IDIR_ASTERISK) $(PACKAGE_DIR)
106
107 $(IPKG_ASTERISK_MYSQL):
108 install -d -m0755 $(IDIR_ASTERISK_MYSQL)/etc/asterisk
109 install -m0600 $(PKG_BUILD_DIR)/configs/cdr_mysql.conf.sample $(IDIR_ASTERISK_MYSQL)/etc/asterisk/cdr_mysql.conf
110 install -d -m0755 $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules
111 install -m0755 $(PKG_BUILD_DIR)/apps/app_sql_mysql.so $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/
112 install -m0755 $(PKG_BUILD_DIR)/cdr/cdr_mysql.so $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/
113 $(RSTRIP) $(IDIR_ASTERISK_MYSQL)
114 $(IPKG_BUILD) $(IDIR_ASTERISK_MYSQL) $(PACKAGE_DIR)
115
116 $(IPKG_ASTERISK_PGSQL):
117 install -d -m0755 $(IDIR_ASTERISK_PGSQL)/etc/asterisk
118 install -m0600 $(PKG_BUILD_DIR)/configs/cdr_pgsql.conf.sample $(IDIR_ASTERISK_PGSQL)/etc/asterisk/cdr_pgsql.conf
119 install -d -m0755 $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules
120 install -m0755 $(PKG_BUILD_DIR)/apps/app_sql_postgres.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
121 install -m0755 $(PKG_BUILD_DIR)/cdr/cdr_pgsql.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
122 $(RSTRIP) $(IDIR_ASTERISK_PGSQL)
123 $(IPKG_BUILD) $(IDIR_ASTERISK_PGSQL) $(PACKAGE_DIR)
124
125 $(IPKG_ASTERISK_SOUNDS):
126 install -d -m0755 $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds
127 cp -fpR $(PKG_BUILD_DIR)/sounds/* $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/
128 rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/*.mp3
129 rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/vm-*
130 $(IPKG_BUILD) $(IDIR_ASTERISK_SOUNDS) $(PACKAGE_DIR)
131
132 $(IPKG_ASTERISK_VOICEMAIL):
133 install -d -m0755 $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk
134 install -m0644 $(PKG_BUILD_DIR)/configs/voicemail.conf.sample $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk/voicemail.conf
135 install -d -m0755 $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules
136 install -m0755 $(PKG_BUILD_DIR)/apps/*voicemail.so $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules/
137 $(RSTRIP) $(IDIR_ASTERISK_VOICEMAIL)
138 $(IPKG_BUILD) $(IDIR_ASTERISK_VOICEMAIL) $(PACKAGE_DIR)
139
140 $(IPKG_ASTERISK_CHAN_BLUETOOTH):
141 install -d -m0755 $(IDIR_ASTERISK_CHAN_BLUETOOTH)/etc/asterisk
142 install -m0644 $(PKG_BUILD_DIR)/configs/bluetooth.conf $(IDIR_ASTERISK_CHAN_BLUETOOTH)/etc/asterisk/bluetooth.conf
143 install -d -m0755 $(IDIR_ASTERISK_CHAN_BLUETOOTH)/usr/lib/asterisk/modules
144 install -m0755 $(PKG_BUILD_DIR)/channels/chan_bluetooth.so $(IDIR_ASTERISK_CHAN_BLUETOOTH)/usr/lib/asterisk/modules/
145 $(RSTRIP) $(IDIR_ASTERISK_CHAN_BLUETOOTH)
146 $(IPKG_BUILD) $(IDIR_ASTERISK_CHAN_BLUETOOTH) $(PACKAGE_DIR)
147
148 $(IPKG_ASTERISK_CODEC_ILBC):
149 install -d -m0755 $(IDIR_ASTERISK_CODEC_ILBC)/usr/lib/asterisk/modules
150 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_ilbc.so $(IDIR_ASTERISK_CODEC_ILBC)/usr/lib/asterisk/modules/
151 install -m0755 $(PKG_BUILD_DIR)/formats/format_ilbc.so $(IDIR_ASTERISK_CODEC_ILBC)/usr/lib/asterisk/modules/
152 $(RSTRIP) $(IDIR_ASTERISK_CODEC_ILBC)
153 $(IPKG_BUILD) $(IDIR_ASTERISK_CODEC_ILBC) $(PACKAGE_DIR)
154
155 $(IPKG_ASTERISK_CODEC_LPC10):
156 install -d -m0755 $(IDIR_ASTERISK_CODEC_LPC10)/usr/lib/asterisk/modules
157 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_lpc10.so $(IDIR_ASTERISK_CODEC_LPC10)/usr/lib/asterisk/modules/
158 $(RSTRIP) $(IDIR_ASTERISK_CODEC_LPC10)
159 $(IPKG_BUILD) $(IDIR_ASTERISK_CODEC_LPC10) $(PACKAGE_DIR)
160
161 $(IPKG_ASTERISK_CODEC_SPEEX):
162 install -d -m0755 $(IDIR_ASTERISK_CODEC_SPEEX)/usr/lib/asterisk/modules
163 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_speex.so $(IDIR_ASTERISK_CODEC_SPEEX)/usr/lib/asterisk/modules/
164 $(RSTRIP) $(IDIR_ASTERISK_CODEC_SPEEX)
165 $(IPKG_BUILD) $(IDIR_ASTERISK_CODEC_SPEEX) $(PACKAGE_DIR)
166
167 $(IPKG_ASTERISK_PBX_DUNDI):
168 install -d -m0755 $(IDIR_ASTERISK_PBX_DUNDI)/etc/asterisk
169 install -m0644 $(PKG_BUILD_DIR)/configs/dundi.conf.sample $(IDIR_ASTERISK_PBX_DUNDI)/etc/asterisk/dundi.conf
170 install -d -m0755 $(IDIR_ASTERISK_PBX_DUNDI)/usr/lib/asterisk/modules
171 install -m0755 $(PKG_BUILD_DIR)/pbx/pbx_dundi.so $(IDIR_ASTERISK_PBX_DUNDI)/usr/lib/asterisk/modules/
172 $(RSTRIP) $(IDIR_ASTERISK_PBX_DUNDI)
173 $(IPKG_BUILD) $(IDIR_ASTERISK_PBX_DUNDI) $(PACKAGE_DIR)
174
This page took 0.051532 seconds and 5 git commands to generate.