Fix openldap build when cyrus-sasl and openssl devel libraries are not installed...
[openwrt.git] / package / asterisk / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=asterisk
6 PKG_VERSION:=1.0.7
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=4cc3c1e4a1b12e0e4c748326ad153291
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_SPEEX,asterisk-codec-speex,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
22
23 APPS:=
24 MODS:=
25 ifneq ($(BR2_PACKAGE_ASTERISK_MYSQL),)
26 APPS += app_sql_mysql.so
27 MODS += cdr_mysql.so
28 endif
29 ifneq ($(BR2_PACKAGE_ASTERISK_PGSQL),)
30 APPS += app_sql_postgres.so
31 MODS += cdr_pgsql.so
32 endif
33 ifneq ($(BR2_PACKAGE_ASTERISK_SPEEX),)
34 SPEEX:=codec_speex.so
35 endif
36
37 asterisk-compile: $(PKG_BUILD_DIR)/.prepared
38 $(MAKE) -C "$(PKG_BUILD_DIR)/channels" \
39 CC="$(HOSTCC)" \
40 gentone
41 $(MAKE) -C "$(PKG_BUILD_DIR)" \
42 CC_FOR_BUILD="$(HOSTCC)" \
43 $(TARGET_CONFIGURE_OPTS) \
44 OPTIMIZE="$(TARGET_CFLAGS)" \
45 PROC="$(ARCH)" \
46 CFLAGS_EXTRA="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include/speex" \
47 LDFLAGS_EXTRA="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/mysql" \
48 CRYPTO_LIBS="-L$(STAGING_DIR)/usr/lib -Wl,-Bstatic -lssl -lcrypto -Wl,-Bdynamic" \
49 EXTRA_APPS="$(APPS)" \
50 EXTRA_MODS="$(MODS)" \
51 MODSPEEX="$(SPEEX)"
52
53 $(PKG_BUILD_DIR)/.built: asterisk-compile
54 touch $@
55
56 $(IPKG_ASTERISK): asterisk-compile
57 $(MAKE) -C $(PKG_BUILD_DIR) \
58 DESTDIR="$(IDIR_ASTERISK)" \
59 install samples
60 rm -rf $(IDIR_ASTERISK)/usr/sbin/astgenkey
61 rm -rf $(IDIR_ASTERISK)/usr/bin
62 rm -rf $(IDIR_ASTERISK)/usr/share
63 rm -rf $(IDIR_ASTERISK)/usr/include
64 rm -rf $(IDIR_ASTERISK)/var
65 (cd $(IDIR_ASTERISK)/usr/lib/asterisk; \
66 rm -rf agi-bin/*; \
67 rm -rf firmware; \
68 rm -rf images; \
69 rm -rf keys/*; \
70 rm -rf mohmp3; \
71 rm -rf sounds/*; \
72 cd modules; \
73 rm -rf *adsi* *festival* *modem* *meetme* *oss* *phone* *intercom* \
74 *mp3* *nbscat* *mysql* *postgres* *pgsql* *voicemail* *speex* \
75 *musiconhold* *zapateller* *jpeg*; \
76 )
77 (cd $(IDIR_ASTERISK)/etc/asterisk; \
78 rm -f *odbc* *mysql* *postgres* *pgsql* *voicemail* *adsi* *oss* *alsa* \
79 *festival* *modem* *meetme* *phone* *tds* *vofr* *rpt* *vpb* \
80 *zapata* *musiconhold*; \
81 )
82 -$(STRIP) $(IDIR_ASTERISK)/usr/sbin/asterisk
83 -$(STRIP) $(IDIR_ASTERISK)/usr/lib/asterisk/modules/*
84 cp -a ./files/* $(IDIR_ASTERISK)/
85 find $(IDIR_ASTERISK) -name CVS | xargs rm -rf
86 chmod +x $(IDIR_ASTERISK)/etc/init.d/*
87 $(IPKG_BUILD) $(IDIR_ASTERISK) $(PACKAGE_DIR)
88
89 $(IPKG_ASTERISK_MYSQL): asterisk-compile
90 mkdir -p $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules
91 mkdir -p $(IDIR_ASTERISK_MYSQL)/etc/asterisk
92 cp $(PKG_BUILD_DIR)/apps/app_sql_mysql.so $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/
93 cp $(PKG_BUILD_DIR)/cdr/cdr_mysql.so $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/
94 $(STRIP) $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/*
95 cp $(PKG_BUILD_DIR)/configs/cdr_mysql.conf.sample $(IDIR_ASTERISK_MYSQL)/etc/asterisk/cdr_mysql.conf
96 $(IPKG_BUILD) $(IDIR_ASTERISK_MYSQL) $(PACKAGE_DIR)
97
98 $(IPKG_ASTERISK_PGSQL): asterisk-compile
99 mkdir -p $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules
100 mkdir -p $(IDIR_ASTERISK_PGSQL)/etc/asterisk
101 cp $(PKG_BUILD_DIR)/apps/app_sql_postgres.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
102 cp $(PKG_BUILD_DIR)/cdr/cdr_pgsql.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
103 $(STRIP) $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/*
104 cp $(PKG_BUILD_DIR)/configs/cdr_pgsql.conf.sample $(IDIR_ASTERISK_PGSQL)/etc/asterisk/cdr_pgsql.conf
105 $(IPKG_BUILD) $(IDIR_ASTERISK_PGSQL) $(PACKAGE_DIR)
106
107 $(IPKG_ASTERISK_SOUNDS): asterisk-compile
108 mkdir -p $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds
109 cp -a $(PKG_BUILD_DIR)/sounds/* $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/
110 rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/*.mp3
111 rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/vm-*
112 $(IPKG_BUILD) $(IDIR_ASTERISK_SOUNDS) $(PACKAGE_DIR)
113
114 $(IPKG_ASTERISK_SPEEX): asterisk-compile
115 mkdir -p $(IDIR_ASTERISK_SPEEX)/usr/lib/asterisk/modules
116 cp $(PKG_BUILD_DIR)/codecs/*speex.so $(IDIR_ASTERISK_SPEEX)/usr/lib/asterisk/modules
117 $(STRIP) $(IDIR_ASTERISK_SPEEX)/usr/lib/asterisk/modules/*
118 $(IPKG_BUILD) $(IDIR_ASTERISK_SPEEX) $(PACKAGE_DIR)
119
120 $(IPKG_ASTERISK_VOICEMAIL): asterisk-compile
121 mkdir -p $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk
122 cp $(PKG_BUILD_DIR)/configs/voicemail.conf.sample $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk/voicemail.conf
123 mkdir -p $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules
124 cp $(PKG_BUILD_DIR)/apps/*voicemail.so $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules
125 $(STRIP) $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules/*
126 $(IPKG_BUILD) $(IDIR_ASTERISK_VOICEMAIL) $(PACKAGE_DIR)
This page took 0.049778 seconds and 5 git commands to generate.