From ec22a1c409ceda04c3dc679c80dbc225006ffa6a Mon Sep 17 00:00:00 2001 From: Michael Iedema Date: Thu, 30 May 2013 18:13:09 +0000 Subject: [PATCH] - basic scaffolding for building an asterisk 11.4.0 package - lots of customization still needed git-svn-id: http://wush.net/svn/range/software/commercial/asterisk/trunk@5653 19bc5d8c-e614-43d4-8b26-e1612bc8e597 --- build.sh | 39 ++++++++++++++ debian/changelog | 5 ++ debian/control | 17 ++++++ debian/postinst | 38 ++++++++++++++ debian/postrm | 37 +++++++++++++ debian/preinst | 35 +++++++++++++ debian/prerm | 37 +++++++++++++ debian/rules | 125 ++++++++++++++++++++++++++++++++++++++++++++ menuselect.makeopts | 105 +++++++++++++++++++++++++++++++++++++ 9 files changed, 438 insertions(+) create mode 100755 build.sh create mode 100644 debian/changelog create mode 100755 debian/control create mode 100755 debian/postinst create mode 100755 debian/postrm create mode 100755 debian/preinst create mode 100755 debian/prerm create mode 100755 debian/rules create mode 100644 menuselect.makeopts diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..500a580 --- /dev/null +++ b/build.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +VERSION=11.4.0 + +sayAndDo () { + echo $@ + eval $@ + if [ $? -ne 0 ] + then + echo "ERROR: command failed!" + exit 1 + fi +} + +installIfMissing () { + dpkg -s $@ > /dev/null + if [ $? -ne 0 ]; then + echo " - oops, missing $@, installing" + sudo apt-get install $@ + else + echo " - $@ ok" + fi + echo +} + +if [ ! -f asterisk-$VERSION.tar.gz ] +then + sayAndDo wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-$VERSION.tar.gz +fi + +if [ ! -d asterisk-$VERSION ] +then + sayAndDo tar zxf asterisk-$VERSION.tar.gz +fi + +sayAndDo cp menuselect.makeopts asterisk-$VERSION +sayAndDo cp -R debian asterisk-$VERSION/ +sayAndDo cd asterisk-$VERSION +sayAndDo dpkg-buildpackage diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..a87f5a4 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +asterisk (11.4.0) UNRELEASED; urgency=low + + * Test + + -- Michael Iedema Thu, 30 May 2013 00:11:00 -0700 diff --git a/debian/control b/debian/control new file mode 100755 index 0000000..a207d84 --- /dev/null +++ b/debian/control @@ -0,0 +1,17 @@ +Source: asterisk +Section: comm +Priority: optional +Maintainer: Range Networks, Inc. +Homepage: http://www.rangenetworks.com/ +Build-Depends: build-essential, debhelper (>= 7), pkg-config, autoconf +Standards-Version: 3.7.3 + +Package: asterisk +Version: 11.4.0 +Section: comm +Priority: optional +Architecture: i386 +Essential: no +Depends: sqlite, sqlite3, libosip2-4, libglib2.0-0, libgl1-mesa-glx, libc6-i686, libasound2, pkg-config, libpcre3, gawk +Description: Asterisk Communication Framework. + diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..65c3918 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,38 @@ +#!/bin/sh +# postinst script for test +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100755 index 0000000..eb728f6 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,37 @@ +#!/bin/sh +# postrm script for test +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/preinst b/debian/preinst new file mode 100755 index 0000000..db74382 --- /dev/null +++ b/debian/preinst @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for test +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm b/debian/prerm new file mode 100755 index 0000000..851f8a3 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,37 @@ +#!/bin/sh +# prerm script for test +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + remove|upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..80f80f9 --- /dev/null +++ b/debian/rules @@ -0,0 +1,125 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# Never distribute source control meta information +export DH_ALWAYS_EXCLUDE=.svn:.git + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +configure: + ./bootstrap.sh + +config: configure-stamp +configure-stamp: configure + dh_testdir + # Add here commands to configure the package. + ./configure --disable-xmldoc $(confflags) + touch configure-stamp + +#Architecture +build: build-arch build-indep + +build-arch: build-arch-stamp +build-arch-stamp: configure-stamp + + # Add here commands to compile the arch part of the package. + #$(MAKE) + touch $@ + +build-indep: build-indep-stamp +build-indep-stamp: configure-stamp + + # Add here commands to compile the indep part of the package. + #$(MAKE) doc + touch $@ + +clean: config + dh_testdir + dh_testroot + rm -f build-arch-stamp build-indep-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: install-indep install-arch +install-indep: + dh_testdir + dh_testroot + dh_clean -k -i + dh_installdirs -i + + # Add here commands to install the indep part of the package into + # debian/-doc. + #INSTALLDOC# +# $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + dh_install -i + +install-arch: + dh_testdir + dh_testroot + dh_clean -k -s + dh_installdirs -s + + # Add here commands to install the arch part of the package into + # debian/tmp. + $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + + dh_install -s + +# Must not depend on anything. This is to be called by +# binary-arch/binary-indep +# in another 'make' thread. +binary-common: + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs +# dh_installexamples +# dh_installmenu +# dh_installdebconf + dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python + dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link +# dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +# Build architecture independant packages using the common target. +binary-indep: build-indep install-indep + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +binary-arch: build-arch install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch config + diff --git a/menuselect.makeopts b/menuselect.makeopts new file mode 100644 index 0000000..c58516d --- /dev/null +++ b/menuselect.makeopts @@ -0,0 +1,105 @@ +MENUSELECT_ADDONS=chan_mobile chan_ooh323 format_mp3 res_config_mysql app_mysql app_saycountpl cdr_mysql +MENUSELECT_APPS=app_flash app_skel app_dahdiras app_fax app_ivrdemo app_jack app_meetme app_osplookup app_saycounted app_dahdibarge app_readfile app_setcallerid +MENUSELECT_BRIDGES= +MENUSELECT_CDR=cdr_adaptive_odbc cdr_odbc cdr_pgsql cdr_radius cdr_tds cdr_sqlite +MENUSELECT_CEL=cel_odbc cel_pgsql cel_radius cel_tds +MENUSELECT_CHANNELS=chan_dahdi chan_motif chan_alsa chan_console chan_misdn chan_nbs chan_vpb chan_gtalk chan_h323 chan_jingle +MENUSELECT_CODECS=codec_dahdi codec_speex +MENUSELECT_FORMATS=format_ogg_vorbis +MENUSELECT_FUNCS=func_curl func_odbc func_speex +MENUSELECT_PBX=pbx_dundi pbx_lua +MENUSELECT_RES=res_calendar_caldav res_calendar_ews res_calendar_exchange res_calendar_icalendar res_config_curl res_config_odbc res_crypto res_curl res_http_post res_odbc res_srtp res_timing_dahdi res_xmpp res_config_ldap res_config_pgsql res_config_sqlite res_corosync res_fax_spandsp res_pktccops res_snmp res_timing_kqueue res_jabber +MENUSELECT_TESTS=test_abstract_jb test_acl test_amihooks test_aoc test_app test_ast_format_str_reduce test_astobj2 test_astobj2_thrash test_config test_db test_devicestate test_dlinklists test_event test_expr test_format_api test_func_file test_gosub test_hashtab_thrash test_heap test_jitterbuf test_linkedlists test_locale test_logger test_netsock2 test_pbx test_poll test_sched test_security_events test_skel test_stringfields test_strings test_substitution test_time test_utils test_voicemail_api test_xml_escape +MENUSELECT_CFLAGS=LOADABLE_MODULES +MENUSELECT_OPTS_app_voicemail=FILE_STORAGE +MENUSELECT_UTILS=astcanary astdb2sqlite3 astdb2bdb +MENUSELECT_AGIS= +MENUSELECT_EMBED= +MENUSELECT_CORE_SOUNDS=CORE-SOUNDS-EN-GSM +MENUSELECT_MOH=MOH-OPSOUND-WAV +MENUSELECT_EXTRA_SOUNDS= +MENUSELECT_BUILD_DEPS=chan_local app_voicemail app_confbridge res_monitor res_agi res_adsi res_smdi res_http_websocket res_ael_share G711_NEW_ALGORITHM +MENUSELECT_DEPSFAILED=MENUSELECT_APPS=app_flash +MENUSELECT_DEPSFAILED=MENUSELECT_APPS=app_dahdiras +MENUSELECT_DEPSFAILED=MENUSELECT_APPS=app_jack +MENUSELECT_DEPSFAILED=MENUSELECT_APPS=app_osplookup +MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_adaptive_odbc +MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_odbc +MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_pgsql +MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_radius +MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_tds +MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_odbc +MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_pgsql +MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_radius +MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_tds +MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_dahdi +MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_motif +MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_alsa +MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_console +MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_misdn +MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_nbs +MENUSELECT_DEPSFAILED=MENUSELECT_CODECS=codec_dahdi +MENUSELECT_DEPSFAILED=MENUSELECT_CODECS=codec_speex +MENUSELECT_DEPSFAILED=MENUSELECT_FORMATS=format_ogg_vorbis +MENUSELECT_DEPSFAILED=MENUSELECT_FUNCS=func_curl +MENUSELECT_DEPSFAILED=MENUSELECT_FUNCS=func_odbc +MENUSELECT_DEPSFAILED=MENUSELECT_FUNCS=func_speex +MENUSELECT_DEPSFAILED=MENUSELECT_PBX=pbx_dundi +MENUSELECT_DEPSFAILED=MENUSELECT_PBX=pbx_lua +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_calendar_caldav +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_calendar_ews +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_calendar_exchange +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_calendar_icalendar +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_config_curl +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_config_odbc +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_crypto +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_curl +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_http_post +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_odbc +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_srtp +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_timing_dahdi +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_xmpp +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_config_ldap +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_config_pgsql +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_config_sqlite +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_corosync +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_fax_spandsp +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_snmp +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_timing_kqueue +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_abstract_jb +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_acl +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_amihooks +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aoc +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_app +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_ast_format_str_reduce +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_astobj2 +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_astobj2_thrash +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_config +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_db +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_devicestate +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dlinklists +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_event +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_expr +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_format_api +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_func_file +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_gosub +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_hashtab_thrash +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_heap +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_jitterbuf +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_linkedlists +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_locale +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_logger +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_netsock2 +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_pbx +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_poll +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sched +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_security_events +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_skel +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stringfields +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_strings +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_substitution +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_time +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_utils +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_voicemail_api +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_xml_escape +MENUSELECT_DEPSFAILED=MENUSELECT_CFLAGS=BUILD_NATIVE