PACKAGE=ifhp
VERSION=3.5.8
RELEASE=1
RPM=/usr/src/redhat/RPMS/i386/${PACKAGE}-${VERSION}-${RELEASE}.i386.rpm
CONFIGURE_ARGS=--prefix=/usr --sysconfdir=/etc --with-filterdir=/usr/libexec/filters --with-ld_library_path=/lib:/usr/lib:/usr/local/lib --with-filter_path=/bin:/usr/bin:/usr/libexec:/usr/local/libexec:/usr/sbin:/var/spool/bin

COPY_HERE=
.PHONY: all rpm testi testu dou doU undo update clean checkit


all:
	make update
	make rpm

rpm:	${RPM}

testv:
	rpm -q -i -l -p ${RPM}
testi:
	rpm -i --test ${RPM}
doi:
	rpm -i ${RPM}
testu:
	rpm -U --test ${RPM}
dou:
	rpm -U  ${RPM}
doU:
	rpm -U --force ${RPM}
undo:
	rpm -e --nodeps ${PACKAGE}

${RPM}: ifhp.spec
	rpm -ba ifhp.spec

clean:
	rm -f *.tgz
	rm -rf /usr/src/redhat/BUILD/ifhp-*

update:
	perl -spi.bak -e "\
		s|^Name: .*|Name: ${PACKAGE}|; \
		s|^Version: .*|Version: ${VERSION}|; \
		s|^Release: .*|Release: ${RELEASE}|; \
		" ifhp.spec;

checkit: update
	make rpm
