1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-28 16:54:15 +02:00

convert asterisk to new packaging style

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@841 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2005-05-12 18:58:48 +00:00
parent 363746833c
commit 132cde90ca
10 changed files with 64 additions and 186 deletions

View File

@ -12,74 +12,29 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_CAT:=zcat PKG_CAT:=zcat
PKG_APP:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk include $(TOPDIR)/package/rules.mk
PKG_APP_DIR:=$(PKG_BUILD_DIR)/ipkg/asterisk $(eval $(call PKG_template,ASTERISK,asterisk,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,ASTERISK_MYSQL,asterisk-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
PKG_MYSQL:=$(PACKAGE_DIR)/$(PKG_NAME)-mysql_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk $(eval $(call PKG_template,ASTERISK_PGSQL,asterisk-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
PKG_MYSQL_DIR:=$(PKG_BUILD_DIR)/ipkg/mysql $(eval $(call PKG_template,ASTERISK_VOICEMAIL,asterisk-voicemail,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,ASTERISK_SOUNDS,asterisk-sounds,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
PKG_PGSQL:=$(PACKAGE_DIR)/$(PKG_NAME)-pgsql_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk $(eval $(call PKG_template,ASTERISK_SPEEX,asterisk-codec-speex,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
PKG_PGSQL_DIR:=$(PKG_BUILD_DIR)/ipkg/pgsql
PKG_SPEEX:=$(PACKAGE_DIR)/$(PKG_NAME)-codec-speex_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
PKG_SPEEX_DIR:=$(PKG_BUILD_DIR)/ipkg/speex
PKG_SOUNDS:=$(PACKAGE_DIR)/$(PKG_NAME)-sounds_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
PKG_SOUNDS_DIR:=$(PKG_BUILD_DIR)/ipkg/sounds
PKG_VOICEMAIL:=$(PACKAGE_DIR)/$(PKG_NAME)-voicemail_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
PKG_VOICEMAIL_DIR:=$(PKG_BUILD_DIR)/ipkg/voicemail
APPS:= APPS:=
MODS:= MODS:=
COMPILE_TARGETS:=$(PKG_APP)
INSTALL_TARGETS:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list
ifneq ($(BR2_PACKAGE_ASTERISK_MYSQL),) ifneq ($(BR2_PACKAGE_ASTERISK_MYSQL),)
APPS += app_sql_mysql.so APPS += app_sql_mysql.so
MODS += cdr_mysql.so MODS += cdr_mysql.so
COMPILE_TARGETS += $(PKG_MYSQL)
endif endif
ifneq ($(BR2_PACKAGE_ASTERISK_PGSQL),) ifneq ($(BR2_PACKAGE_ASTERISK_PGSQL),)
APPS += app_sql_postgres.so APPS += app_sql_postgres.so
MODS += cdr_pgsql.so MODS += cdr_pgsql.so
COMPILE_TARGETS += $(PKG_PGSQL)
endif
ifneq ($(BR2_PACKAGE_ASTERISK_SOUNDS),)
COMPILE_TARGETS += $(PKG_SOUNDS)
endif endif
ifneq ($(BR2_PACKAGE_ASTERISK_SPEEX),) ifneq ($(BR2_PACKAGE_ASTERISK_SPEEX),)
SPEEX:=codec_speex.so SPEEX:=codec_speex.so
COMPILE_TARGETS += $(PKG_SPEEX)
endif
ifneq ($(BR2_PACKAGE_ASTERISK_VOICEMAIL),)
COMPILE_TARGETS += $(PKG_VOICEMAIL)
endif
ifeq ($(BR2_PACKAGE_ASTERISK_MYSQL),y)
INSTALL_TARGETS:=$(IPKG_STATE_DIR)/info/$(PKG_NAME)-mysql.list
endif
ifeq ($(BR2_PACKAGE_ASTERISK_PGSQL),y)
INSTALL_TARGETS:=$(IPKG_STATE_DIR)/info/$(PKG_NAME)-pgsql.list
endif
ifeq ($(BR2_PACKAGE_ASTERISK_VOICEMAIL),y)
INSTALL_TARGETS:=$(IPKG_STATE_DIR)/info/$(PKG_NAME)-voicemail.list
endif
ifeq ($(BR2_PACKAGE_ASTERISK_SOUNDS),y)
INSTALL_TARGETS:=$(IPKG_STATE_DIR)/info/$(PKG_NAME)-sounds.list
endif
ifeq ($(BR2_PACKAGE_ASTERISK_SPEEX),y)
INSTALL_TARGETS:=$(IPKG_STATE_DIR)/info/$(PKG_NAME)-codec-speex.list
endif endif
$(DL_DIR)/$(PKG_SOURCE): asterisk-compile: $(PKG_BUILD_DIR)/.prepared
$(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
$(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE)
$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
$(PATCH) $(PKG_BUILD_DIR) ./patches
touch $(PKG_BUILD_DIR)/.patched
asterisk-compile: $(PKG_BUILD_DIR)/.patched
$(MAKE) -C "$(PKG_BUILD_DIR)/channels" \ $(MAKE) -C "$(PKG_BUILD_DIR)/channels" \
CC="$(HOSTCC)" \ CC="$(HOSTCC)" \
gentone gentone
@ -94,18 +49,20 @@ asterisk-compile: $(PKG_BUILD_DIR)/.patched
EXTRA_APPS="$(APPS)" \ EXTRA_APPS="$(APPS)" \
EXTRA_MODS="$(MODS)" \ EXTRA_MODS="$(MODS)" \
MODSPEEX="$(SPEEX)" MODSPEEX="$(SPEEX)"
$(PKG_APP): asterisk-compile $(PKG_BUILD_DIR)/.built: asterisk-compile
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_APP_DIR) control/$(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) touch $@
$(IPKG_ASTERISK): asterisk-compile
$(MAKE) -C $(PKG_BUILD_DIR) \ $(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_APP_DIR)" \ DESTDIR="$(IDIR_ASTERISK)" \
install samples install samples
rm -rf $(PKG_APP_DIR)/usr/sbin/astgenkey rm -rf $(IDIR_ASTERISK)/usr/sbin/astgenkey
rm -rf $(PKG_APP_DIR)/usr/bin rm -rf $(IDIR_ASTERISK)/usr/bin
rm -rf $(PKG_APP_DIR)/usr/share rm -rf $(IDIR_ASTERISK)/usr/share
rm -rf $(PKG_APP_DIR)/usr/include rm -rf $(IDIR_ASTERISK)/usr/include
rm -rf $(PKG_APP_DIR)/var rm -rf $(IDIR_ASTERISK)/var
(cd $(PKG_APP_DIR)/usr/lib/asterisk; \ (cd $(IDIR_ASTERISK)/usr/lib/asterisk; \
rm -rf agi-bin/*; \ rm -rf agi-bin/*; \
rm -rf firmware; \ rm -rf firmware; \
rm -rf images; \ rm -rf images; \
@ -117,94 +74,53 @@ $(PKG_APP): asterisk-compile
*mp3* *nbscat* *mysql* *postgres* *pgsql* *voicemail* *speex* \ *mp3* *nbscat* *mysql* *postgres* *pgsql* *voicemail* *speex* \
*musiconhold* *zapateller* *jpeg*; \ *musiconhold* *zapateller* *jpeg*; \
) )
(cd $(PKG_APP_DIR)/etc/asterisk; \ (cd $(IDIR_ASTERISK)/etc/asterisk; \
rm -f *odbc* *mysql* *postgres* *pgsql* *voicemail* *adsi* *oss* *alsa* \ rm -f *odbc* *mysql* *postgres* *pgsql* *voicemail* *adsi* *oss* *alsa* \
*festival* *modem* *meetme* *phone* *tds* *vofr* *rpt* *vpb* \ *festival* *modem* *meetme* *phone* *tds* *vofr* *rpt* *vpb* \
*zapata* *musiconhold*; \ *zapata* *musiconhold*; \
) )
-$(STRIP) $(PKG_APP_DIR)/usr/sbin/asterisk -$(STRIP) $(IDIR_ASTERISK)/usr/sbin/asterisk
-$(STRIP) $(PKG_APP_DIR)/usr/lib/asterisk/modules/* -$(STRIP) $(IDIR_ASTERISK)/usr/lib/asterisk/modules/*
cp -a ./files/* $(PKG_APP_DIR)/ cp -a ./files/* $(IDIR_ASTERISK)/
find $(PKG_APP_DIR) -name CVS | xargs rm -rf find $(IDIR_ASTERISK) -name CVS | xargs rm -rf
chmod +x $(PKG_APP_DIR)/etc/init.d/* chmod +x $(IDIR_ASTERISK)/etc/init.d/*
mkdir -p $(PACKAGE_DIR) $(IPKG_BUILD) $(IDIR_ASTERISK) $(PACKAGE_DIR)
$(IPKG_BUILD) $(PKG_APP_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_APP) $(IPKG_ASTERISK_MYSQL): asterisk-compile
$(IPKG) install $(PKG_APP) mkdir -p $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules
mkdir -p $(IDIR_ASTERISK_MYSQL)/etc/asterisk
cp $(PKG_BUILD_DIR)/apps/app_sql_mysql.so $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/
cp $(PKG_BUILD_DIR)/cdr/cdr_mysql.so $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/
$(STRIP) $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/*
cp $(PKG_BUILD_DIR)/configs/cdr_mysql.conf.sample $(IDIR_ASTERISK_MYSQL)/etc/asterisk/cdr_mysql.conf
$(IPKG_BUILD) $(IDIR_ASTERISK_MYSQL) $(PACKAGE_DIR)
$(PKG_MYSQL): asterisk-compile $(IPKG_ASTERISK_PGSQL): asterisk-compile
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_MYSQL_DIR) control/$(PKG_NAME)-mysql.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) mkdir -p $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules
mkdir -p $(PKG_MYSQL_DIR)/usr/lib/asterisk/modules mkdir -p $(IDIR_ASTERISK_PGSQL)/etc/asterisk
mkdir -p $(PKG_MYSQL_DIR)/etc/asterisk cp $(PKG_BUILD_DIR)/apps/app_sql_postgres.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
cp $(PKG_BUILD_DIR)/apps/app_sql_mysql.so $(PKG_MYSQL_DIR)/usr/lib/asterisk/modules/ cp $(PKG_BUILD_DIR)/cdr/cdr_pgsql.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
cp $(PKG_BUILD_DIR)/cdr/cdr_mysql.so $(PKG_MYSQL_DIR)/usr/lib/asterisk/modules/ $(STRIP) $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/*
$(STRIP) $(PKG_MYSQL_DIR)/usr/lib/asterisk/modules/* cp $(PKG_BUILD_DIR)/configs/cdr_pgsql.conf.sample $(IDIR_ASTERISK_PGSQL)/etc/asterisk/cdr_pgsql.conf
echo /etc/asterisk/cdr_mysql.conf > $(PKG_MYSQL_DIR)/CONTROL/conffiles $(IPKG_BUILD) $(IDIR_ASTERISK_PGSQL) $(PACKAGE_DIR)
cp $(PKG_BUILD_DIR)/configs/cdr_mysql.conf.sample $(PKG_MYSQL_DIR)/etc/asterisk/cdr_mysql.conf
mkdir -p $(PACKAGE_DIR)
$(IPKG_BUILD) $(PKG_MYSQL_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/$(PKG_NAME)-mysql.list: $(PKG_MYSQL) $(IPKG_ASTERISK_SOUNDS): asterisk-compile
$(IPKG) install $(PKG_MYSQL) mkdir -p $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds
cp -a $(PKG_BUILD_DIR)/sounds/* $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/
rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/*.mp3
rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/vm-*
$(IPKG_BUILD) $(IDIR_ASTERISK_SOUNDS) $(PACKAGE_DIR)
$(PKG_PGSQL): asterisk-compile $(IPKG_ASTERISK_SPEEX): asterisk-compile
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_PGSQL_DIR) control/$(PKG_NAME)-pgsql.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) mkdir -p $(IDIR_ASTERISK_SPEEX)/usr/lib/asterisk/modules
mkdir -p $(PKG_PGSQL_DIR)/usr/lib/asterisk/modules cp $(PKG_BUILD_DIR)/codecs/*speex.so $(IDIR_ASTERISK_SPEEX)/usr/lib/asterisk/modules
mkdir -p $(PKG_PGSQL_DIR)/etc/asterisk $(STRIP) $(IDIR_ASTERISK_SPEEX)/usr/lib/asterisk/modules/*
cp $(PKG_BUILD_DIR)/apps/app_sql_postgres.so $(PKG_PGSQL_DIR)/usr/lib/asterisk/modules/ $(IPKG_BUILD) $(IDIR_ASTERISK_SPEEX) $(PACKAGE_DIR)
cp $(PKG_BUILD_DIR)/cdr/cdr_pgsql.so $(PKG_PGSQL_DIR)/usr/lib/asterisk/modules/
$(STRIP) $(PKG_PGSQL_DIR)/usr/lib/asterisk/modules/*
echo /etc/asterisk/cdr_pgsql.conf > $(PKG_PGSQL_DIR)/CONTROL/conffiles
cp $(PKG_BUILD_DIR)/configs/cdr_pgsql.conf.sample $(PKG_PGSQL_DIR)/etc/asterisk/cdr_pgsql.conf
mkdir -p $(PACKAGE_DIR)
$(IPKG_BUILD) $(PKG_PGSQL_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/$(PKG_NAME)-pgsql.list: $(PKG_PGSQL) $(IPKG_ASTERISK_VOICEMAIL): asterisk-compile
$(IPKG) install $(PKG_PGSQL) mkdir -p $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk
cp $(PKG_BUILD_DIR)/configs/voicemail.conf.sample $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk/voicemail.conf
$(PKG_SOUNDS): asterisk-compile mkdir -p $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_SOUNDS_DIR) control/$(PKG_NAME)-sounds.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) cp $(PKG_BUILD_DIR)/apps/*voicemail.so $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules
mkdir -p $(PKG_SOUNDS_DIR)/usr/lib/asterisk/sounds $(STRIP) $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules/*
cp -a $(PKG_BUILD_DIR)/sounds/* $(PKG_SOUNDS_DIR)/usr/lib/asterisk/sounds/ $(IPKG_BUILD) $(IDIR_ASTERISK_VOICEMAIL) $(PACKAGE_DIR)
rm -f $(PKG_SOUNDS_DIR)/usr/lib/asterisk/sounds/*.mp3
rm -f $(PKG_SOUNDS_DIR)/usr/lib/asterisk/sounds/vm-*
mkdir -p $(PACKAGE_DIR)
$(IPKG_BUILD) $(PKG_SOUNDS_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/$(PKG_NAME)-sounds.list: $(PKG_SOUNDS)
$(IPKG) install $(PKG_SOUNDS)
$(PKG_SPEEX): asterisk-compile
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_SPEEX_DIR) control/$(PKG_NAME)-codec-speex.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
mkdir -p $(PKG_SPEEX_DIR)/usr/lib/asterisk/modules
cp $(PKG_BUILD_DIR)/codecs/*speex.so $(PKG_SPEEX_DIR)/usr/lib/asterisk/modules
$(STRIP) $(PKG_SPEEX_DIR)/usr/lib/asterisk/modules/*
mkdir -p $(PACKAGE_DIR)
$(IPKG_BUILD) $(PKG_SPEEX_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/$(PKG_NAME)-speex.list: $(PKG_SPEEX)
$(IPKG) install $(PKG_SPEEX)
$(PKG_VOICEMAIL): asterisk-compile
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_VOICEMAIL_DIR) control/$(PKG_NAME)-voicemail.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
echo /etc/asterisk/voicemail.conf > $(PKG_VOICEMAIL_DIR)/CONTROL/conffiles
mkdir -p $(PKG_VOICEMAIL_DIR)/etc/asterisk
cp $(PKG_BUILD_DIR)/configs/voicemail.conf.sample $(PKG_VOICEMAIL_DIR)/etc/asterisk/voicemail.conf
mkdir -p $(PKG_VOICEMAIL_DIR)/usr/lib/asterisk/modules
cp $(PKG_BUILD_DIR)/apps/*voicemail.so $(PKG_VOICEMAIL_DIR)/usr/lib/asterisk/modules
$(STRIP) $(PKG_VOICEMAIL_DIR)/usr/lib/asterisk/modules/*
mkdir -p $(PACKAGE_DIR)
$(IPKG_BUILD) $(PKG_VOICEMAIL_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/$(PKG_NAME)-voicemail.list: $(PKG_VOICEMAIL)
$(IPKG) install $(PKG_VOICEMAIL)
source: $(DL_DIR)/$(PKG_SOURCE)
prepare: $(PKG_BUILD_DIR)/.patched
compile: $(COMPILE_TARGETS)
install: $(INSTALL_TARGETS)
clean:
rm -rf $(PKG_BUILD_DIR)
rm -f $(PKG_APP)

View File

@ -1,7 +0,0 @@
Package: asterisk-codec-speex
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: a Speex/PCM16 Codec Translator for Asterisk
Depends: asterisk, libspeex

View File

@ -0,0 +1 @@
/etc/asterisk/cdr_mysql.conf

View File

@ -1,7 +0,0 @@
Package: asterisk-mysql
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: MySQL modules for Asterisk
Depends: asterisk, libmysqlclient, zlib

View File

@ -0,0 +1 @@
/etc/asterisk/cdr_pgsql.conf

View File

@ -1,7 +0,0 @@
Package: asterisk-pgsql
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: PostgreSQL modules for Asterisk
Depends: asterisk, libpq, zlib

View File

@ -1,7 +0,0 @@
Package: asterisk-sounds
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: a sounds collection for Asterisk
Depends: asterisk

View File

@ -0,0 +1 @@
/etc/asterisk/voicemail.conf

View File

@ -1,7 +0,0 @@
Package: asterisk-voicemail
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: VoiceMail related modules for Asterisk
Depends: asterisk

View File

@ -1,6 +0,0 @@
Package: asterisk
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: An open source PBX