# $Id: Portfile 92998 2012-05-13 20:25:54Z afb@macports.org $

PortSystem 1.0

name			createrepo
version			0.4.11
revision		2
categories		sysutils
platforms		darwin
maintainers		afb
description		generates common metadata for package repositories
long_description	createrepo generates the metadata necessary for an RPM package \
			repository. This repository format (repodata) is supported by \
			apt, red-carpet(zen), smart, up2date, Yast and yum.

homepage		http://createrepo.baseurl.org/
master_sites		${homepage}download/
checksums		md5 3e9ccf4abcffe3f49af078c83611eda2 \
				sha1 10316e9ee98e92f961c727cf991589611a2de7cb \
				rmd160 74b89d3f097914bd5fc67282d083c063ad7fc18e
patchfiles		patch-Makefile patch-createrepo patch-modifyrepo \
			patch-dumpMetadata.py patch-genpkgmetadata.py \
			patch-readMetadata.py patch-modifyrepo.py

depends_run		port:python25 port:rpm port:py25-libxml2 port:py25-yum-metadata-parser
# this should be depends_test:
depends_build	port:py25-checker

post-patch {
	reinplace "s|__PREFIX__|${prefix}|g" \
		${worksrcpath}/bin/createrepo ${worksrcpath}/bin/modifyrepo
	reinplace "s|__PYTHON__|${prefix}/bin/python2.5|g" \
		${worksrcpath}/dumpMetadata.py ${worksrcpath}/genpkgmetadata.py \
		${worksrcpath}/readMetadata.py ${worksrcpath}/modifyrepo.py
}

use_configure	no

build.args	prefix=${prefix} PYTHON="${prefix}/bin/python2.5"

destroot.args	prefix=${prefix} INSTALL="/usr/bin/install -p" INSTALL_MODULES="/usr/bin/install -m 755"

test.run		yes
test.target		check

livecheck.type	regex
# get the last modified tarball
livecheck.url	${master_sites}?C=M\;O=D
livecheck.regex	${name}-(0\.4\.\[0-9.\]+)${extract.suffix}
