# $Id: Portfile 57375 2009-09-10 08:16:41Z ryandesign@macports.org $

PortSystem 1.0

name			yum-createrepo
version			0.9.6
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 d8b11b3b38205fe351497c7e10ae5500 \
			sha1 8b5642fd4f699b77caf11baebd97e9ac0abf83b3 \
			rmd160 dacd3d124688f2ff29d947f1f28de1d396808a4d
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} 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}
