Index: Portfile
===================================================================
--- Portfile	(revision 141816)
+++ Portfile	(working copy)
@@ -2,12 +2,13 @@
 # $Id$
 
 PortSystem          1.0
+PortGroup           active_variants 1.1
+PortGroup           perl5 1.0
 
 name                backuppc
 categories          sysutils
 version             3.1.0
-revision            2
-set perl_version    5.16
+revision            3
 maintainers         nomaintainer
 license             GPL-2+
 homepage            http://backuppc.sourceforge.net/
@@ -19,24 +20,35 @@
 
 master_sites        sourceforge
 
+# TODO:
+# - remove 5.16 once we upgrade to 5.22 as default
+# - remove the variants once mod_perl2 switches to 5.22 only
+perl5.require_variant   yes
+perl5.conflict_variants yes
+perl5.branches          5.16 5.22
+perl5.create_variants   ${perl5.branches}
+# TODO: this has to be the same branch as for mod_perl2
+perl5.default_branch    5.22
+require_active_variants mod_perl2 ${perl5.variant}
+
 depends_lib         port:bzip2 \
                     port:gnutar \
                     port:gzip \
                     port:mod_perl2 \
                     port:openssh \
-                    port:p${perl_version}-archive-zip \
-                    port:p${perl_version}-compress-raw-zlib \
-                    port:p${perl_version}-file-rsyncp \
+                    port:p${perl5.major}-archive-zip \
+                    port:p${perl5.major}-compress-raw-zlib \
+                    port:p${perl5.major}-file-rsyncp \
                     port:par2 \
-                    port:perl${perl_version} \
+                    port:perl${perl5.major} \
                     port:rsync \
                     port:samba3
 
+
 distname            BackupPC-${version}
 
-checksums           md5     84b4471852ef910768eae9963ef932d2 \
-                    sha1    3bd6d637f4f08f2fda44a12668b91d47c4abb0a7 \
-                    rmd160  22d4cb6dd76f846fde489a301852f50e8db1ae1d
+checksums           rmd160  22d4cb6dd76f846fde489a301852f50e8db1ae1d \
+                    sha256  49a2744cb9aaf27b298ec3d2e83e46fdb86fb3596922beb3904cb6ae552c148a
 
 configure.args      --batch \
                     --backuppc-user=backuppc \
@@ -102,7 +114,7 @@
     xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/log/BackupPC
 
     # create backup directory
-    system -W ${worksrcpath} "${prefix}/bin/perl${perl_version} configure.pl ${configure.args}"
+    system -W ${worksrcpath} "${prefix}/bin/perl${perl5.major} configure.pl ${configure.args}"
     xinstall -d -m 755 ${destroot}${prefix}/share/doc/
     move ${destroot}${prefix}/doc ${destroot}${prefix}/share/doc/BackupPC
 
