source: trunk/dports/net/net-snmp/Portfile

Last change on this file was 154109, checked in by ryandesign@…, 13 months ago

net-snmp: Fix build failure with perl5.24

Resolves #52214

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 154109 2016-10-20 04:31:17Z ryandesign@macports.org $
3
4PortSystem              1.0
5PortGroup               perl5 1.0
6
7name                    net-snmp
8version                 5.7.3
9revision                6
10categories              net
11license                 BSD
12platforms               darwin
13maintainers             ryandesign openmaintainer
14homepage                http://net-snmp.sourceforge.net/
15master_sites            sourceforge:project/${name}/${name}/${version}
16
17description             An extendable SNMP implementation
18
19long_description        This is net-snmp, a derivative of CMU's SNMP \
20                        package. Various tools relating to the Simple \
21                        Network Management Protocol including: an extensible \
22                        agent, an SNMP library, tools to request or set \
23                        information from SNMP agents, tools to generate and \
24                        handle SNMP traps, a version of the unix 'netstat' \
25                        command using SNMP, a Tk/perl MIB browser.
26
27checksums               rmd160  c5cf54d5723ee417e07f1f9fa3936aef505104a2 \
28                        sha256  12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0
29
30perl5.branches          5.24
31
32depends_lib             port:bzip2 \
33                        port:perl${perl5.major} \
34                        port:zlib
35
36post-extract {
37    # darwin14.h and above do not exist in 5.7.3
38    # https://sourceforge.net/p/net-snmp/bugs/2504/
39    copy ${worksrcpath}/include/net-snmp/system/darwin13.h ${worksrcpath}/include/net-snmp/system/darwin14.h
40    copy ${worksrcpath}/include/net-snmp/system/darwin13.h ${worksrcpath}/include/net-snmp/system/darwin15.h
41    copy ${worksrcpath}/include/net-snmp/system/darwin13.h ${worksrcpath}/include/net-snmp/system/darwin16.h
42    copy ${worksrcpath}/include/net-snmp/system/darwin13.h ${worksrcpath}/include/net-snmp/system/darwin17.h
43    copy ${worksrcpath}/include/net-snmp/system/darwin13.h ${worksrcpath}/include/net-snmp/system/darwin18.h
44}
45
46patchfiles-append       patch-agent-mibgroup-mibII-icmp.h.diff
47patchfiles-append       patch-configure.diff
48patchfiles-append       patch-include-net-snmp-system-darwin11.h.diff
49patchfiles-append       patch-include-net-snmp-system-darwin12.h.diff
50patchfiles-append       patch-include-net-snmp-system-darwin13.h.diff
51patchfiles-append       patch-include-net-snmp-system-darwin14.h.diff
52patchfiles-append       patch-include-net-snmp-system-darwin15.h.diff
53patchfiles-append       patch-include-net-snmp-system-darwin16.h.diff
54patchfiles-append       patch-include-net-snmp-system-darwin17.h.diff
55patchfiles-append       patch-include-net-snmp-system-darwin18.h.diff
56patchfiles-append       patch-Makefile.in.diff
57patchfiles-append       PR-52214.patch
58patchfiles-append       0001-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch
59
60configure.env-append    PERLPROG=${perl5.bin}
61
62configure.args          --with-defaults \
63                        --with-sys-contact=nobody@no.where \
64                        --with-persistent-directory=${prefix}/var/net-snmp \
65                        --with-logfile=${prefix}/var/log \
66                        --without-openssl \
67                        --with-zlib=${prefix} \
68                        --with-bzip2=${prefix} \
69                        --with-install-prefix=${destroot} \
70                        --without-elf \
71                        --without-kmem-usage \
72                        --enable-ipv6 \
73                        --with-out-mib-modules=mibII/ipv6
74
75variant ssl description {Enable ssl support} {
76    depends_lib-append  path:lib/libssl.dylib:openssl
77    configure.args-replace --without-openssl --with-openssl=${prefix}
78}
79default_variants +ssl
80
81variant ksm description {Enable support for kerberos-based SNMP security} {
82    depends_lib-append  port:kerberos5
83    configure.args-append --with-security-modules="usm ksm"
84}
85
86post-build {
87    reinplace -E {s|-arch [a-z0-9_]+||g} \
88        ${worksrcpath}/net-snmp-config \
89        ${worksrcpath}/net-snmp-create-v3-user
90}
91
92post-destroot {
93    destroot.keepdirs ${destroot}${prefix}/var/net-snmp
94    foreach packlist [exec find ${destroot} -name .packlist] {
95        ui_info "Fixing packlist ${packlist}"
96        reinplace "s|${destroot}||" ${packlist}
97    }
98    foreach badfile [exec find ${destroot} -name perllocal.pod] {
99        ui_info "Removing ${badfile}"
100        file delete ${badfile}
101    }
102}
103
104startupitem.create      yes
105startupitem.executable  ${prefix}/sbin/snmpd -f
106
107livecheck.type          regex
108livecheck.url           ${homepage}download.html
109livecheck.regex         {net-snmp/([0-9.]+)/}
Note: See TracBrowser for help on using the repository browser.