#
#               Copyright (c) 1999-2002 Georg Huettenegger
#

# common defines (like VERSION and DOCFILES)
include common.mak

PACKAGE=plextor-tool
RPMNAME=$(PACKAGE)-$(VERSION)-1.$(HOSTTYPE).rpm

all:    rpm

rpm:
	/bin/mkdir /usr/src/redhat/SOURCES/$(PACKAGE)-$(VERSION)
	cp $(DOCFILES) $(PACKAGE) plextor-tool.8.gz /usr/src/redhat/SOURCES/$(PACKAGE)-$(VERSION)
	cd /usr/src/redhat/SOURCES/ ; /bin/tar -cjvf $(PACKAGE)-$(VERSION).tar.bz2 $(PACKAGE)-$(VERSION)
	/bin/rpm -bb --clean $(PACKAGE).spec
	/bin/rm -rf /usr/src/redhat/SOURCES/$(PACKAGE)-$(VERSION)
	/bin/rm -rf /usr/src/redhat/SOURCES/$(PACKAGE)-$(VERSION).tar.bz2
	/bin/mv /usr/src/redhat/RPMS/$(HOSTTYPE)/$(RPMNAME) ../
	/bin/chown $(USER).$(USER) ../$(RPMNAME)
