michael@202: ## michael@202: ## asterisk.spec -- OpenPKG RPM Package Specification michael@202: ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. michael@202: ## Copyright (c) 2000-2007 Ralf S. Engelschall michael@202: ## michael@202: ## Permission to use, copy, modify, and distribute this software for michael@202: ## any purpose with or without fee is hereby granted, provided that michael@202: ## the above copyright notice and this permission notice appear in all michael@202: ## copies. michael@202: ## michael@202: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@202: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@202: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@202: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@202: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@202: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@202: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@202: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@202: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@202: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@202: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@202: ## SUCH DAMAGE. michael@202: ## michael@202: michael@202: # package component versions michael@202: %define V_langsounds 1.4.12 michael@202: %define V_extrasounds 1.4.9 michael@202: %define V_amoomasounds 1.4 michael@202: %define V_customsounds 1.0 michael@202: %define V_chan_capi 1.1.2 michael@202: michael@202: # package information michael@202: Name: asterisk michael@202: Summary: Private Branch Exchange (PBX) for VoIP michael@202: URL: http://www.asterisk.org/ michael@202: Vendor: Mark Spencer et al. michael@202: Packager: Michael Schloh von Bennewitz michael@202: Distribution: Michael Schloh von Bennewitz michael@202: Class: EVAL michael@202: Group: VoIP michael@202: License: GPL michael@202: Version: 1.4.24.1 michael@202: Release: 20090422 michael@202: michael@202: # package options michael@202: %option with_libpri yes michael@202: %option with_xfersips yes michael@202: %option with_proxymwi yes michael@202: %option with_parseavp yes michael@202: %option with_radius no michael@202: %option with_sqlite no michael@202: %option with_pgsql no michael@202: %option with_curl no michael@202: %option with_imap no michael@202: %option with_astman no michael@202: %option with_capi no michael@202: %option with_zaptel no michael@202: %option with_smdipoll 10 michael@202: michael@202: # list of sources michael@202: Source0: http://downloads.digium.com/pub/asterisk/releases/asterisk-%{version}.tar.gz michael@202: Source1: ftp://ftp.chan-capi.org/chan-capi/chan_capi-%{V_chan_capi}.tar.gz michael@202: Source2: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-alaw.tar.gz michael@202: Source3: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-g722.tar.gz michael@202: Source4: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-g729.tar.gz michael@202: Source5: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-gsm.tar.gz michael@202: Source6: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-ulaw.tar.gz michael@202: Source7: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-alaw-%{V_extrasounds}.tar.gz michael@202: Source8: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-g722-%{V_extrasounds}.tar.gz michael@202: Source9: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-g729-%{V_extrasounds}.tar.gz michael@202: Source10: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-gsm-%{V_extrasounds}.tar.gz michael@202: Source11: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-ulaw-%{V_extrasounds}.tar.gz michael@202: Source12: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-alaw-%{V_langsounds}.tar.gz michael@202: Source13: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-g722-%{V_langsounds}.tar.gz michael@202: Source14: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-g729-%{V_langsounds}.tar.gz michael@202: Source15: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-gsm-%{V_langsounds}.tar.gz michael@202: Source16: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-ulaw-%{V_langsounds}.tar.gz michael@202: Source17: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-es-alaw-%{V_langsounds}.tar.gz michael@202: Source18: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-es-g722-%{V_langsounds}.tar.gz michael@202: Source19: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-es-g729-%{V_langsounds}.tar.gz michael@202: Source20: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-es-gsm-%{V_langsounds}.tar.gz michael@202: Source21: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-es-ulaw-%{V_langsounds}.tar.gz michael@202: Source22: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-fr-alaw-%{V_langsounds}.tar.gz michael@202: Source23: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-fr-g722-%{V_langsounds}.tar.gz michael@202: Source24: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-fr-g729-%{V_langsounds}.tar.gz michael@202: Source25: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-fr-gsm-%{V_langsounds}.tar.gz michael@202: Source26: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-fr-ulaw-%{V_langsounds}.tar.gz michael@202: Source27: http://www.amooma.de/asterisk/sprachbausteine/asterisk-%{V_amoomasounds}-de-prompts.tar.gz michael@202: Source28: http://www.amooma.de/asterisk/sprachbausteine/asterisk-core-sounds-de-gsm-current.tar.gz michael@202: Source29: ftp://ftp.europalab.com/pub/sfw/machsnds/de-digits/de-digits-%{V_customsounds}.tar.bz2 michael@202: Source30: asterisk.conf michael@202: Source31: amd.conf michael@202: Source32: capi.conf michael@202: Source33: cdr.conf michael@202: Source34: cdr_custom.conf michael@202: Source35: codecs.conf michael@202: Source36: dundi.conf michael@202: Source37: enum.conf michael@202: Source38: extensions.conf michael@202: Source39: features.conf michael@202: Source40: festival.conf michael@202: Source41: followme.conf michael@202: Source42: indications.conf michael@202: Source33: logger.conf michael@202: Source34: manager.conf michael@202: Source45: meetme.conf michael@202: Source46: misdn.conf michael@202: Source47: modules.conf michael@202: Source48: musiconhold.conf michael@202: Source49: privacy.conf michael@202: Source50: rpt.conf michael@202: Source51: rtp.conf michael@202: Source52: say.conf michael@202: Source53: sip.conf michael@202: Source54: sip_notify.conf michael@202: Source55: sla.conf michael@202: Source56: voicemail.conf michael@202: Source57: zapata.conf michael@202: Source58: rc.asterisk michael@202: Source59: wakeup.agi michael@202: Patch0: asterisk.patch michael@202: Patch1: asterisk.patch.xfersips michael@202: Patch2: asterisk.patch.proxymwi michael@202: Patch3: asterisk.patch.parseavp michael@202: michael@202: # build information michael@202: Prefix: %{l_prefix} michael@202: BuildRoot: %{l_buildroot} michael@202: BuildPreReq: OpenPKG, openpkg >= 20040130, pkgconfig, awk, grep michael@202: PreReq: OpenPKG, openpkg >= 20040130 michael@202: BuildPreReq: ncurses, openssl, zlib michael@202: PreReq: ncurses, openssl, zlib michael@202: BuildPreReq: speex, vorbis-libs, sox michael@202: PreReq: speex, vorbis-libs, sox michael@202: %if "%{with_libpri}" == "yes" michael@202: BuildPreReq: libpri michael@202: PreReq: libpri michael@202: %endif michael@202: %if "%{with_radius}" == "yes" michael@202: BuildPreReq: radiusclient michael@202: PreReq: radiusclient michael@202: %endif michael@202: %if "%{with_sqlite}" == "yes" michael@202: BuildPreReq: sqlite michael@202: PreReq: sqlite michael@202: %endif michael@202: %if "%{with_pgsql}" == "yes" michael@202: BuildPreReq: postgresql michael@202: PreReq: postgresql michael@202: %endif michael@202: %if "%{with_curl}" == "yes" michael@202: BuildPreReq: curl michael@202: PreReq: curl michael@202: %endif michael@202: %if "%{with_imap}" == "yes" michael@202: BuildPreReq: imap michael@202: PreReq: imap michael@202: %endif michael@202: %if "%{with_astman}" == "yes" michael@202: BuildPreReq: newt michael@202: PreReq: newt michael@202: %endif michael@202: AutoReq: no michael@202: AutoReqProv: no michael@202: michael@202: %description michael@202: Asterisk is a complete Private Branch Exchange (PBX) in software. michael@202: It provides all of the features you would expect from a PBX and michael@202: more. Asterisk does Voice over IP (VoIP) in many protocols. Asterisk michael@202: provides Voicemail services with Directory, Call Conferencing, michael@202: Interactive Voice Response and Call Queuing. It has support for michael@202: three-way calling, caller ID services, ADSI, SIP, etc. Asterisk michael@202: needs no additional hardware for VoIP. michael@202: michael@202: This copy of Asterisk is optionally patched to allow the asterisk michael@202: server to respond to SIP/TLS transfer requests using the Transfer() michael@202: application. Should this option be chosen, the asterisk server michael@202: successfully dispatches all transfer destinations using 'SIPS' michael@202: technology by means of the standard SIP/2.0 302 Moved Temporarily michael@202: message, with a URI resembling . michael@202: michael@202: This copy of Asterisk is optionally patched as well to enclose the michael@202: correct user name in NOTIFY messages when MWI logic detects changes michael@202: in the state of Messages-Waiting. Asterisk will send NOTIFY messages michael@202: with the URI 'user@hostname' instead of simply 'hostname'. This can michael@202: be used by a external SIP proxy to route the MWI to the correct phone. michael@202: michael@202: %track michael@202: prog asterisk = { michael@202: version = %{version} michael@202: url = http://downloads.digium.com/pub/asterisk/releases/ michael@202: regex = asterisk-(__VER__)\.tar\.gz michael@202: } michael@202: michael@202: %prep michael@202: %setup -q -n asterisk-%{version} michael@202: %setup -q -n asterisk-%{version} -D -T -a 1 michael@202: %patch -p0 michael@202: %if "%{with_xfersips}" == "yes" michael@202: %patch -p0 -P 1 michael@202: %endif michael@202: %if "%{with_proxymwi}" == "yes" michael@202: %patch -p0 -P 2 michael@202: %endif michael@202: %if "%{with_parseavp}" == "yes" michael@202: %patch -p0 -P 3 michael@202: %endif michael@202: michael@202: # link install-sh to where Makefiles expect it michael@202: for dir in agi utils res channels pbx apps codecs formats cdr funcs main; do michael@202: ( cd $dir && ln -s ../install-sh ) || exit $? michael@202: done michael@202: michael@202: # apply corrections michael@202: case "%{l_platform -t}" in michael@202: *-sunos* ) michael@202: %{l_shtool} subst \ michael@202: -e 's|\(tmp->tm_gmtoff = ttisp->tt_gmtoff;\)|/*\1*/|' \ michael@202: main/stdtime/localtime.c michael@202: ;; michael@202: esac michael@202: %{l_shtool} subst \ michael@202: -e 's;sysconfdir=/etc;true;' \ michael@202: -e 's;mandir=/usr/share/man;true;' \ michael@202: -e 's;localstatedir=/var;true;' \ michael@202: -e 's;\(radiusclient\)-ng;\1;g' \ michael@202: -e 's;\(\-lsqlite\);\13;g' \ michael@202: -e 's;\(sqlite\)\(\.h\);\13\2;g' \ michael@202: -e 's;\(sqlite\)\(_exec\);\13\2;g' \ michael@202: -e 's;^\(LIBS="-lvorbis\);\1 ${OGG_LIB};' \ michael@202: -e 's;\(#include <\${NCURSES_DIR}/include\);\1/ncurses;' \ michael@202: -e 's;-I${IMAP_TK_DIR}/c-client;-I${IMAP_TK_DIR}/include/imap;g' \ michael@202: -e 's;${IMAP_TK_DIR}/c-client/c-client\.a;-limap -lssl -lcrypto -lcrypt;g' \ michael@202: configure michael@202: %{l_shtool} subst \ michael@202: -e 's; *-I/usr/local/ssl/include;;g' \ michael@202: -e 's;/opt/ssl/include;%{l_prefix}/include;g' \ michael@202: -e 's;/usr/local;%{l_prefix};g' \ michael@202: -e 's;^\(MOD_SUBDIR_CFLAGS=.*\ *\)$;\1 -I%{l_prefix}/include;' \ michael@202: -e 's;^\( *ASTETCDIR\)=.*;\1=$(sysconfdir)/asterisk;g' \ michael@202: -e 's;^\( *ASTLIBDIR\)=.*;\1=$(libdir)/asterisk;g' \ michael@202: -e 's;^\( *ASTHEADERDIR\)=.*;\1=$(includedir)/asterisk;g' \ michael@202: -e 's;^\( *ASTBINDIR\)=.*;\1=$(bindir);g' \ michael@202: -e 's;^\( *ASTSBINDIR\)=.*;\1=$(sbindir);g' \ michael@202: -e 's;^\( *ASTSPOOLDIR\)=.*;\1=$(localstatedir)/asterisk/spool;g' \ michael@202: -e 's;^\( *ASTLOGDIR\)=.*;\1=$(localstatedir)/asterisk/log;g' \ michael@202: -e 's;^\( *ASTVARRUNDIR\)=.*;\1=$(localstatedir)/asterisk/run;g' \ michael@202: -e 's;^\( *ASTMANDIR\)=.*;\1=$(mandir);g' \ michael@202: -e 's;^\( *ASTVARLIBDIR\)=.*;\1=$(localstatedir)/asterisk/lib;g' \ michael@202: -e 's;^\( *ASTVARRUNDIR\)=.*;\1=$(localstatedir)/asterisk/run;g' \ michael@202: -e 's;^\( *ASTDATADIR\):*=.*;\1=$(datadir)/asterisk;g' \ michael@202: -e 's/\(for f in\) \(\$(OLDMODS); do \\\)$/\1 "warning:" \2/' \ michael@202: Makefile michael@202: #-e 's;\(ASTSPOOLDIR=\$(localstatedir)\)\(/spool\)\(/asterisk\);\1\3\2;' \ michael@202: #-e 's;\(ASTLOGDIR=\$(localstatedir)\)\(/log\)\(/asterisk\);\1\3\2;' \ michael@202: #-e 's;\(ASTVARRUNDIR=\$(localstatedir)\)\(/run\);\1/asterisk\2;' \ michael@202: #-e 's;\(ASTVARRUNDIR=\$(localstatedir)\)\(/run\)\(/asterisk\);\1\3\2;' \ michael@202: #-e 's;\(ASTVARLIBDIR=\$(localstatedir)\)\(/lib\)\(/asterisk\);\1\3\2;' \ michael@202: #-e 's;\(ASTDATADIR:=\)\$(ASTVARLIBDIR);\1$(prefix)/share/asterisk;' \ michael@202: #Makefile michael@202: %{l_shtool} subst \ michael@202: -e 's; *-L/usr/local/ssl/lib;;g' \ michael@202: -e 's;/opt/ssl/lib;%{l_prefix}/lib;g' \ michael@202: -e 's;/usr/local;%{l_prefix};g' \ michael@202: -e 's;\(ASTLINK=\)$;\1-Wl,--export-dynamic;g' \ michael@202: main/Makefile michael@202: %{l_shtool} subst \ michael@202: -e 's;LOG_WARNING\(, "Failed to perform seek\);LOG_DEBUG\1;g' \ michael@202: main/channel.c michael@202: %{l_shtool} subst \ michael@202: -e 's;LOG_WARNING\(, "[^ ][^ ]* is not supported\);LOG_DEBUG\1;g' \ michael@202: formats/format_ogg_vorbis.c michael@202: %{l_shtool} subst \ michael@202: -e 's;\(/etc/radiusclient-ng/radiusclient.conf\);%{l_prefix}\1;g' \ michael@202: -e 's;\(radiusclient\)-ng;\1;g' \ michael@202: cdr/cdr_radius.c michael@202: %{l_shtool} subst \ michael@202: -e 's;\(sqlite\)\(\.h\);\13\2;g' \ michael@202: cdr/cdr_sqlite.c michael@202: %{l_shtool} subst \ michael@202: -e 's;\(#define DEFAULT_POLLING_INTERVAL\) *.*;\1 %{with_smdipoll};' \ michael@202: res/res_smdi.c michael@202: %{l_shtool} subst \ michael@202: -e 's;\(ASTERISK_HEADER_DIR=\).*;\1%{l_prefix}/include;g' \ michael@202: -e 's;\(MODULES_DIR=\).*;\1%{l_prefix}/lib/asterisk/modules;g' \ michael@202: -e 's;\(CONFIG_DIR=\).*;\1%{l_prefix}/etc/asterisk;g' \ michael@202: -e 's;\(\$(MODULES_DIR)\);$(DESTDIR)\1;g' \ michael@202: -e 's;\${CONFIG_DIR};$(DESTDIR)$(CONFIG_DIR);g' \ michael@202: chan_capi-%{V_chan_capi}/Makefile michael@202: michael@202: # # optionally specify CPU michael@202: # %{l_shtool} subst \ michael@202: # -e 's;build_cpu=\$1;build_cpu=i586;' \ michael@202: # -e 's;host_cpu=\$1;host_cpu=i586;' \ michael@202: # configure michael@202: michael@202: %build michael@202: # apply platform build rules michael@202: libs="`pkg-config openssl speex --libs-only-l`" michael@202: %if "%{with_curl}" == "yes" michael@202: libs="$libs `pkg-config libcurl --libs-only-l`" michael@202: %endif michael@202: %if "%{with_sqlite}" == "yes" michael@202: libs="$libs `pkg-config sqlite3 --libs-only-l`" michael@202: %endif michael@202: %if "%{with_pgsql}" == "yes" michael@202: libs="-lpq $libs" michael@202: %endif michael@202: %if "%{with_radius}" == "yes" michael@202: libs="$libs -lradiusclient" michael@202: %endif michael@202: %if "%{with_libpri}" == "yes" michael@202: libs="$libs -lpri" michael@202: %endif michael@202: case "%{l_platform -t}" in michael@202: *-linux* ) libs="$libs -lrt" ;; michael@202: *-sunos* ) libs="$libs -lrt" ;; michael@202: esac michael@202: michael@202: # configure package michael@202: CC="%{l_cc}" \ michael@202: CFLAGS="%{l_cflags -O}" \ michael@202: %if "%{with_imap}" == "yes" michael@202: CPPFLAGS="%{l_cppflags imap ncurses}" \ michael@202: %else michael@202: CPPFLAGS="%{l_cppflags ncurses}" \ michael@202: %endif michael@202: LDFLAGS="%{l_ldflags}" \ michael@202: LIBS="$libs" \ michael@202: ./configure \ michael@202: --prefix=%{l_prefix} \ michael@202: --mandir=%{l_prefix}/man \ michael@202: --with-ncurses=%{l_prefix} \ michael@202: %if "%{with_libpri}" == "yes" michael@202: --with-pri=%{l_prefix} \ michael@202: %else michael@202: --with-pri=no \ michael@202: %endif michael@202: --with-ssl=%{l_prefix} \ michael@202: %if "%{with_radius}" == "yes" michael@202: --with-radius=%{l_prefix} \ michael@202: %else michael@202: --with-radius=no \ michael@202: %endif michael@202: %if "%{with_sqlite}" == "yes" michael@202: --with-sqlite=%{l_prefix} \ michael@202: %else michael@202: --with-sqlite=no \ michael@202: %endif michael@202: %if "%{with_postgresql}" == "yes" michael@202: --with-postgres=%{l_prefix} \ michael@202: %else michael@202: --with-postgres=no \ michael@202: %endif michael@202: %if "%{with_curl}" == "yes" michael@202: --with-curl=%{l_prefix} \ michael@202: %else michael@202: --with-curl=no \ michael@202: %endif michael@202: %if "%{with_imap}" == "yes" michael@202: --with-imap=%{l_prefix} \ michael@202: --disable-largefile \ michael@202: %else michael@202: --with-imap=no \ michael@202: %endif michael@202: %if "%{with_astman}" == "yes" michael@202: --with-newt=%{l_prefix} \ michael@202: %else michael@202: --with-newt=no \ michael@202: %endif michael@202: --with-speex=%{l_prefix} \ michael@202: --with-speexdsp=%{l_prefix} \ michael@202: --with-ogg=%{l_prefix} \ michael@202: --with-vorbis=%{l_prefix} \ michael@202: --with-z=%{l_prefix} michael@202: michael@202: # build package michael@202: %{l_make} %{l_mflags -O} menuselect/menuselect menuselect-tree michael@202: menuselect/menuselect --check-deps menuselect.makeopts michael@202: %{l_shtool} subst \ michael@202: -e 's;\(MENUSELECT_MOH=\).*;\1;' \ michael@202: -e 's;\(MENUSELECT_CORE_SOUNDS=\).*;\1;' \ michael@202: -e 's;\(MENUSELECT_EXTRA_SOUNDS=\).*;\1;' \ michael@202: menuselect.makeopts michael@202: %if "%{with_imap}" == "yes" michael@202: %{l_shtool} subst \ michael@202: -e 's;\(MENUSELECT_OPTS_app_voicemail=\)$;\1IMAP_STORAGE;' \ michael@202: menuselect.makeopts michael@202: %endif michael@202: %{l_make} %{l_mflags -O} EXTLIBS="$libs" NOISY_BUILD=yes michael@202: %if "%{with_capi}" == "yes" michael@202: ( cd chan_capi-%{V_chan_capi} michael@202: %{l_make} %{l_mflags -O} michael@202: ) || exit $? michael@202: %endif michael@202: michael@202: %install michael@202: rm -rf $RPM_BUILD_ROOT michael@202: michael@202: # install package michael@202: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@202: %if "%{with_capi}" == "yes" michael@202: ( cd chan_capi-%{V_chan_capi} michael@202: %{l_make} %{l_mflags} install samples DESTDIR=$RPM_BUILD_ROOT michael@202: ) || exit $? michael@202: %endif michael@202: michael@202: # install all sound prompt files michael@202: for codec in alaw ulaw g722 g729 gsm; do michael@202: for lang in es fr; do michael@202: ( cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/${lang} michael@202: %{l_tar} zxf %{_sourcedir}/asterisk-core-sounds-${lang}-${codec}-%{V_langsounds}.tar.gz michael@202: ) || exit $? michael@202: done michael@202: ( cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds michael@202: %{l_tar} zxf %{_sourcedir}/asterisk-extra-sounds-en-${codec}-%{V_extrasounds}.tar.gz michael@202: %{l_tar} zxf %{_sourcedir}/asterisk-core-sounds-en-${codec}-%{V_langsounds}.tar.gz michael@202: ) || exit $? michael@202: done michael@202: michael@202: # install special case sound files michael@202: ( cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds michael@202: %{l_tar} jxf %{SOURCE de-digits-%{V_customsounds}.tar.bz2} michael@202: %{l_tar} zxf %{SOURCE asterisk-core-sounds-de-gsm-current.tar.gz} michael@202: cd de michael@202: %{l_tar} zxf %{_sourcedir}/asterisk-%{V_amoomasounds}-de-prompts.tar.gz michael@202: mv -f de/* . && rm -rf de michael@202: mv -f dictate/de/* letters/ && rm -rf dictate/de michael@202: mv -f digits/de/* letters/ && rm -rf digits/de michael@202: mv -f letters/de/* letters/ && rm -rf letters/de michael@202: mv -f phonetic/de/* letters/ && rm -rf phonetic/de michael@202: ) || exit $? michael@202: michael@202: # install additional music on hold files michael@202: ( cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/moh michael@202: for codec in alaw ulaw g722 g729 gsm; do michael@202: %{l_tar} zxf %{_sourcedir}/asterisk-moh-freeplay-${codec}.tar.gz michael@202: done michael@202: ) || exit $? michael@202: michael@202: # # install nonstandard voicemail prompts michael@202: # %{l_shtool} mkdir -f -p -m 755 \ michael@202: # $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/spool/voicemail/default/%{exten}/unavail michael@202: # %{l_shtool} install -c -m 660 \ michael@202: # %{_sourcedir}/ansage-%{V_ansage}.wav} \ michael@202: # $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/spool/voicemail/default/%{exten}/unavail.wav michael@202: michael@202: # install default configuration michael@202: %{l_shtool} install -c -m 660 %{l_value -s -a} \ michael@202: %{SOURCE asterisk.conf} \ michael@202: %{SOURCE amd.conf} \ michael@202: %{SOURCE cdr.conf} \ michael@202: %{SOURCE codecs.conf} \ michael@202: %{SOURCE extensions.conf} \ michael@202: %{SOURCE features.conf} \ michael@202: %{SOURCE festival.conf} \ michael@202: %{SOURCE followme.conf} \ michael@202: %{SOURCE indications.conf} \ michael@202: %{SOURCE logger.conf} \ michael@202: %{SOURCE manager.conf} \ michael@202: %{SOURCE meetme.conf} \ michael@202: %{SOURCE modules.conf} \ michael@202: %{SOURCE musiconhold.conf} \ michael@202: %{SOURCE rtp.conf} \ michael@202: %{SOURCE sip.conf} \ michael@202: %{SOURCE sla.conf} \ michael@202: %{SOURCE voicemail.conf} \ michael@202: %{SOURCE zapata.conf} \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/etc/asterisk/ michael@202: michael@202: # install runcommand script michael@202: %{l_shtool} mkdir -f -p -m 755 \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d michael@202: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@202: %{SOURCE rc.asterisk} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ michael@202: michael@202: # install additional AGI scripts michael@202: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@202: %{SOURCE wakeup.agi} $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/agi-bin/ michael@202: michael@202: # correct installation hierarchy michael@202: %{l_shtool} mkdir -f -p -m 755 \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/lib \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/spool/outgoing michael@202: michael@202: # remove unused components michael@202: rm -rf \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/bin \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/images \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/de/.DS_Store \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/de/autogen.sh \ michael@202: >/dev/null 2>&1 || true michael@202: michael@202: # adjust inconsistent names michael@202: for bin in $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/agi-bin/*.*; do michael@202: mv $bin `echo $bin | sed -e 's;\.[^.]*$;;'` michael@202: done michael@202: michael@202: # strip down installation michael@202: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/sbin/* \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/modules/* \ michael@202: $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/agi-bin/* \ michael@202: >/dev/null 2>&1 || true michael@202: michael@202: # determine installation files michael@202: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ michael@202: '%config %attr(660,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/asterisk/*' \ michael@202: '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/*' \ michael@202: '%config %attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/dictate' \ michael@202: '%config %attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/digits' \ michael@202: '%config %attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/followme' \ michael@202: '%config %attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/letters' \ michael@202: '%config %attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/phonetic' \ michael@202: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/asterisk/*' \ michael@202: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/asterisk/*/*' michael@202: michael@202: %files -f files michael@202: michael@202: %clean michael@202: rm -rf $RPM_BUILD_ROOT michael@202: michael@202: %post michael@202: # after upgrade, restart service michael@202: [ $1 -eq 2 ] || exit 0 michael@202: eval `%{l_rc} asterisk status 2>/dev/null` michael@202: [ ".$asterisk_active" = .yes ] && %{l_rc} asterisk restart michael@202: exit 0 michael@202: michael@202: %preun michael@202: # before erase, stop service and remove log files michael@202: [ $1 -eq 0 ] || exit 0 michael@202: %{l_rc} asterisk stop 2>/dev/null michael@202: rm -f $RPM_INSTALL_PREFIX/var/asterisk/lib/* >/dev/null 2>&1 || true michael@202: rm -f $RPM_INSTALL_PREFIX/var/asterisk/log/* >/dev/null 2>&1 || true michael@202: rm -f $RPM_INSTALL_PREFIX/var/asterisk/log/cdr-*/* >/dev/null 2>&1 || true michael@202: rm -f $RPM_INSTALL_PREFIX/var/asterisk/run/* >/dev/null 2>&1 || true michael@202: for deldir in meetme outgoing system tmp; do michael@202: rm -rf \ michael@202: $RPM_INSTALL_PREFIX/var/asterisk/spool/$deldir \ michael@202: >/dev/null 2>&1 || true michael@202: done michael@202: exit 0 michael@202: