asterisk/asterisk.spec

changeset 414
fd611cde817f
parent 411
e4385d1fd937
child 415
dd7b2195ce6f
equal deleted inserted replaced
14:9c39edde9619 15:ee51afb5bf04
36 %define V_fswitch_sounds_en 1.0.16 36 %define V_fswitch_sounds_en 1.0.16
37 %define V_fswitch_sounds_fr 1.0.14 37 %define V_fswitch_sounds_fr 1.0.14
38 %define V_fswitch_sounds_ru 1.0.13 38 %define V_fswitch_sounds_ru 1.0.13
39 %define V_fswitch_music 1.0.8 39 %define V_fswitch_music 1.0.8
40 %define V_asterisk_codecs_ilbc 20110104 40 %define V_asterisk_codecs_ilbc 20110104
41 %define V_chan_capi 1.1.5.20110914 41 %define V_chan_capi 1.1.5.20120324
42 42
43 # package information 43 # package information
44 Name: asterisk 44 Name: asterisk
45 Summary: Private Branch Exchange (PBX) 45 Summary: Private Branch Exchange (PBX)
46 URL: http://www.asterisk.org/ 46 URL: http://www.asterisk.org/
49 Distribution: OpenPKG Community 49 Distribution: OpenPKG Community
50 Class: BASE 50 Class: BASE
51 Group: VoIP 51 Group: VoIP
52 License: GPL 52 License: GPL
53 Version: %{V_opkg} 53 Version: %{V_opkg}
54 Release: 20120320 54 Release: 20120325
55 55
56 # package options 56 # package options
57 %option with_dahdi no 57 %option with_dahdi no
58 %option with_capi no 58 %option with_capi no
59 %option with_ogg no 59 %option with_ogg no
296 -e 's;-lradiusclient-ng;-lradiusclient;g' \ 296 -e 's;-lradiusclient-ng;-lradiusclient;g' \
297 -e 's;radiusclient-ng\.h;radiusclient.h;g' \ 297 -e 's;radiusclient-ng\.h;radiusclient.h;g' \
298 -e 's;lua5\.1;lua;g' \ 298 -e 's;lua5\.1;lua;g' \
299 -e 's;-I${IMAP_TK_DIR}/c-client;-DUSE_SYSTEM_IMAP -I${IMAP_TK_DIR}/include/imap;g' \ 299 -e 's;-I${IMAP_TK_DIR}/c-client;-DUSE_SYSTEM_IMAP -I${IMAP_TK_DIR}/include/imap;g' \
300 -e 's;${IMAP_TK_DIR}/c-client/c-client\.a;-limap -lssl -lcrypto -lcrypt;g' \ 300 -e 's;${IMAP_TK_DIR}/c-client/c-client\.a;-limap -lssl -lcrypto -lcrypt;g' \
301 -e 's;LIBXML2_INCLUDE="-I\${LIBXML2_DIR}/include";echo "Removing really buggy hard coded LibXML include defs.";' \
302 -e 's;\(for ver in 2\.0 2\.2 2\.4\);\1 2.6;' \
303 -e 's;\(\-lpq.*\-lz.*\)";\1 ${PTHREAD_LIBS}";g'\
301 configure 304 configure
302 %{l_shtool} subst \ 305 %{l_shtool} subst \
303 -e 's;\(sh\) \(bash\) ksh sh5;\2 \1;' \ 306 -e 's;\(sh\) \(bash\) ksh sh5;\2 \1;' \
304 configure 307 configure
305 %{l_shtool} subst \ 308 %{l_shtool} subst \
313 Makefile 316 Makefile
314 %{l_shtool} subst \ 317 %{l_shtool} subst \
315 -e 's;\$(SUBMAKE);$(MAKE);g' \ 318 -e 's;\$(SUBMAKE);$(MAKE);g' \
316 -e 's;\$(SILENTMAKE);$(MAKE) --quiet --no-print-directory;g' \ 319 -e 's;\$(SILENTMAKE);$(MAKE) --quiet --no-print-directory;g' \
317 -e 's;\$(MAKE_MENUSELECT); $(MAKE) -C menuselect;g' \ 320 -e 's;\$(MAKE_MENUSELECT); $(MAKE) -C menuselect;g' \
321 -e 's;-march=\$(PROC);-march=native;g' \
318 Makefile 322 Makefile
319 %{l_shtool} subst \ 323 %{l_shtool} subst \
320 -e 's; *-L/usr/local/ssl/lib;;g' \ 324 -e 's; *-L/usr/local/ssl/lib;;g' \
321 -e 's;/opt/ssl/lib;%{l_prefix}/lib;g' \ 325 -e 's;/opt/ssl/lib;%{l_prefix}/lib;g' \
322 -e 's;/usr/local;%{l_prefix};g' \ 326 -e 's;/usr/local;%{l_prefix};g' \
333 %{l_shtool} subst \ 337 %{l_shtool} subst \
334 -e 's;\(-DSOLARIS\);\1 -D__EXTENSIONS__=1;g' \ 338 -e 's;\(-DSOLARIS\);\1 -D__EXTENSIONS__=1;g' \
335 main/editline/Makefile.in \ 339 main/editline/Makefile.in \
336 main/db1-ast/Makefile 340 main/db1-ast/Makefile
337 %{l_shtool} subst \ 341 %{l_shtool} subst \
342 -e 's;^\(install:\).*;\1;' \
343 sounds/Makefile
344 %{l_shtool} subst \
338 -e 's;%s/astdb;%s/asterisk.db;g' \ 345 -e 's;%s/astdb;%s/asterisk.db;g' \
339 main/asterisk.c 346 main/asterisk.c
340 %{l_shtool} subst \ 347 %{l_shtool} subst \
341 -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \ 348 -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \
342 main/db1-ast/hash/hash.h 349 main/db1-ast/hash/hash.h
343 %{l_shtool} subst \ 350 %{l_shtool} subst \
344 -e 's;if \(((tmp = strchr(name\);while \1;g' \ 351 -e 's;if \(((tmp = strchr(name\);while \1;g' \
345 main/abstract_jb.c 352 main/abstract_jb.c
353 %{l_shtool} subst \
354 -e 's;if.*SSL_CTX_use_certificate_file.*;if (SSL_CTX_use_certificate_chain_file(cfg->ssl_ctx, cfg->certfile) == 0) {;' \
355 main/tcptls.c
356 %{l_shtool} subst \
357 -e 's;ast_random();rand();' \
358 main/strcompat.c
346 %{l_shtool} subst \ 359 %{l_shtool} subst \
347 -e 's;\(/etc/radiusclient-ng/radiusclient.conf\);%{l_prefix}\1;g' \ 360 -e 's;\(/etc/radiusclient-ng/radiusclient.conf\);%{l_prefix}\1;g' \
348 -e 's;\(radiusclient\)-ng;\1;g' \ 361 -e 's;\(radiusclient\)-ng;\1;g' \
349 cdr/cdr_radius.c \ 362 cdr/cdr_radius.c \
350 cel/cel_radius.c 363 cel/cel_radius.c
360 -e 's;\(CONFIG_DIR=\).*;\1%{l_prefix}/etc/asterisk;g' \ 373 -e 's;\(CONFIG_DIR=\).*;\1%{l_prefix}/etc/asterisk;g' \
361 -e 's;\(\$(MODULES_DIR)\);$(DESTDIR)\1;g' \ 374 -e 's;\(\$(MODULES_DIR)\);$(DESTDIR)\1;g' \
362 -e 's;\${CONFIG_DIR};$(DESTDIR)$(CONFIG_DIR);g' \ 375 -e 's;\${CONFIG_DIR};$(DESTDIR)$(CONFIG_DIR);g' \
363 -e 's;^\(USE_OWN_LIBCAPI\)=yes;\1=no;' \ 376 -e 's;^\(USE_OWN_LIBCAPI\)=yes;\1=no;' \
364 chan_capi-%{V_chan_capi}/Makefile 377 chan_capi-%{V_chan_capi}/Makefile
365 %{l_shtool} subst \ 378 case "%{l_platform -t}" in
366 -e 's;if.*SSL_CTX_use_certificate_file.*;if (SSL_CTX_use_certificate_chain_file(cfg->ssl_ctx, cfg->certfile) == 0) {;' \ 379 *-sunos* )
367 main/tcptls.c 380 %{l_shtool} subst \
381 -e 's;SO_SUPPRESS_SYMBOLS=-Wl,--version-script,[a-zA-Z0-9@\-_,\.()\$ ][a-zA-Z0-9@\-_,\.()\$ ]*;LOCAL_NOOP=0;' \
382 -e 's;ASTLINK+=-Wl,--version-script,[a-zA-Z0-9\-_\.,][a-zA-Z0-9\-_\.,]*;LOCAL_NOOP=0;' \
383 -e 's;-Wl,--version-script=[^ ][^ ]* *;;' \
384 Makefile.rules \
385 main/Makefile \
386 main/db1-ast/Makefile
387 ;;
388 esac
368 389
369 %build 390 %build
370 # sanity check operating system 391 # sanity check operating system
371 %if "%{with_dahdi}" == "yes" 392 %if "%{with_dahdi}" == "yes"
372 dahdi_prefix="" 393 dahdi_prefix=""
386 * ) echo "option \"with_dahdi\" supported under Linux and FreeBSD only" 1>&2; exit 1 ;; 407 * ) echo "option \"with_dahdi\" supported under Linux and FreeBSD only" 1>&2; exit 1 ;;
387 esac 408 esac
388 %endif 409 %endif
389 # correct platform dependent build configuration 410 # correct platform dependent build configuration
390 extflg= 411 extflg=
412 loclibs="-lssl -lcrypto"
391 case "%{l_platform -t}" in 413 case "%{l_platform -t}" in
392 *-linux* ) 414 *-linux* )
393 pthlibflg='-lpthread' 415 pthlibflg='-lpthread'
394 ;; 416 ;;
417 *-sunos* )
418 loclibs="$loclibs -lsocket -lnsl"
419 ;;
395 esac 420 esac
396 421
397 # adapt buildconf to find mpg123 (for music on hold) 422 # adapt buildconf to find mpg123 (for music on hold)
398 %if "%{with_mp3}" == "yes" 423 %if "%{with_mp3}" == "yes"
399 mpg123="%{l_prefix}/bin/mpg123" 424 mpg123="%{l_prefix}/bin/mpg123"
404 -e "s;/usr/local/bin/mpg123;$mpg123;" \ 429 -e "s;/usr/local/bin/mpg123;$mpg123;" \
405 -e "s;/usr/bin/mpg123;$mpg123;" \ 430 -e "s;/usr/bin/mpg123;$mpg123;" \
406 res/res_musiconhold.c apps/app_mp3.c 431 res/res_musiconhold.c apps/app_mp3.c
407 432
408 # configure program 433 # configure program
409 ( echo "ac_cv_prog_CONFIG_GMIME=%{l_prefix}/bin/gmime-config"
410 ) >config.cache
411 cflags="%{l_cflags -O}" 434 cflags="%{l_cflags -O}"
412 cppflags="%{l_cppflags ncurses lua}" 435 cppflags="%{l_cppflags ncurses lua}"
413 ldflags="%{l_ldflags}" 436 ldflags="%{l_ldflags}"
414 libs="" 437 cppflags="$cppflags"
415 cppflags="$cppflags `pkg-config gmime-2.4 --cflags-only-I`" 438 ldflags="$ldflags"
416 ldflags="$ldflags `pkg-config gmime-2.4 --libs-only-L`"
417 libs="$libs `pkg-config gmime-2.4 --libs-only-l` -lssl -lcrypto"
418 %if "%{with_ogg}" == "yes" 439 %if "%{with_ogg}" == "yes"
419 libs="$libs -logg -lm" 440 loclibs="$loclibs -logg -lm"
420 %endif 441 %endif
421 %if "%{with_avcodec}" == "yes" 442 %if "%{with_avcodec}" == "yes"
422 libs="$libs -lavcodec -lavutil" 443 loclibs="$loclibs -lavcodec -lavutil"
423 %endif 444 %endif
424 %if "%{with_ldap}" == "yes" 445 %if "%{with_ldap}" == "yes"
425 libs="$libs -lldap -llber" 446 loclibs="$loclibs -lldap -llber"
426 %endif 447 %endif
427 %if "%{with_dahdi}" == "yes" 448 %if "%{with_dahdi}" == "yes"
428 cppflags="$cppflags -I$dahdi_prefix/include" 449 cppflags="$cppflags -I$dahdi_prefix/include"
429 ldflags="$ldflags -L$dahdi_prefix/lib" 450 ldflags="$ldflags -L$dahdi_prefix/lib"
430 %endif 451 %endif
431 CC="%{l_cc}" \ 452 CC="%{l_cc}" \
432 CFLAGS="$cflags" \ 453 CFLAGS="$cflags" \
433 CPPFLAGS="$cppflags" \ 454 CPPFLAGS="$cppflags" \
434 LDFLAGS="$ldflags" \ 455 LDFLAGS="$ldflags" \
435 LIBS="$libs" \ 456 LIBS="$loclibs" \
436 INSTALL="%{l_shtool} install -c" \ 457 INSTALL="%{l_shtool} install -c" \
437 PTHREAD_LIBS="$pthlibflg" \ 458 PTHREAD_LIBS="$pthlibflg" \
438 ./configure \ 459 ./configure \
439 --cache-file=./config.cache \ 460 --cache-file=./config.cache \
440 --prefix=%{l_prefix} \ 461 --prefix=%{l_prefix} \
522 --with-pri=%{l_prefix} \ 543 --with-pri=%{l_prefix} \
523 %else 544 %else
524 --without-pri \ 545 --without-pri \
525 %endif 546 %endif
526 --with-sounds-cache=%_sourcedir \ 547 --with-sounds-cache=%_sourcedir \
548 --with-libxml2=%{l_prefix} \
527 --without-netsnmp \ 549 --without-netsnmp \
528 --without-isdnnet \ 550 --without-isdnnet \
529 --without-misdn \ 551 --without-misdn \
530 --without-nbs \ 552 --without-nbs \
531 --without-newt \ 553 --without-newt \
559 menuselect/menuselect --enable IMAP_STORAGE menuselect.makeopts 581 menuselect/menuselect --enable IMAP_STORAGE menuselect.makeopts
560 %endif 582 %endif
561 583
562 # build program 584 # build program
563 %{l_make} %{l_mflags -O} \ 585 %{l_make} %{l_mflags -O} \
564 CC="%{l_cc} $cflags -I../include -I../../include $cppflags" NOISY_BUILD=yes 586 CC="%{l_cc} $cflags -I../include $cppflags" NOISY_BUILD=yes
565 587
566 %if "%{with_capi}" == "yes" 588 %if "%{with_capi}" == "yes"
567 # build capi channel 589 # build capi channel
568 ( cd chan_capi-* 590 ( cd chan_capi-*
569 ln -s ../include/asterisk . 591 ln -s ../include/asterisk .
616 exit 1; 638 exit 1;
617 ;; 639 ;;
618 esac 640 esac
619 %endif 641 %endif
620 642
621 ( echo 'Start of sound installation block (RPM)' 643 ( echo 'Start of sound installation block (OpenPKG)'
622 %if "%{with_esounds}" == "yes" 644 %if "%{with_esounds}" == "yes"
645 # create sound directory hierarchy
646 for sndir in en es fr ru en_AU moh; do
647 %{l_shtool} mkdir -f -p -m 755 \
648 $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/$sndir
649 done
623 # install freeswitch sound prompt files, expecting 650 # install freeswitch sound prompt files, expecting
624 # identical sound filenames to be overwritten later 651 # identical sound filenames to be overwritten later
625 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en 652 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en
626 %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-en-us-callie-48000-%{V_fswitch_sounds_en}.tar.gz 653 %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-en-us-callie-48000-%{V_fswitch_sounds_en}.tar.gz
627 subs=`( cd en/us/callie && find * -type d -prune )` 654 subs=`( cd en/us/callie && find * -type d -prune )`
636 for subdir in $subs; do 663 for subdir in $subs; do
637 mkdir $subdir 664 mkdir $subdir
638 mv -f es/mx/maria/$subdir/*/* ${subdir}/ 665 mv -f es/mx/maria/$subdir/*/* ${subdir}/
639 done 666 done
640 rm -rf es 667 rm -rf es
641 %{l_shtool} mkdir -f -p -m 755 \
642 $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/ru
643 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/ru 668 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/ru
644 %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-ru-RU-elena-48000-%{V_fswitch_sounds_ru}.tar.gz 669 %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-ru-RU-elena-48000-%{V_fswitch_sounds_ru}.tar.gz
645 subs=`( cd ru/RU/elena && find * -type d -prune )` 670 subs=`( cd ru/RU/elena && find * -type d -prune )`
646 for subdir in $subs; do 671 for subdir in $subs; do
647 mkdir $subdir 672 mkdir $subdir
662 %{l_prefix}/bin/sox $highfile -t raw -r 16000 -s -2 -c 1 $lowfile 687 %{l_prefix}/bin/sox $highfile -t raw -r 16000 -s -2 -c 1 $lowfile
663 rm $highfile 688 rm $highfile
664 done 689 done
665 %endif 690 %endif
666 691
667 # install australian nonversioned sound prompt files
668 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en_AU
669 %{l_tar} zxf %%{_sourcedir}/asterisk-core-sounds-en_AU-sln16-%{V_asterisk_sounds_core}.tar.gz
670
671 # install main sound prompt files 692 # install main sound prompt files
672 #for codec in alaw ulaw g722 g729 gsm; do 693 #for codec in alaw ulaw g722 g729 gsm; do
673 for lang in en es fr; do 694 for lang in en en_AU es fr; do
674 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/${lang} 695 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/${lang}
675 %{l_tar} zxf %{_sourcedir}/asterisk-core-sounds-${lang}-sln16-%{V_asterisk_sounds_core}.tar.gz 696 %{l_tar} zxf %{_sourcedir}/asterisk-core-sounds-${lang}-sln16-%{V_asterisk_sounds_core}.tar.gz
676 done 697 done
677 for lang in en fr; do 698 for lang in en fr; do
678 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/${lang} 699 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/${lang}

mercurial