PortSystem 1.0

name		yum-utils
version		1.1.17
revision	1
platforms	darwin
categories	sysutils
maintainers	nomaintainer
description	Utilities based around the yum package manager
long_description	yum-utils is a collection of utilities and examples for the yum package \
manager. It includes utilities by different authors that make yum easier and \
more powerful to use.

homepage	http://yum.baseurl.org/
master_sites	${homepage}download/${name}/
checksums	md5 c9bb92a87a01e39d2d928ac3ae12e10a \
		sha1 343a8eb894aadf4f91ca833d6672ca028eefe3ba \
		rmd160 bbf90d0299bc0665ea78bad9ee892bf3cb2791a9

patchfiles	patch-prefix.diff

depends_lib	port:python27 port:yum

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

use_configure	no
build	{}

platform darwin {
	# exclude NetworkManager program
	patchfiles-append patch-Makefile
}

variant plugins description "include yum plugins" {

post-destroot {
	set plugins "changelog fastestmirror protectbase versionlock tsflags downloadonly allowdowngrade skip-broken priorities refresh-updatesd merge-conf security protect-packages"
	xinstall -d ${destroot}${prefix}/etc/yum/pluginconf.d ${destroot}${prefix}/lib/yum-plugins

	foreach plug $plugins {
		xinstall -m 644 [glob ${worksrcpath}/plugins/$plug/*.conf] ${destroot}${prefix}/etc/yum/pluginconf.d/
		xinstall -m 644 [glob ${worksrcpath}/plugins/$plug/*.py] ${destroot}${prefix}/lib/yum-plugins/
	}
}

}

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