3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:=4cc3c1e4a1b12e0e4c748326ad153291
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
)
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
)))
25 ifneq ($(BR2_PACKAGE_ASTERISK_MYSQL
),)
26 APPS
+= app_sql_mysql.so
29 ifneq ($(BR2_PACKAGE_ASTERISK_PGSQL
),)
30 APPS
+= app_sql_postgres.so
33 ifneq ($(BR2_PACKAGE_ASTERISK_SPEEX
),)
37 asterisk-compile
: $(PKG_BUILD_DIR
)/.prepared
38 $(MAKE
) -C
"$(PKG_BUILD_DIR)/channels" \
41 $(MAKE
) -C
"$(PKG_BUILD_DIR)" \
42 CC_FOR_BUILD
="$(HOSTCC)" \
43 $(TARGET_CONFIGURE_OPTS
) \
44 OPTIMIZE
="$(TARGET_CFLAGS)" \
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)" \
53 $(PKG_BUILD_DIR
)/.configured
:
56 $(PKG_BUILD_DIR
)/.built
: asterisk-compile
59 $(IPKG_ASTERISK
): asterisk-compile
60 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
61 DESTDIR
="$(IDIR_ASTERISK)" \
63 rm -rf
$(IDIR_ASTERISK
)/usr
/sbin
/astgenkey
64 rm -rf
$(IDIR_ASTERISK
)/usr
/bin
65 rm -rf
$(IDIR_ASTERISK
)/usr
/share
66 rm -rf
$(IDIR_ASTERISK
)/usr
/include
67 rm -rf
$(IDIR_ASTERISK
)/var
68 (cd
$(IDIR_ASTERISK
)/usr
/lib
/asterisk
; \
76 rm -rf
*adsi
* *festival
* *modem
* *meetme
* *oss
* *phone
* *intercom
* \
77 *mp3
* *nbscat
* *mysql
* *postgres
* *pgsql
* *voicemail
* *speex
* \
78 *musiconhold
* *zapateller
* *jpeg
*; \
80 (cd
$(IDIR_ASTERISK
)/etc
/asterisk
; \
81 rm -f
*odbc
* *mysql
* *postgres
* *pgsql
* *voicemail
* *adsi
* *oss
* *alsa
* \
82 *festival
* *modem
* *meetme
* *phone
* *tds
* *vofr
* *rpt
* *vpb
* \
83 *zapata
* *musiconhold
*; \
85 -$(STRIP
) $(IDIR_ASTERISK
)/usr
/sbin
/asterisk
86 -$(STRIP
) $(IDIR_ASTERISK
)/usr
/lib
/asterisk
/modules
/*
87 cp
-a .
/files
/* $(IDIR_ASTERISK
)/
88 find
$(IDIR_ASTERISK
) -name CVS | xargs
rm -rf
89 chmod
+x
$(IDIR_ASTERISK
)/etc
/init.d
/*
90 $(IPKG_BUILD
) $(IDIR_ASTERISK
) $(PACKAGE_DIR
)
92 $(IPKG_ASTERISK_MYSQL
): asterisk-compile
93 mkdir
-p
$(IDIR_ASTERISK_MYSQL
)/usr
/lib
/asterisk
/modules
94 mkdir
-p
$(IDIR_ASTERISK_MYSQL
)/etc
/asterisk
95 cp
$(PKG_BUILD_DIR
)/apps
/app_sql_mysql.so
$(IDIR_ASTERISK_MYSQL
)/usr
/lib
/asterisk
/modules
/
96 cp
$(PKG_BUILD_DIR
)/cdr
/cdr_mysql.so
$(IDIR_ASTERISK_MYSQL
)/usr
/lib
/asterisk
/modules
/
97 $(STRIP
) $(IDIR_ASTERISK_MYSQL
)/usr
/lib
/asterisk
/modules
/*
98 cp
$(PKG_BUILD_DIR
)/configs
/cdr_mysql.conf.sample
$(IDIR_ASTERISK_MYSQL
)/etc
/asterisk
/cdr_mysql.conf
99 $(IPKG_BUILD
) $(IDIR_ASTERISK_MYSQL
) $(PACKAGE_DIR
)
101 $(IPKG_ASTERISK_PGSQL
): asterisk-compile
102 mkdir
-p
$(IDIR_ASTERISK_PGSQL
)/usr
/lib
/asterisk
/modules
103 mkdir
-p
$(IDIR_ASTERISK_PGSQL
)/etc
/asterisk
104 cp
$(PKG_BUILD_DIR
)/apps
/app_sql_postgres.so
$(IDIR_ASTERISK_PGSQL
)/usr
/lib
/asterisk
/modules
/
105 cp
$(PKG_BUILD_DIR
)/cdr
/cdr_pgsql.so
$(IDIR_ASTERISK_PGSQL
)/usr
/lib
/asterisk
/modules
/
106 $(STRIP
) $(IDIR_ASTERISK_PGSQL
)/usr
/lib
/asterisk
/modules
/*
107 cp
$(PKG_BUILD_DIR
)/configs
/cdr_pgsql.conf.sample
$(IDIR_ASTERISK_PGSQL
)/etc
/asterisk
/cdr_pgsql.conf
108 $(IPKG_BUILD
) $(IDIR_ASTERISK_PGSQL
) $(PACKAGE_DIR
)
110 $(IPKG_ASTERISK_SOUNDS
): asterisk-compile
111 mkdir
-p
$(IDIR_ASTERISK_SOUNDS
)/usr
/lib
/asterisk
/sounds
112 cp
-a
$(PKG_BUILD_DIR
)/sounds
/* $(IDIR_ASTERISK_SOUNDS
)/usr
/lib
/asterisk
/sounds
/
113 rm -f
$(IDIR_ASTERISK_SOUNDS
)/usr
/lib
/asterisk
/sounds
/*.mp3
114 rm -f
$(IDIR_ASTERISK_SOUNDS
)/usr
/lib
/asterisk
/sounds
/vm-
*
115 $(IPKG_BUILD
) $(IDIR_ASTERISK_SOUNDS
) $(PACKAGE_DIR
)
117 $(IPKG_ASTERISK_SPEEX
): asterisk-compile
118 mkdir
-p
$(IDIR_ASTERISK_SPEEX
)/usr
/lib
/asterisk
/modules
119 cp
$(PKG_BUILD_DIR
)/codecs
/*speex.so
$(IDIR_ASTERISK_SPEEX
)/usr
/lib
/asterisk
/modules
120 $(STRIP
) $(IDIR_ASTERISK_SPEEX
)/usr
/lib
/asterisk
/modules
/*
121 $(IPKG_BUILD
) $(IDIR_ASTERISK_SPEEX
) $(PACKAGE_DIR
)
123 $(IPKG_ASTERISK_VOICEMAIL
): asterisk-compile
124 mkdir
-p
$(IDIR_ASTERISK_VOICEMAIL
)/etc
/asterisk
125 cp
$(PKG_BUILD_DIR
)/configs
/voicemail.conf.sample
$(IDIR_ASTERISK_VOICEMAIL
)/etc
/asterisk
/voicemail.conf
126 mkdir
-p
$(IDIR_ASTERISK_VOICEMAIL
)/usr
/lib
/asterisk
/modules
127 cp
$(PKG_BUILD_DIR
)/apps
/*voicemail.so
$(IDIR_ASTERISK_VOICEMAIL
)/usr
/lib
/asterisk
/modules
128 $(STRIP
) $(IDIR_ASTERISK_VOICEMAIL
)/usr
/lib
/asterisk
/modules
/*
129 $(IPKG_BUILD
) $(IDIR_ASTERISK_VOICEMAIL
) $(PACKAGE_DIR
)