Commits
Kurt Hindenburg authored db410e04b57
1 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 2 | |
3 3 | PortSystem 1.0 |
4 4 | |
5 5 | name vnstat |
6 - | version 1.14 |
6 + | version 1.17 |
7 7 | categories net |
8 8 | platforms darwin |
9 9 | maintainers nomaintainer |
10 10 | license GPL-2 |
11 11 | description console-based network traffic monitor |
12 12 | long_description \ |
13 13 | vnStat is a console-based network traffic monitor for Linux and BSD that keeps \ |
14 14 | a log of network traffic for the selected interface(s), it uses the network \ |
15 15 | interface statistics provided by the kernel as information source. This means \ |
16 16 | that vnStat won't actually be sniffing any traffic and also ensures light use \ |
17 17 | of system resources. |
18 18 | |
19 19 | homepage http://humdi.net/vnstat/ |
20 - | depends_lib port:gd2 |
21 20 | master_sites http://humdi.net/${name} |
22 21 | |
23 - | checksums rmd160 9cbe5d4f11d757ae19db4b38155de63a8caf6164 \ |
24 - | sha256 f8462a47d85d0890493dc9eaeafbc725ae631aa5b103fb7f8af4ddb2314e8386 |
22 + | checksums rmd160 368470756380fd5d1092abcb1614e06a2aa7d995 \ |
23 + | sha256 18e4c53576ca9e1ef2f0e063a6d83b0c44e3b1cf008560d658745df5c9aa7971 |
25 24 | |
26 - | post-patch { |
27 - | # fix Makefile |
28 - | reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile |
29 - | reinplace "s|${prefix}/man|${prefix}/share/man|g" ${worksrcpath}/Makefile |
30 - | reinplace "s|(DESTDIR)/etc|(DESTDIR)${prefix}/etc|g" ${worksrcpath}/Makefile |
31 - | reinplace "s|(DESTDIR)/var|(DESTDIR)${prefix}/var|g" ${worksrcpath}/Makefile |
25 + | depends_lib port:gd2 |
32 26 | |
27 + | post-patch { |
33 28 | # fix occurrences of /var/db references in other files |
34 29 | reinplace "s|/var|${prefix}/var|g" ${worksrcpath}/src/common.h \ |
35 30 | ${worksrcpath}/cfg/vnstat.conf \ |
36 31 | ${worksrcpath}/man/vnstat.1 \ |
37 32 | ${worksrcpath}/man/vnstatd.1 \ |
38 33 | ${worksrcpath}/man/vnstati.1 |
39 34 | reinplace "s|/var/lib|/var/db|g" ${worksrcpath}/man/vnstat.1 \ |
40 35 | ${worksrcpath}/man/vnstatd.1 \ |
41 36 | ${worksrcpath}/man/vnstati.1 |
42 37 | |
43 38 | # fix occurrences of /etc/db references in other files |
44 39 | reinplace "s|/etc|${prefix}/etc|g" ${worksrcpath}/man/vnstat.1 \ |
45 40 | ${worksrcpath}/man/vnstat.conf.5 \ |
46 41 | ${worksrcpath}/man/vnstatd.1 \ |
47 42 | ${worksrcpath}/man/vnstati.1 \ |
48 43 | ${worksrcpath}/src/cfg.c |
49 44 | } |
50 45 | |
51 - | use_configure no |
52 - | variant universal {} |
53 - | |
54 - | build.args-append CC="${configure.cc} [get_canonical_archflags]" \ |
55 - | CPP=${configure.cpp} \ |
56 - | CFLAGS="-I${prefix}/include" \ |
57 - | LDFLAGS="-L${prefix}/lib" |
58 - | |
59 - | destroot.target bsdinstall |
60 46 | destroot.keepdirs ${destroot}${prefix}/var/db/vnstat |
47 + | |
61 48 | post-destroot { |
62 49 | xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name} |
63 50 | xinstall -m 755 -d ${destroot}${prefix}/share/examples/${name} |
64 51 | |
65 52 | xinstall -m 644 -W ${worksrcpath} \ |
66 53 | CHANGES COPYING FAQ INSTALL INSTALL_BSD README \ |
67 54 | ${destroot}${prefix}/share/doc/${name} |
68 55 | |
69 - | eval file copy [glob ${worksrcpath}/examples/*] \ |
56 + | file copy {*}[glob ${worksrcpath}/examples/*] \ |
70 57 | ${destroot}${prefix}/share/examples/${name} |
58 + | file delete -force ${destroot}${prefix}/share/examples/${name}/init.d |
59 + | file delete -force ${destroot}${prefix}/share/examples/${name}/systemd |
60 + | file delete -force ${destroot}${prefix}/share/examples/${name}/upstart |
71 61 | |
72 62 | # Rename conf file so we don't clobber a user's real conf file on upgrade. |
73 63 | move ${destroot}${prefix}/etc/vnstat.conf ${destroot}${prefix}/etc/vnstat.conf.sample |
74 64 | } |
75 65 | |
66 + | startupitem.create yes |
67 + | startupitem.name vnstatd |
68 + | startupitem.start "${prefix}/sbin/vnstatd -n" |
69 + | startupitem.stop "/bin/kill \$(cat ${prefix}/var/run/vnstatd.pid)" |
70 + | startupitem.logfile ${prefix}/var/log/vnstatd.log |
71 + | startupitem.pidfile auto ${prefix}/var/run/vnstatd.pid |
72 + | startupitem.logevents yes |
73 + | startupitem.netchange yes |
74 + | |
76 75 | notes " |
77 76 | A configuration file has been installed to ${prefix}/etc/vnstat.conf |
78 77 | " |
79 78 | |
80 79 | pre-activate { |
81 80 | if {[file exists ${prefix}/etc/vnstat.conf]} { |
82 81 | # Clear the notes if there is already a conf file |
83 82 | notes |
84 83 | } |
85 84 | } |