# -*- 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

PortSystem 1.0
PortGroup           github 1.0

github.setup        viewvc viewvc 1.2.5
github.tarball_from archive
categories          devel www
maintainers         {khindenburg @kurthindenburg} openmaintainer

description         Browser interface for CVS and Subversion
long_description    \
    ViewVC is a browser interface for CVS and Subversion version control \
    repositories. It generates templatized HTML to present navigable \
    directory, revision, and change log listings. It can display specific \
    versions of files as well as diffs between those versions. Basically, \
    ViewVC provides the bulk of the report-like functionality you expect \
    out of your version control tool, but much more prettily than the \
    average textual command-line program output.

platforms           any
supported_archs     noarch
license             BSD

patchfiles          patch-viewvc-install.diff

checksums           rmd160  2d760e079465e916eb3416d24d17dfb1cf0323a9 \
                    sha256  99135d393bf81b58c54f8497fd430ac2ef5adc8024a2289567dbee34bd975855 \
                    size    361359

# Per website, this doesn't work with any python3
# Note python2 EOL is Jan 2020
# https://github.com/python/devguide/pull/344
# April 2020: per website next version 1.3.0 will require python3+
depends_lib         port:python27

post-patch {
    reinplace "s|/usr/bin/env python|${prefix}/bin/python2.7|" ${worksrcpath}/viewvc-install
}

use_configure       no

build               {}

destroot.cmd        ./viewvc-install --prefix=${prefix}/share/${name} --destdir=${destroot} --clean-mode=true


variant cvs description {Enable cvs repositories} {
    depends_lib-append  port:cvs \
                        port:rcs
}
variant subversion description {Enable subversion repositories} {
    depends_lib-append  port:py27-pysvn \
                        port:subversion-python27bindings
}

default_variants +cvs +subversion

github.livecheck.regex  {([0-9.]+)}

notes "
If this is a fresh install, read\
https://github.com/viewvc/viewvc/blob/master/INSTALL\
otherwise \
https://github.com/viewvc/viewvc/blob/master/docs/upgrading-howto.html\

Copy ${prefix}/share/viewvc/viewvc.conf.dist to ${prefix}/share/viewvc/viewvc.conf\
and then edit it.\
It may be easiest to use ${prefix}/share/viewvc/bin/standalone.py to test the setup.
"
