asterisk/asterisk.spec

changeset 552
e568963742d6
parent 415
dd7b2195ce6f
child 669
dc764d5d565d
equal deleted inserted replaced
16:249b3fa15228 17:1b1135784cb1
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE. 21 ## SUCH DAMAGE.
22 ## 22 ##
23 23
24 # package version 24 # package version
25 %define V_opkg 1.8.11.0 25 %define V_opkg 1.8.15.0
26 %define V_asterisk 1.8.11.0 26 %define V_asterisk 1.8.15.0
27 %define V_asterisk_fax_subdir 1.8.4 27 %define V_asterisk_fax_subdir 1.8.4
28 %define V_asterisk_fax_digium 1.8.4_1.3.0 28 %define V_asterisk_fax_digium 1.8.4_1.3.1
29 %define V_asterisk_sounds_core 1.4.22 29 %define V_asterisk_sounds_core 1.4.22
30 %define V_asterisk_sounds_extra 1.4.11 30 %define V_asterisk_sounds_extra 1.4.11
31 %define V_asterisk_sounds_amoogab 1.4 31 %define V_asterisk_sounds_amoogab 1.4
32 %define V_asterisk_sounds_amootts current 32 %define V_asterisk_sounds_amootts current
33 %define V_asterisk_sounds_custom 1.0 33 %define V_asterisk_sounds_custom 1.0
34 %define V_asterisk_sounds_mohop 2.03 34 %define V_asterisk_sounds_mohop 2.03
35 %define V_asterisk_sounds_newpro july_2012
35 %define V_asterisk_addons_mp3dec 1 36 %define V_asterisk_addons_mp3dec 1
36 %define V_fswitch_sounds_en 1.0.16 37 %define V_fswitch_sounds_en 1.0.20
37 %define V_fswitch_sounds_fr 1.0.14 38 %define V_fswitch_sounds_fr 1.0.16
38 %define V_fswitch_sounds_ru 1.0.13 39 %define V_fswitch_sounds_ru 1.0.13
39 %define V_fswitch_music 1.0.8 40 %define V_fswitch_music 1.0.8
40 %define V_asterisk_codecs_ilbc 20110104 41 %define V_asterisk_codecs_ilbc 20110104
41 %define V_chan_capi 1.1.5.20120324 42 %define V_chan_capi 1.1.5.20120615
42 43
43 # package information 44 # package information
44 Name: asterisk 45 Name: asterisk
45 Summary: Private Branch Exchange (PBX) 46 Summary: Private Branch Exchange (PBX)
46 URL: http://www.asterisk.org/ 47 URL: http://www.asterisk.org/
49 Distribution: OpenPKG Community 50 Distribution: OpenPKG Community
50 Class: BASE 51 Class: BASE
51 Group: VoIP 52 Group: VoIP
52 License: GPL 53 License: GPL
53 Version: %{V_opkg} 54 Version: %{V_opkg}
54 Release: 20120330 55 Release: 20120800
55 56
56 # package options 57 # package options
57 %option with_dahdi no 58 %option with_dahdi no
58 %option with_capi no 59 %option with_capi no
59 %option with_ogg no 60 %option with_ogg no
78 79
79 # list of sources 80 # list of sources
80 Source0: http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-%{V_asterisk}.tar.gz 81 Source0: http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-%{V_asterisk}.tar.gz
81 Source1: ftp://ftp.chan-capi.org/chan-capi/chan_capi-%{V_chan_capi}.tar.gz 82 Source1: ftp://ftp.chan-capi.org/chan-capi/chan_capi-%{V_chan_capi}.tar.gz
82 Source2: ftp://ftp.europalab.com/pub/sfw/machsnds/asterisk-moh-freeplay-sln16.tar.gz 83 Source2: ftp://ftp.europalab.com/pub/sfw/machsnds/asterisk-moh-freeplay-sln16.tar.gz
83
84 Source3: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-moh-opsound-sln16-%{V_asterisk_sounds_mohop}.tar.gz 84 Source3: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-moh-opsound-sln16-%{V_asterisk_sounds_mohop}.tar.gz
85 Source4: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-sln16-%{V_asterisk_sounds_core}.tar.gz 85 Source4: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-sln16-%{V_asterisk_sounds_core}.tar.gz
86 Source5: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-es-sln16-%{V_asterisk_sounds_core}.tar.gz 86 Source5: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-es-sln16-%{V_asterisk_sounds_core}.tar.gz
87 Source6: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en_AU-sln16-%{V_asterisk_sounds_core}.tar.gz 87 Source6: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en_AU-sln16-%{V_asterisk_sounds_core}.tar.gz
88 Source7: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-fr-sln16-%{V_asterisk_sounds_core}.tar.gz 88 Source7: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-fr-sln16-%{V_asterisk_sounds_core}.tar.gz
89 Source8: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-ru-sln16-%{V_asterisk_sounds_core}.tar.gz 89 Source8: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-ru-sln16-%{V_asterisk_sounds_core}.tar.gz
90 Source9: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-extra-sounds-en-sln16-%{V_asterisk_sounds_extra}.tar.gz 90 Source9: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-extra-sounds-en-sln16-%{V_asterisk_sounds_extra}.tar.gz
91 Source10: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-extra-sounds-fr-sln16-%{V_asterisk_sounds_extra}.tar.gz 91 Source10: http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-extra-sounds-fr-sln16-%{V_asterisk_sounds_extra}.tar.gz
92 Source11: http://www.amooma.de/asterisk/sprachbausteine/asterisk-%{V_asterisk_sounds_amoogab}-de-prompts.tar.gz 92 Source11: http://www.asterisk.org/files/new_prompts_%{V_asterisk_sounds_newpro}.zip
93 Source12: http://www.amooma.de/asterisk/sprachbausteine/asterisk-core-sounds-de-gsm-current.tar.gz 93 Source12: http://www.amooma.de/asterisk/sprachbausteine/asterisk-%{V_asterisk_sounds_amoogab}-de-prompts.tar.gz
94 Source13: ftp://ftp.europalab.com/pub/sfw/machsnds/de-digits/de-digits-%{V_asterisk_sounds_custom}.tar.bz2 94 Source13: http://www.amooma.de/asterisk/sprachbausteine/asterisk-core-sounds-de-gsm-current.tar.gz
95 Source14: ftp://ftp.europalab.com/pub/sfw/machsnds/de-sounds/astmultisnds-de-sln16-%{V_asterisk_sounds_custom}.tar.bz2 95 Source14: ftp://ftp.europalab.com/pub/sfw/machsnds/de-digits/de-digits-%{V_asterisk_sounds_custom}.tar.bz2
96 Source15: ftp://ftp.europalab.com/pub/sfw/machsnds/msvbsnds-sln16-%{V_asterisk_sounds_custom}.tar.bz2 96 Source15: ftp://ftp.europalab.com/pub/sfw/machsnds/de-sounds/astmultisnds-de-sln16-%{V_asterisk_sounds_custom}.tar.bz2
97 Source16: http://files.freeswitch.org/freeswitch-sounds-en-us-callie-48000-%{V_fswitch_sounds_en}.tar.gz 97 Source16: ftp://ftp.europalab.com/pub/sfw/machsnds/msvbsnds-sln16-%{V_asterisk_sounds_custom}.tar.bz2
98 Source17: http://files.freeswitch.org/freeswitch-sounds-es-mx-maria-44100.tar.gz 98 Source17: http://files.freeswitch.org/freeswitch-sounds-en-us-callie-48000-%{V_fswitch_sounds_en}.tar.gz
99 Source18: http://files.freeswitch.org/freeswitch-sounds-fr-ca-june-48000-%{V_fswitch_sounds_fr}.tar.gz 99 Source18: http://files.freeswitch.org/freeswitch-sounds-es-mx-maria-44100.tar.gz
100 Source19: http://files.freeswitch.org/freeswitch-sounds-ru-RU-elena-48000-%{V_fswitch_sounds_ru}.tar.gz 100 Source19: http://files.freeswitch.org/freeswitch-sounds-fr-ca-june-48000-%{V_fswitch_sounds_fr}.tar.gz
101 Source20: http://files.freeswitch.org/freeswitch-sounds-music-48000-%{V_fswitch_music}.tar.gz 101 Source20: http://files.freeswitch.org/freeswitch-sounds-ru-RU-elena-48000-%{V_fswitch_sounds_ru}.tar.gz
102 Source21: http://svn.digium.com/svn/thirdparty/mp3/trunk/addons/mp3-%{V_asterisk_addons_mp3dec}.tar.gz 102 Source21: http://files.freeswitch.org/freeswitch-sounds-music-48000-%{V_fswitch_music}.tar.gz
103 Source22: http://downloads.digium.com/pub/telephony/fax/res_fax_digium/asterisk-%{V_asterisk_fax_subdir}/x86-64/res_fax_digium-%{V_asterisk_fax_digium}-generic_64.tar.gz 103 Source22: http://svn.digium.com/svn/thirdparty/mp3/trunk/addons/mp3-%{V_asterisk_addons_mp3dec}.tar.gz
104 Source23: http://downloads.digium.com/pub/telephony/fax/res_fax_digium/asterisk-%{V_asterisk_fax_subdir}/x86-32/res_fax_digium-%{V_asterisk_fax_digium}-generic_32.tar.gz 104 Source23: http://downloads.digium.com/pub/telephony/fax/res_fax_digium/asterisk-%{V_asterisk_fax_subdir}/x86-64/res_fax_digium-%{V_asterisk_fax_digium}-generic_64.tar.gz
105 Source24: ilbc-20110104.tar.gz 105 Source24: http://downloads.digium.com/pub/telephony/fax/res_fax_digium/asterisk-%{V_asterisk_fax_subdir}/x86-32/res_fax_digium-%{V_asterisk_fax_digium}-generic_32.tar.gz
106 Source25: asterisk.txt 106 Source25: ilbc-%{V_asterisk_codecs_ilbc}.tar.gz
107 Source26: rc.asterisk 107 Source26: asterisk.txt
108 Source27: wakeup.agi 108 Source27: rc.asterisk
109 Source28: wakeup.agi
109 Patch0: asterisk.patch 110 Patch0: asterisk.patch
110 Patch1: asterisk.patch.xfersips 111 Patch1: asterisk.patch.xfersips
111 Patch2: asterisk.patch.proxymwi 112 Patch2: asterisk.patch.proxymwi
112 113
113 # build information 114 # build information
114 Prefix: %{l_prefix} 115 BuildPreReq: OpenPKG, openpkg >= 20100101, bison, gcc, make, grep, pkgconfig
115 BuildRoot: %{l_buildroot} 116 PreReq: OpenPKG, openpkg >= 20100101, MTA
116 BuildPreReq: OpenPKG, openpkg >= 20060823, bison, gcc, make, grep, pkgconfig
117 PreReq: OpenPKG, openpkg >= 20060823, MTA
118 BuildPreReq: zlib, curl, openssl, ncurses, speex, sox, popt, gmime, libxml 117 BuildPreReq: zlib, curl, openssl, ncurses, speex, sox, popt, gmime, libxml
119 PreReq: zlib, curl, openssl, ncurses, speex, sox, popt, gmime, libxml 118 PreReq: zlib, curl, openssl, ncurses, speex, sox, popt, gmime, libxml
120 %if "%{with_ogg}" == "yes" 119 %if "%{with_ogg}" == "yes"
121 BuildPreReq: vorbis-libs 120 BuildPreReq: vorbis-libs
122 PreReq: vorbis-libs 121 PreReq: vorbis-libs
170 %if "%{with_libpri}" == "yes" 169 %if "%{with_libpri}" == "yes"
171 BuildPreReq: libpri > 1.4.11.5 170 BuildPreReq: libpri > 1.4.11.5
172 PreReq: libpri > 1.4.11.5 171 PreReq: libpri > 1.4.11.5
173 %endif 172 %endif
174 %if "%{with_esounds}" == "yes" 173 %if "%{with_esounds}" == "yes"
175 BuildPreReq: sox 174 BuildPreReq: sox, infozip
176 %endif 175 %endif
177 AutoReq: no
178 AutoReqProv: no
179 176
180 %description 177 %description
181 Asterisk is a complete Private Branch Exchange (PBX) in software. 178 Asterisk is a complete Private Branch Exchange (PBX) in software.
182 It provides more than the features normally expected from a PBX, 179 It provides more than the features normally expected from a PBX,
183 and can transceive Voice over IP (VoIP) in many protocols. Asterisk 180 and can transceive Voice over IP (VoIP) in many protocols. Asterisk
218 prog asterisk:sounds_core = { 215 prog asterisk:sounds_core = {
219 version = %{V_asterisk_sounds_core} 216 version = %{V_asterisk_sounds_core}
220 url = http://downloads.asterisk.org/pub/telephony/sounds/releases/ 217 url = http://downloads.asterisk.org/pub/telephony/sounds/releases/
221 regex = asterisk-core-sounds-en-sln16-(\d+\.\d+(\.\d+)+)\.tar\.gz 218 regex = asterisk-core-sounds-en-sln16-(\d+\.\d+(\.\d+)+)\.tar\.gz
222 } 219 }
220 prog asterisk:sounds_newpro = {
221 version = %{V_asterisk_sounds_newpro}
222 url = http://www.asterisk.org/files/
223 regex = new_prompts_(__VER__)\.zip
224 }
223 prog asterisk:sounds_extra = { 225 prog asterisk:sounds_extra = {
224 version = %{V_asterisk_sounds_extra} 226 version = %{V_asterisk_sounds_extra}
225 url = http://downloads.asterisk.org/pub/telephony/sounds/releases/ 227 url = http://downloads.asterisk.org/pub/telephony/sounds/releases/
226 regex = asterisk-extra-sounds-en-sln16-(\d+\.\d+(\.\d+)+)\.tar\.gz 228 regex = asterisk-extra-sounds-en-sln16-(\d+\.\d+(\.\d+)+)\.tar\.gz
227 } 229 }
264 %endif 266 %endif
265 %setup -q -n asterisk-%{V_asterisk} 267 %setup -q -n asterisk-%{V_asterisk}
266 %setup -q -n asterisk-%{V_asterisk} -D -T -a 1 268 %setup -q -n asterisk-%{V_asterisk} -D -T -a 1
267 %setup -q -n asterisk-%{V_asterisk} -D -T -a 2 269 %setup -q -n asterisk-%{V_asterisk} -D -T -a 2
268 %if "%{with_fax}" == "yes" 270 %if "%{with_fax}" == "yes"
269 %setup -q -n asterisk-%{V_asterisk} -D -T -a 22
270 %setup -q -n asterisk-%{V_asterisk} -D -T -a 23 271 %setup -q -n asterisk-%{V_asterisk} -D -T -a 23
272 %setup -q -n asterisk-%{V_asterisk} -D -T -a 24
271 %endif 273 %endif
272 ( cd addons 274 ( cd addons
273 %{l_tar} zxf %{_sourcedir}/mp3-%{V_asterisk_addons_mp3dec}.tar.gz 275 %{l_tar} zxf %{_sourcedir}/mp3-%{V_asterisk_addons_mp3dec}.tar.gz
274 ) || exit $? 276 ) || exit $?
275 ( cd codecs 277 ( cd codecs
304 configure 306 configure
305 %{l_shtool} subst \ 307 %{l_shtool} subst \
306 -e 's;\(sh\) \(bash\) ksh sh5;\2 \1;' \ 308 -e 's;\(sh\) \(bash\) ksh sh5;\2 \1;' \
307 configure 309 configure
308 %{l_shtool} subst \ 310 %{l_shtool} subst \
311 -e 's/int foo2 = \(__sync_fetch_and_add(\&foo1, 1);\)/return \1/' \
312 configure
313 %{l_shtool} subst \
309 -e 's;^\(#define DEFAULT_DB .*\${ASTDBDIR}\)/astdb;\1/asterisk.db;' \ 314 -e 's;^\(#define DEFAULT_DB .*\${ASTDBDIR}\)/astdb;\1/asterisk.db;' \
310 build_tools/make_defaults_h 315 build_tools/make_defaults_h
311 %{l_shtool} subst \ 316 %{l_shtool} subst \
312 -e 's;^\(_all:.* *\)cleantest *;\1;' \ 317 -e 's;^\(_all:.* *\)cleantest *;\1;' \
313 -e 's; *-I/usr/local/ssl/include;;g' \ 318 -e 's; *-I/usr/local/ssl/include;;g' \
329 main/Makefile 334 main/Makefile
330 %{l_shtool} subst \ 335 %{l_shtool} subst \
331 -e 's;\(<defaultenabled>\)no\(</defaultenabled>\);\1yes\2;g' \ 336 -e 's;\(<defaultenabled>\)no\(</defaultenabled>\);\1yes\2;g' \
332 apps/app_ivrdemo.c \ 337 apps/app_ivrdemo.c \
333 apps/app_saycounted.c \ 338 apps/app_saycounted.c \
334 apps/app_rpt.c \
335 utils/utils.xml \ 339 utils/utils.xml \
336 agi/agi.xml 340 agi/agi.xml
337 %{l_shtool} subst \ 341 %{l_shtool} subst \
338 -e 's;\(-DSOLARIS\);\1 -D__EXTENSIONS__=1;g' \ 342 -e 's;\(-DSOLARIS\);\1 -D__EXTENSIONS__=1;g' \
339 main/editline/Makefile.in \ 343 main/editline/Makefile.in \
596 ) || exit $? 600 ) || exit $?
597 %endif 601 %endif
598 602
599 %install 603 %install
600 # install program 604 # install program
601 rm -rf $RPM_BUILD_ROOT
602 %{l_make} %{l_mflags} install \ 605 %{l_make} %{l_mflags} install \
603 DESTDIR=$RPM_BUILD_ROOT \ 606 DESTDIR=$RPM_BUILD_ROOT \
604 INSTALL_PREFIX=%{l_prefix} 607 INSTALL_PREFIX=%{l_prefix}
605 608
606 %if "%{with_capi}" == "yes" 609 %if "%{with_capi}" == "yes"
639 ;; 642 ;;
640 esac 643 esac
641 %endif 644 %endif
642 645
643 ( echo 'Start of sound installation block (OpenPKG)' 646 ( echo 'Start of sound installation block (OpenPKG)'
647 # create main sound directory hierarchy
648 ( cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds
649 %{l_shtool} mkdir -f -p -m 755 en es fr en_AU
650 ) || exit $?
644 %if "%{with_esounds}" == "yes" 651 %if "%{with_esounds}" == "yes"
645 # create sound directory hierarchy 652 # create extra sound directory hierarchy
646 for sndir in en es fr ru en_AU moh; do 653 %{l_shtool} mkdir -f -p -m 755 \
647 %{l_shtool} mkdir -f -p -m 755 \ 654 $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/ru
648 $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/$sndir 655 $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/moh
649 done 656
657 # install humorous 'new' prompts
658 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en
659 %{l_prefix}/bin/unzip %{_sourcedir}/new_prompts_%{V_asterisk_sounds_newpro}.zip
660
650 # install freeswitch sound prompt files, expecting 661 # install freeswitch sound prompt files, expecting
651 # identical sound filenames to be overwritten later 662 # identical sound filenames to be overwritten later
652 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en 663 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en
653 %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-en-us-callie-48000-%{V_fswitch_sounds_en}.tar.gz 664 %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-en-us-callie-48000-%{V_fswitch_sounds_en}.tar.gz
654 subs=`( cd en/us/callie && find * -type d -prune )` 665 subs=`( cd en/us/callie && find * -type d -prune )`
826 # '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/asterisk/sounds/fr/vm-Voicemail.sln16' \ 837 # '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/asterisk/sounds/fr/vm-Voicemail.sln16' \
827 838
828 %files -f files 839 %files -f files
829 840
830 %clean 841 %clean
831 rm -rf $RPM_BUILD_ROOT
832 842
833 %post 843 %post
834 %if "%{with_dahdi}" == "yes" 844 %if "%{with_dahdi}" == "yes"
835 if [ $1 -eq 1 ]; then 845 if [ $1 -eq 1 ]; then
836 case "%{l_platform -t}" in 846 case "%{l_platform -t}" in

mercurial