# $Id: Portfile 76660 2011-03-04 17:01:31Z afb@macports.org $

PortSystem 1.0

name		yum-arch
version		2.2.2
platforms	darwin
categories	sysutils
maintainers	nomaintainer
description	Extract headers from rpm in a old yum repository
long_description	Extract headers from rpm in a old yum repository. \
\
This package only provides the old yum-arch command from yum-${version}. \
It should be used to generate repository informations for Fedora Core  < 3 \
and Red Hat Enterprise Linux < 4.

homepage	http://linux.duke.edu/yum/
master_sites	${homepage}download/2.2/
distname		yum-${version}
checksums	md5 734cc68e26c2fd07629616ab597acac6

patchfiles	 yum-arch-folder.patch patch-prefix.diff

depends_lib	port:rpm port:python24 port:py-libxml2

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"
		}
}

post-patch {
		# problem with case-insensitive filesystem:
		file delete ${workpath}/${distname}/INSTALL
		
		foreach source [glob $worksrcpath/*.py $worksrcpath/repomd/*.py $worksrcpath/rpmUtils/*.py $worksrcpath/yum/*.py] {
			reinplace "/^#!\\/usr/d" ${source}
		}
}

use_configure	no

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