--- _orig/net/rrdtool/Portfile	2013-12-22 04:30:23.000000000 -0500
+++ net/rrdtool/Portfile	2014-08-31 17:47:51.000000000 -0400
@@ -4,8 +4,7 @@
 PortSystem          1.0
 
 name                rrdtool
-version             1.4.7
-revision            5
+version             1.4.8
 categories          net
 license             GPL-2+
 maintainers         markd openmaintainer
@@ -14,8 +13,8 @@
 homepage            http://oss.oetiker.ch/rrdtool/
 platforms           darwin
 master_sites        ${homepage}pub/
-checksums           rmd160 3a8c1c0f3fe0d76fb7da8b712cdd19d59d5171ba \
-                    sha256 956aaf431c955ba88dd7d98920ade3a8c4bad04adb1f9431377950a813a7af11
+checksums           rmd160  c02412211e6e51f3c77182c08f5cdfa3426765d1 \
+                    sha256  de95b9f5aa488b0683600aad5a07c316f8d98cbe8d00aa0a1c87e2b2ef89f3d6
 
 depends_build       port:pkgconfig
 depends_lib         port:expat \
@@ -24,7 +23,6 @@
                     port:libffi \
                     port:gettext \
                     path:lib/pkgconfig/pango.pc:pango \
-                    path:bin/perl:perl5 \
                     port:tcl \
                     port:zlib \
                     port:libpng \
@@ -33,11 +31,10 @@
 
 patchfiles          patch-bindings_lua_Makefile_in.diff
 
-configure.args      --enable-perl-site-install \
-                    --with-perl-options="INSTALLDIRS=vendor" \
-                    --with-tcllib=${prefix}/lib \
+configure.args      --with-tcllib=${prefix}/lib \
                     --disable-silent-rules \
                     --disable-lua \
+                    --disable-perl \
                     --disable-python \
                     --disable-ruby \
                     --disable-tcl
@@ -59,6 +56,8 @@
     }
 }
 
+default_variants +perl5_16
+
 variant python25 description {Python 2.5 bindings for RRDtool} conflicts python26 python27 {
     depends_lib-append      port:python25
     configure.python        ${prefix}/bin/python2.5
@@ -80,6 +79,50 @@
     configure.args-append   --enable-python
 }
 
+variant perl5_12 description { Bindings to Perl 5.12 } conflicts perl5_18 perl5_14 perl5_16 perl5_20 {
+    depends_lib-append path:bin/perl:perl5.12
+    configure.args-delete --disable-perl
+    configure.args-append --enable-perl-site-install \
+                          --with-perl-options="INSTALLDIRS=vendor"
+    configure.env-append  PERL=${prefix}/bin/perl5.12
+}
+
+variant perl5_14 description { Bindings to Perl 5.14 } conflicts perl5_18 perl5_16 perl5_12 perl5_20 {
+    depends_lib-append path:bin/perl:perl5.14
+    configure.args-delete --disable-perl
+    configure.args-append --enable-perl-site-install \
+                          --with-perl-options="INSTALLDIRS=vendor"
+    configure.env-append  PERL=${prefix}/bin/perl5.14
+}
+
+variant perl5_16 description { Bindings to Perl 5.16 } conflicts perl5_18 perl5_14 perl5_12 perl5_20 {
+    depends_lib-append path:bin/perl:perl5.16
+    configure.args-delete --disable-perl
+    configure.args-append --enable-perl-site-install \
+                          --with-perl-options="INSTALLDIRS=vendor"
+    configure.env-append  PERL=${prefix}/bin/perl5.16
+}
+
+variant perl5_18 description { Bindings to Perl 5.18 } conflicts perl5_16 perl5_14 perl5_12 perl5_20 {
+    depends_lib-append path:bin/perl:perl5.18
+    configure.args-delete --disable-perl
+    configure.args-append --enable-perl-site-install \
+                          --with-perl-options="INSTALLDIRS=vendor"
+    configure.env-append  PERL=${prefix}/bin/perl5.18
+}
+
+variant perl5_20 description { Bindings to Perl 5.20 } conflicts perl5_16 perl5_14 perl5_12 perl5_18 {
+    depends_lib-append path:bin/perl:perl5.20
+    configure.args-delete --disable-perl
+    configure.args-append --enable-perl-site-install \
+                          --with-perl-options="INSTALLDIRS=vendor"
+    configure.env-append  PERL=${prefix}/bin/perl5.20
+}
+
 notes "
 See ${prefix}/share/doc/rrdtool-${version} for example code.
 "
+
+livecheck.type     regex
+livecheck.url       ${homepage}/pub/
+livecheck.regex     "rrdtool-(\\d+(?:\\.\\d+)*).tar.gz"
