#!/bin/sh
# 2005 (c) Etersoft www.etersoft.ru
# CS -- cleanup spec (like cleanup_spec command)
# Public domain

# :
# -  -
. /etc/rpm/etersoft-build-functions

build_list_and_args "$@"

for i in $LISTNAMES
do
	cleanup_spec $i
	build_rpms_name "$i"
	subst "s|\(Release:\).*\$|\1 alt0.1|" $i
	test -n "$BASENAME" && subst "s|\(Name:\).*\$|\1 $BASENAME|" $i
	subst "s|Source0:|Source:|" $i
	subst "s|\(Source:.*\).tar.gz|\1.tar.bz2|" $i
	subst "s|^Prefix:.*$||" $i

	subst "s|\(%post *-p *\)/sbin/ldconfig|\1%post_ldconfig|g" $i
	subst "s|\(%postun *-p *\)/sbin/ldconfig|\1%postun_ldconfig|g" $i
	
	subst "s|\$RPM_BUILD_ROOT/|%buildroot|g" $i
	subst "s|\$RPM_BUILD_ROOT|%buildroot|g" $i
done
