#
# These commands for maintaining the distribution package
# cause great difficulties with some versions of make.
# Preparation for release of subversion N
#	make sure that VERSION contains "3.0-N"
#	copy raster3d-3.0.spec to raster3d-3.0-N.spec
#	copy raster3d-static-3.0.spec to raster3d-static-3.0-N.spec
#	make sure that the new spec files have the right version internally
#	ln -s `pwd` ../Raster3D_3.0-N
# To actually build the tar file, you need to do something like
#
#	make distclean; cp Makefile.package Makefile.incl; make tar
#
# After that (tar file is needed first!) to make the RPM files 
#
#	make linux; make rpm
#
# To build the static version or x86_64 variants
#	edit Makefile.package (this file) to use the right spec file
#
include VERSION

TARFILE := $(shell echo Raster3D_$(VERSION).tar.gz)

tar:	../$(TARFILE)
../$(TARFILE):
	rm Makefile.incl
	touch Makefile.incl
	@echo making ../$(TARFILE)
	cd `pwd`
	(cd ..; gtar -czvf $(TARFILE) Raster3D_$(VERSION)/.)

#
# Build an RPM package
#
rpm:		../$(TARFILE) rpm_build
rpm_build:
	cp ../Raster3D_$(VERSION).tar.gz ~/rpmbuild/SOURCES/
	rpmbuild -ba --target i586 raster3d-$(VERSION).spec
#	rpmbuild -ba --target x86_64 raster3d-$(VERSION).spec
#	rpmbuild -ba --target x86_64 raster3d-static-$(VERSION).spec

