source: trunk/dports/net/snmptt/Portfile

Last change on this file was 151855, checked in by mojca@…, 13 months ago

snmptt: switch to perl5.24 (#52081)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.3 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 151855 2016-08-23 12:23:48Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           perl5 1.0
6
7name                snmptt
8version             1.4
9revision            1
10categories          net
11license             GPL-2+
12maintainers         nomaintainer
13description         An SNMP trap handler written in Perl for use with the Net-SNMP / UCD-SNMP snmptrapd program
14long_description    ${description}
15
16platforms           darwin
17supported_archs     noarch
18homepage            http://www.snmptt.org/
19master_sites        sourceforge:snmptt
20extract.suffix      .tgz
21distname            ${name}_${version}
22
23checksums           rmd160  91514f21f05d41a4ccaf789f2033f3389f2ed989 \
24                    sha256  512c33ecdf06da8b3c75082c1506e4b4091ddb714d0d9564771aa12ddc98ef99
25
26perl5.branches      5.24
27depends_lib         port:perl${perl5.major} \
28                    port:p${perl5.major}-config-inifiles
29
30use_configure       no
31build               {}
32
33set bindir          ${prefix}/sbin
34set docsdir         ${prefix}/share/doc/${name}
35set etcdir          ${prefix}/etc/${name}
36set scriptdir       ${prefix}/share/${name}
37
38post-patch {
39    reinplace "s|/usr/bin/perl|${perl5.bin}|g" \
40        ${worksrcpath}/snmptt \
41        ${worksrcpath}/snmptt-net-snmp-test \
42        ${worksrcpath}/snmpttconvert \
43        ${worksrcpath}/snmpttconvertmib \
44        ${worksrcpath}/snmptthandler
45
46    reinplace "s|/etc/snmp/snmptt.ini|${prefix}/etc/${name}/snmptt.ini|g" \
47        ${worksrcpath}/snmptt \
48        ${worksrcpath}/snmptthandler
49
50    reinplace "s|/etc/snmp/snmptt.conf|${prefix}/etc/snmptt.conf|g" \
51        ${worksrcpath}/snmptt.ini
52}
53
54destroot {
55    xinstall -m 755 -d ${destroot}${bindir}
56    xinstall -m 755 -d ${destroot}${docsdir}/docs
57    xinstall -m 755 -d ${destroot}${scriptdir}
58    xinstall -m 755 -d ${destroot}${etcdir}
59
60    xinstall -m 755 -W ${worksrcpath} snmptt snmptt-net-snmp-test snmpttconvert \
61        snmpttconvertmib snmptthandler                           ${destroot}${bindir}
62
63    xinstall -m 755 -W ${worksrcpath}/docs faqs.html index.html layout1.css \
64        snmptt.html snmpttconvert.html snmpttconvertmib.html     ${destroot}${docsdir}/docs
65
66    xinstall -m 755 -W ${worksrcpath} ChangeLog INSTALL README   ${destroot}${docsdir}
67
68    eval xinstall -m 644 [glob ${worksrcpath}/sample-*]          ${destroot}${docsdir}
69    eval xinstall -m 644 [glob ${worksrcpath}/examples/*-trap.*] ${destroot}${docsdir}
70
71    xinstall -m 644 ${worksrcpath}/snmptt.ini                    ${destroot}${etcdir}/snmptt.ini.sample
72    xinstall -m 644 ${worksrcpath}/examples/snmptt.conf.generic  ${destroot}${etcdir}
73    xinstall -m 755 ${worksrcpath}/snmptt-init.d                 ${destroot}${docsdir}
74}
75
76post-activate {
77ui_msg "\n
78
79snmptt setup:
80
81-Rename the ${prefix}/etc/${name}/snmptt.ini.sample file to remove the trailing
82\"sample\" so snmptt will be able to find its configuration, and customize the
83 file as necessary.
84
85-Use snmpttconvertmib to build an ${prefix}/etc/snmptt.conf file with translations from
86 MIB files for your devices as described in the documentation.
87
88
89snmptrapd setup:
90
91-Edit your snmptrapd.conf (you may use the snmpconf utility) and make sure that
92 these items are present.
93
94    traphandle  default ${perl5.bin} ${prefix}/sbin/snmptt
95
96\n"
97}
98
99livecheck.regex     {/snmptt/snmptt_([0-9.]+)/}
Note: See TracBrowser for help on using the repository browser.