

# no esta funcionando ver
DISTCLEANFILES = *~ data/*~

#SOURCE TARBALLS

$(PACKAGE)-$(VERSION).tar.bz2:  dist
$(PACKAGE)-$(VERSION).tar.gz:   dist
$(PACKAGE)-$(VERSION).tar.xz:   dist
$(PACKAGE)-$(VERSION).tar.lzma: dist
$(PACKAGE)-$(VERSION).shar.gz:  dist
$(PACKAGE)-$(VERSION).zip:      dist

DISTRIBUTIONFILES =  $(PACKAGE)-$(VERSION).tar.bz2 \
$(PACKAGE)-$(VERSION).tar.gz \
$(PACKAGE)-$(VERSION).tar.xy \
$(PACKAGE)-$(VERSION).tar.lzma \
$(PACKAGE)-$(VERSION).shar.gz \
$(PACKAGE)-$(VERSION).zip
                     
#make dist
#binpackages: rpm deb tgz tbz txz 

#SOURCE DISTROS
SOURCEDISTROS = $(PACKAGE)_$(VERSION)-$(RELEASE).dsc \
               $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm  

BINTARBALL = $(PACKAGE)-$(VERSION)-$(RELEASE).$(ARCH).tar.bz2 \
            $(PACKAGE)-$(VERSION)-$(RELEASE).$(ARCH).tar.gz \
            $(PACKAGE)-$(VERSION)-$(RELEASE).$(ARCH).tar.xz 

BINDISTROFILES = $(PACKAGE)_$(VERSION)-$(RELEASE)_$(DEBARCH).deb \
             $(PACKAGE)-$(VERSION)-$(ARCH)-$(RELEASE).tgz \
             $(PACKAGE)-$(VERSION)-$(ARCH)-$(RELEASE).txz \
             $(PACKAGE)-$(VERSION)-$(RELEASE).$(ARCH).rpm \
             $(PACKAGE)-$(ARCH)-$(VERSION)-r$(RELEASE).tbz2 


DISTROFILES =  $(BINDISTROFILES) $(BINTARBALL) $(SOURCEDISTROS) $(PACKAGE).lsm



#tgz: distrofiles
#	tar -C /tmp/${BUILD_ROOT} -czvf  $(PACKAGE)-$(VERSION)-$(RELEASE)-${host}.tgz .
#
#tbz: distrofiles
#	tar -C /tmp/${BUILD_ROOT} -cjvf  $(PACKAGE)-$(VERSION)-$(RELEASE)-${host}.tbz .
#
#txz: distrofiles
#	tar -C /tmp/${BUILD_ROOT} -cJvf  $(PACKAGE)-$(VERSION)-$(RELEASE)-${host}.txz .


pkginstall: 
	if test "x${BUILD_ROOT}" != "x" -a "x${BUILD_ROOT}" != "x.." ; then\
	   rm -rf /tmp/${BUILD_ROOT}/*; \
	fi
	make DESTDIR=/tmp/${BUILD_ROOT} install

prepare: 
	sp

#if NOTSUMAPACK
#distrofiles: bindistros
#else !NOTSUMAPACK

# no la hace pkginfo
# >  $(PACKAGE).pc.in;

distrofiles: $(DISTROFILES)

$(DISTROFILES):  $(PACKAGE).summa pkgac.dat configure.ac pkginstall ChangeLog
		 rm -fr  /tmp/infopack
		 mkdir -p /tmp/infopack
		 cp $(PACKAGE).summa ChangeLog pkgac.dat /tmp/infopack
		 EXTEXT=`echo $@| sed -e's/.*\(tar\.xz\|tar\.gz\|tar\.bz2\|src\.rpm\)$$/\1/'`; \
		 if test x"$@" = x"$$EXTEXT" ; then \
                          EXTEXT=`echo $@| sed -e's/.*\(lsm\|dsc\|deb\|rpm\|tgz\|txz\|tbz2\)$$/\1/'`; \
                 fi ;\
		 echo EXTEXT $$EXTEXT ; \
		 if test x"$@" != x"$$EXTEXT" ; then \
		    upack -p $$EXTEXT -  /tmp/${BUILD_ROOT} /tmp/infopack;\
		 fi

all: ChangeLog

ChangeLog: configure.ac
	   if test -e ChangeLog; then \
	      	   cp ChangeLog ChangeLog.save; \
	   fi
	   svn2cl -i --authors=data/aux/authors.xml


#endif !NOTSUMAPACK
