Ticket #43233: patch-asterisk-Portfile.2.diff

File patch-asterisk-Portfile.2.diff, 4.9 KB (added by jul_bsd@…, 10 years ago)
  • net/asterisk/Portfile

    old new  
    44PortSystem          1.0
    55
    66name                asterisk
    7 version             1.6.2.20
     7version             12.1.1
    88categories          net
    99license             GPL-2
    1010platforms           darwin
     
    3333                    port:spandsp-devel \
    3434                    port:speex \
    3535                    port:sqlite3 \
    36                     port:wget
     36                    port:wget \
     37                    port:jansson
     38## Optional components: libpri DAHDI
     39
     40## need specific ice-cpp w patch https://wiki.asterisk.org/wiki/display/TOP/System+Requirements
     41depends_build       port:cmake port:boost
     42# port:zeroc-ice34 => fails to build
    3743
    38 checksums           rmd160  8584d0f2e274517ce84576dfa7e936b9befb9fe2 \
    39                     sha256  4f3ef1de4644195e0d91816d6741c46ddb5d9ad28b07e631f594674ac9006a27
     44checksums           rmd160  def51844b5bca9ad3faa8964272c58cbfaf6c150 \
     45                    sha256  c53f51b2dea22ca5b2f042562cfc9e021f9dbda64293ef3652f569f86f65b4ba
    4046
    4147startupitem.create      yes
    4248startupitem.netchange   yes
    43 startupitem.executable  ${prefix}/sbin/asterisk -d
     49startupitem.executable  ${prefix}/sbin/asterisk -d -U asterisk -G asterisk -C ${prefix}/etc/asterisk.conf
    4450
    4551universal_variant   no
    4652
    47 patchfiles          makeopts.in.diff menuselect_Makefile.diff
     53#patchfiles          makeopts.in.diff menuselect_Makefile.diff
     54patchfiles          patch-makeopts.in.diff
    4855
    4956configure.args      --without-h323 \
    50                     --without-netsnmp
     57                    --without-netsnmp \
     58                    --with-crypto=${prefix} --with-curses=${prefix} \
     59                    --with-iconv=${prefix} --with-sqlite3=${prefix} \
     60                    --with-ssl=${prefix}
    5161
    5262configure.optflags  -O3
     63## http://comments.gmane.org/gmane.comp.telephony.pbx.asterisk.devel/62632
     64configure.compiler  macports-gcc-4.9
    5365
    5466build.env           ASTCFLAGS=-I${prefix}/include \
    5567                    ASTLDFLAGS=-L${prefix}/lib \
     
    6779                    ${destroot}${prefix}/var/spool/asterisk/tmp \
    6880                    ${destroot}${prefix}/var/spool/asterisk/voicemail
    6981
     82#pre-configure {
     83#    system "cd ${worksrcpath} && ./cmake/init-cmake.sh -DCMAKE_INSTALL_PREFIX=${prefix}"
     84#}
     85
     86post-configure {
     87    addgroup asterisk
     88    add_users asterisk gid=[existsgroup asterisk] home=${prefix}/var/spool/asterisk shell=/sbin/nologin realname=Asterisk\ user
     89}
     90
    7091variant home_sound_cache description {Use/Build sound file cache from .asterisk_sounds_cache in your home directory} {
    7192    configure.args-append --with-sounds-cache=~/.asterisk_sounds_cache
    7293}
    7394
     95variant snmp description { snmp support } {
     96    depends_lib           port:net-snmp
     97    configure.args-delete --without-netsnmp
     98    configure.args-append --with-netsnmp=${prefix}
     99}
     100
     101variant libpri description { libpri support } {
     102    depends_lib           port:libpri
     103    configure.args-append --with-pri=${prefix}
     104}
     105
     106variant dahdi description { dahdi support } {
     107    depends_lib           port:dahdi
     108    configure.args-append --with-dahdi=${prefix}
     109}
     110
     111variant ldap description { ldap support } {
     112    depends_lib-append    port:openldap
     113    configure.args-append --with-ldap=${prefix}
     114}
     115
     116variant libiodbc description { use libiodbc for ODBC access } {
     117    depends_lib-append port:libiodbc
     118}
     119
     120variant unixodbc description { use unixodbc for ODBC access } {
     121    depends_lib-append port:unixODBC
     122}
     123
    74124post-destroot {
    75     system "rsync -a ${worksrcpath}/configs/*.sample ${destroot}${prefix}/etc/asterisk"
    76     xinstall -m 644 ${filespath}/asterisk.conf.sample.in ${destroot}${prefix}/etc/asterisk/asterisk.conf.sample
    77     reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${prefix}/etc/asterisk/asterisk.conf.sample
    78     xinstall -d ${destroot}${prefix}/var/log/asterisk \
     125    xinstall -d ${destroot}${prefix}/share/examples/${name}
     126    system "rsync -a ${worksrcpath}/configs/*.sample ${destroot}${prefix}/share/examples/${name}/"
     127    xinstall -m 644 ${filespath}/asterisk.conf.sample.in ${destroot}${prefix}/share/examples/${name}/asterisk.conf.sample
     128    reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${prefix}/share/examples/${name}/asterisk.conf.sample
     129    xinstall -d -o asterisk -g asterisk ${destroot}${prefix}/var/log/asterisk \
    79130                ${destroot}${prefix}/var/run/asterisk \
    80131                ${destroot}${prefix}/var/spool/asterisk/outgoing
    81132}
     133
     134post-activate {
     135     foreach f [glob -directory ${prefix}/share/examples/${name} *.sample] {
     136         set fname [file tail $f]
     137         set fname trimright .sample
     138         if ![file exists ${prefix}/etc/${name}/${fname} ] {
     139            copy ${f} ${prefix}/etc/${name}/${fname}
     140         }
     141     }
     142}
     143
     144livecheck.type     regex
     145livecheck.url       ${homepage}/downloads/asterisk/all-asterisk-versions
     146livecheck.regex     "<p>Latest Version - (\\d+(?:\\.\\d+)*)</p>"