Ticket #43011: Portfile-perl-PortGroup.diff

File Portfile-perl-PortGroup.diff, 9.2 KB (added by pixilla (Bradley Giesbrecht), 10 years ago)

Example use or perl5 port group to ease variant creation.

  • Portfile

    old new  
    4646  if {${subport} eq "${name}1"} {
    4747    ## change perl exec for all script (how to do it per variant?)
    4848    foreach file [glob -directory ${destroot}${prefix}/bin cif*] {
    49         if {[variant_isset perl5_16]} {
    50             reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.16|" ${file}
    51         } elseif {[variant_isset perl5_18]} {
    52             reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.18|" ${file}
    53         } elseif {[variant_isset perl5_20]} {
    54             reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.20|" ${file}
    55         }
    56     }
    57     if {[variant_isset perl5_16]} {
    58         reinplace "s|/usr/bin/env perl|${prefix}/bin/perl5.16|" ${destroot}${prefix}/bin/cif
    59     } elseif {[variant_isset perl5_18]} {
    60         reinplace "s|/usr/bin/env perl|${prefix}/bin/perl5.18|" ${destroot}${prefix}/bin/cif
    61     } elseif {[variant_isset perl5_20]} {
    62         reinplace "s|/usr/bin/env perl|${prefix}/bin/perl5.20|" ${destroot}${prefix}/bin/cif
     49        reinplace "s|/usr/bin/perl|${prefix}/bin/perl${perl5.major}|" ${file}
    6350    }
     51    reinplace "s|/usr/bin/env perl|${prefix}/bin/perl${perl5.major}|" ${destroot}${prefix}/bin/cif
    6452    reinplace "s|/opt/cif|${prefix}|" ${destroot}${prefix}/bin/cif_crontool
    6553    reinplace "s|/opt/cif/etc|${prefix}/etc/cif|" ${destroot}${prefix}/bin/cif_smrt
    6654    xinstall -m 755 -d ${destroot}${prefix}/etc/cif
     
    186174
    187175subport ${name}1 {
    188176
     177    PortGroup           perl5 1.0
     178
    189179    version             1.0.3-FINAL
    190180    master_sites        https://github.com/collectiveintel/cif-v1/releases/download/v${version}/
    191181
     
    305295   https://code.google.com/p/collective-intelligence-framework/wiki/ServerBackup_v1
    306296"
    307297
    308 if {![variant_isset perl5_16] && ![variant_isset perl5_18] && ![variant_isset perl5_20]} {
    309     default_variants-append    +perl5_16
    310     ## FIXME! have unfound perl dependencies when trying 5.18
    311 }
    312298if {![variant_isset pgsql93] && ![variant_isset pgsql92] && ![variant_isset pgsql91] && ![variant_isset pgsql90] && ![variant_isset pgsql84]} {
    313299    default_variants-append    +pgsql93
    314300}
     
    317303## http://search.cpan.org/~jkutej/Test-Environment-0.06/    Apache2::RequestRec         UNAUTHORIZED
    318304##    Linux::Cpuinfo        Linux only?
    319305## FIXME! ZeroMQ deps on v2 (zmq22) or v3
    320 variant perl5_16 description { use Perl 5.16 bindings } conflicts perl5_18 perl5_20 {
    321     ## miss ossp::uuid but pulled off in cpan, maybe replaced by UUID::Tiny
    322     ## MISS (from linux): Test::SharedFork, Test::TCP, snort-rule, parse-range
    323     ##    https://groups.google.com/forum/#!searchin/ci-framework/ossp$3A$3Auuid/ci-framework/21J3oGwLka4/NvpEESG7pwQJ
    324     depends_lib-append port:perl5.16 port:p5.16-digest-sha port:p5.16-digest-sha1 \
    325         port:p5.16-log-dispatch port:p5.16-list-moreutils port:p5.16-datetime \
    326         port:p5.16-net-ssleay port:p5.16-config-simple \
    327         port:p5.16-encode-locale port:p5.16-compress-snappy port:p5.16-net-patricia \
    328         port:p5.16-iodef-pb-simple port:p5.16-datetime-format-dateparse \
    329         port:p5.16-google-protocolbuffers port:p5.16-class-accessor \
    330         port:p5.16-parse-recdescent port:p5.16-mime-lite port:p5.16-dbi \
    331         port:p5.16-dbd-pg port:p5.16-class-dbi port:p5.16-zeromq \
    332         port:p5.16-lwpx-paranoidagent port:p5.16-net-abuse-utils \
    333         port:p5.16-uri port:p5.16-xml-rss port:p5.16-net-dns-match \
    334         port:p5.16-regexp-common port:p5.16-lwp-protocol-https \
    335         port:p5.16-net-abuse-utils-spamhaus port:p5.16-sys-meminfo \
    336         port:p5.16-file-type port:p5.16-libwww-perl port:p5.16-class-trigger \
    337         port:p5.16-regexp-common-net-cidr port:p5.16-text-table \
    338         port:p5.16-text-aligner port:p5.16-net-dns port:p5.16-net-whois-ip \
    339         port:p5.16-regexp-ipv6 port:p5.16-email-address port:p5.16-linux-cpuinfo \
    340         port:p5.16-apache2-rest port:p5.16-class-autoaccess \
    341         port:p5.16-module-pluggable
    342     configure.args-append  --with-perl --with-perl-compat
    343     configure.env-append   PERL=${prefix}/bin/perl5.16
    344 }
    345 
    346 variant perl5_18 description { use Perl 5.18 bindings } conflicts perl5_16 perl5_20 {
    347     depends_lib-append port:perl5.18 port:p5.18-digest-sha port:p5.18-digest-sha1 \
    348         port:p5.18-log-dispatch port:p5.18-list-moreutils port:p5.18-datetime \
    349         port:p5.18-net-ssleay port:p5.18-config-simple \
    350         port:p5.18-encode-locale port:p5.18-compress-snappy port:p5.18-net-patricia \
    351         port:p5.18-iodef-pb-simple port:p5.18-datetime-format-dateparse \
    352         port:p5.18-google-protocolbuffers port:p5.18-class-accessor \
    353         port:p5.18-parse-recdescent port:p5.18-mime-lite port:p5.18-dbi \
    354         port:p5.18-dbd-pg port:p5.18-class-dbi port:p5.18-zeromq \
    355         port:p5.18-lwpx-paranoidagent port:p5.18-net-abuse-utils \
    356         port:p5.18-uri port:p5.18-xml-rss port:p5.18-net-dns-match \
    357         port:p5.18-regexp-common port:p5.18-lwp-protocol-https \
    358         port:p5.18-net-abuse-utils-spamhaus port:p5.18-sys-meminfo \
    359         port:p5.18-file-type port:p5.18-libwww-perl port:p5.18-class-trigger \
    360         port:p5.18-regexp-common-net-cidr port:p5.18-text-table \
    361         port:p5.18-text-aligner port:p5.18-net-dns port:p5.18-net-whois-ip \
    362         port:p5.18-regexp-ipv6 port:p5.18-email-address port:p5.18-linux-cpuinfo \
    363         port:p5.18-apache2-rest port:p5.16-class-autoaccess \
    364         port:p5.18-module-pluggable
    365     configure.args-append  --with-perl --with-perl-compat
    366     configure.env-append   PERL=${prefix}/bin/perl5.18
    367 }
    368 
    369 variant perl5_20 description { use Perl 5.20 bindings } conflicts perl5_16 perl5_18 {
    370     depends_lib-append port:perl5.20 port:p5.20-digest-sha port:p5.20-digest-sha1 \
    371         port:p5.20-log-dispatch port:p5.20-list-moreutils port:p5.20-datetime \
    372         port:p5.20-net-ssleay port:p5.20-config-simple \
    373         port:p5.20-encode-locale port:p5.20-compress-snappy port:p5.20-net-patricia \
    374         port:p5.20-iodef-pb-simple port:p5.20-datetime-format-dateparse \
    375         port:p5.20-google-protocolbuffers port:p5.20-class-accessor \
    376         port:p5.20-parse-recdescent port:p5.20-mime-lite port:p5.20-dbi \
    377         port:p5.20-dbd-pg port:p5.20-class-dbi port:p5.20-zeromq \
    378         port:p5.20-lwpx-paranoidagent port:p5.20-net-abuse-utils \
    379         port:p5.20-uri port:p5.20-xml-rss port:p5.20-net-dns-match \
    380         port:p5.20-regexp-common port:p5.20-lwp-protocol-https \
    381         port:p5.20-net-abuse-utils-spamhaus port:p5.20-sys-meminfo \
    382         port:p5.20-file-type port:p5.20-libwww-perl port:p5.20-class-trigger \
    383         port:p5.20-regexp-common-net-cidr port:p5.20-text-table \
    384         port:p5.20-text-aligner port:p5.20-net-dns port:p5.20-net-whois-ip \
    385         port:p5.20-regexp-ipv6 port:p5.20-email-address port:p5.20-linux-cpuinfo \
    386         port:p5.20-apache2-rest port:p5.16-class-autoaccess \
    387         port:p5.20-module-pluggable
    388     configure.args-append  --with-perl --with-perl-compat
    389     configure.env-append   PERL=${prefix}/bin/perl5.20
    390 }
     306perl5.branches      5.16 5.18 5.20
     307perl5.default_branch 5.16
     308perl5.create_variants ${perl5.branches}
     309
     310## miss ossp::uuid but pulled off in cpan, maybe replaced by UUID::Tiny
     311## MISS (from linux): Test::SharedFork, Test::TCP, snort-rule, parse-range
     312##    https://groups.google.com/forum/#!searchin/ci-framework/ossp$3A$3Auuid/ci-framework/21J3oGwLka4/NvpEESG7pwQJ
     313depends_lib-append port:perl${perl5.major} port:p${perl5.major}-digest-sha port:p${perl5.major}-digest-sha1 \
     314    port:p${perl5.major}-log-dispatch port:p${perl5.major}-list-moreutils port:p${perl5.major}-datetime \
     315    port:p${perl5.major}-net-ssleay port:p${perl5.major}-config-simple \
     316    port:p${perl5.major}-encode-locale port:p${perl5.major}-compress-snappy port:p${perl5.major}-net-patricia \
     317    port:p${perl5.major}-iodef-pb-simple port:p${perl5.major}-datetime-format-dateparse \
     318    port:p${perl5.major}-google-protocolbuffers port:p${perl5.major}-class-accessor \
     319    port:p${perl5.major}-parse-recdescent port:p${perl5.major}-mime-lite port:p${perl5.major}-dbi \
     320    port:p${perl5.major}-dbd-pg port:p${perl5.major}-class-dbi port:p${perl5.major}-zeromq \
     321    port:p${perl5.major}-lwpx-paranoidagent port:p${perl5.major}-net-abuse-utils \
     322    port:p${perl5.major}-uri port:p${perl5.major}-xml-rss port:p${perl5.major}-net-dns-match \
     323    port:p${perl5.major}-regexp-common port:p${perl5.major}-lwp-protocol-https \
     324    port:p${perl5.major}-net-abuse-utils-spamhaus port:p${perl5.major}-sys-meminfo \
     325    port:p${perl5.major}-file-type port:p${perl5.major}-libwww-perl port:p${perl5.major}-class-trigger \
     326    port:p${perl5.major}-regexp-common-net-cidr port:p${perl5.major}-text-table \
     327    port:p${perl5.major}-text-aligner port:p${perl5.major}-net-dns port:p${perl5.major}-net-whois-ip \
     328    port:p${perl5.major}-regexp-ipv6 port:p${perl5.major}-email-address port:p${perl5.major}-linux-cpuinfo \
     329    port:p${perl5.major}-apache2-rest port:p${perl5.major}-class-autoaccess \
     330    port:p${perl5.major}-module-pluggable
     331configure.args-append  --with-perl --with-perl-compat
     332configure.env-append   PERL=${prefix}/bin/perl${perl5.major}
     333
    391334
    392335## choice: 7 80 81 82 83 84 90 91 92 93
    393336variant pgsql84 description { use PostgreSQL 8.4 bindings } conflicts pgsql90 pgsql91 pgsql93 pgsql90 {