# $Id: Portfile 73823 2010-11-26 11:06:42Z afb@macports.org $

PortSystem 1.0

name			yum-createrepo
version			0.9.8
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/
distname		createrepo-${version}
master_sites		${homepage}download/
checksums		md5 e37418bebb559e7420532574c1bdb18c \
			sha1 b4964ea3caf039954467374ffd7769cc6875c70a \
			rmd160 aa6021d6cc3e01f8b7dde108a966210dd7480509
patchfiles		patch-prefix.diff patch-sqlite.diff

depends_run		port:python24 port:yum
# this should be depends_test:
depends_build	port:py-checker

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

use_configure	no

build.args	prefix=${prefix} PYTHON="${prefix}/bin/python2.4"
destroot.args	prefix=${prefix} PYTHON="${prefix}/bin/python2.4" 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}
