PortSystem 1.0

name			yum-createrepo
conflicts		createrepo
version			0.9.8
revision		2
categories		sysutils
platforms		darwin
maintainers		nomaintainer
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/
distname		createrepo-${version}
master_sites		${homepage}download/
checksums		md5 e37418bebb559e7420532574c1bdb18c \
			sha1 b4964ea3caf039954467374ffd7769cc6875c70a \
			rmd160 aa6021d6cc3e01f8b7dde108a966210dd7480509
patchfiles		patch-prefix.diff patch-sqlite.diff

depends_run		port:python27 port:yum
depends_test	port:py27-checker

set python.bin	${prefix}/bin/python2.7

patch {
		foreach patch $patchfiles {
			system "cd '${workpath}/${distname}' && \
			sed -e 's#@@PREFIX@@#${prefix}#g' -e 's#@@PYTHON@@#${python.bin}#g' '${filespath}/${patch}' | patch -p0"
		}
}

use_configure	no

build.args	prefix=${prefix} PYTHON="${python.bin}"
destroot.args	prefix=${prefix} PYTHON="${python.bin}" 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	createrepo-(\[0-9.\]+)${extract.suffix}
