]> git.imager.perl.org - bse.git/blobdiff - Makefile
rework installation process to use git rev info
[bse.git] / Makefile
index c74ea2f9ac142cf023674ba827b18326aeaa8fca..27e0ec287b00107e14ae29c70c85c5f954f83482 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,19 @@
-VERSION=0.15_56
+VERSION=0.19
 DISTNAME=bse-$(VERSION)
 DISTBUILD=$(DISTNAME)
 DISTTAR=../$(DISTNAME).tar
 DISTTGZ=$(DISTTAR).gz
 WEBBASE=/home/httpd/html/bse
 
+MODULES=$(shell grep cgi-bin/.*\.pm MANIFEST | sed -e '/^\#/d' -e 's/[ \t].*// -e /^site\/cgi-bin\/modules\/BSE\/Modules\.pm$/d' )
+
 help:
        @echo make dist - build the tar.gz file and copy to distribution directory
        @echo make 'archive - build the tar.gz (in the parent directory)'
        @echo make clean - delete generated files
        @echo make distdir - build distribution directory
        @echo make docs - build documentation
+       @echo make testup - upgrade an installation
 
 # this target needs to be modified so that the output directory includes
 # the release number
@@ -18,7 +21,7 @@ dist: cleantree $(DISTTGZ)
        cp $(DISTTGZ) $(WEBBASE)/dists/
        cp site/docs/bse.html $(WEBBASE)/relnotes/bse-$(VERSION).html
        cp site/docs/*.html $(WEBBASE)/docs
-       svn cp . http://svn.develop-help.com/devsvn/bse/tags/bse-$(VERSION)
+       git tag -m "$(VERSION) release" r$(VERSION)
 
 # make sure everything is committed
 cleantree:
@@ -26,7 +29,7 @@ cleantree:
          then echo '***' The debugger is still enabled ; \
          exit 1; \
        fi
-       test -z "`svn status`" || ( echo "Uncommitted files in the tree"; exit 1 )
+       test -z "`git status -s`" || ( echo "Uncommitted files in the tree"; exit 1 )
 
 archive: $(DISTTGZ)
 
@@ -43,7 +46,7 @@ $(DISTTGZ): distdir
 
 # recent ExtUtils::Manifest don't copy the executable bit, fix that here
 
-distdir: docs dbinfo version
+distdir: docs dbinfo version modversion
        -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
        perl -MExtUtils::Manifest=manicopy,maniread -e "manicopy(maniread(), '$(DISTBUILD)')"
        mkdir $(DISTBUILD)/site/htdocs/shop
@@ -68,7 +71,7 @@ INSTALL.txt: INSTALL.pod
 
 INSTALL.html: INSTALL.pod
        pod2html --infile=INSTALL.pod --outfile=INSTALL.html
-       -rm pod2html-dircache pod2html-itemcache
+       -rm pod2html-dircache pod2html-itemcache pod2htmd.tmp pod2htmi.tmp
 
 otherdocs:
        cd site/docs ; make all
@@ -81,17 +84,12 @@ site/util/mysql.str: schema/bse.sql
 version: site/cgi-bin/modules/BSE/Version.pm
 
 site/cgi-bin/modules/BSE/Version.pm: Makefile
-       echo 'package BSE::Version;' >site/cgi-bin/modules/BSE/Version.pm
-       echo 'use strict;' >>site/cgi-bin/modules/BSE/Version.pm
-       echo  >>site/cgi-bin/modules/BSE/Version.pm
-       echo 'my $$VERSION = "$(VERSION)";' >>site/cgi-bin/modules/BSE/Version.pm
-       echo  >>site/cgi-bin/modules/BSE/Version.pm
-       echo 'sub version { $$VERSION }' >>site/cgi-bin/modules/BSE/Version.pm
-       echo  >>site/cgi-bin/modules/BSE/Version.pm
-       echo '1;' >>site/cgi-bin/modules/BSE/Version.pm
-
-svnversion:
-       perl site/util/bse_mksvnversion.pl $(VERSION) site/cgi-bin/modules/BSE/Version.pm
+       perl site/util/bse_mkgitversion.pl $(VERSION) site/cgi-bin/modules/BSE/Version.pm
+
+modversion: site/cgi-bin/modules/BSE/Modules.pm
+
+site/cgi-bin/modules/BSE/Modules.pm: $(MODULES) site/util/make_versions.pl
+       perl site/util/make_versions.pl site/cgi-bin/modules/BSE/Modules.pm
 
 # this is very rough
 testinst: distdir
@@ -99,16 +97,24 @@ testinst: distdir
        perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
        cd `perl -lne 'do { print $$1; exit; } if /^base_dir\s*=\s*(.*)/' test.cfg`/util ; perl loaddata.pl ../data/db
 
-testfiles: distdir
+testup: checkver distdir
        perl localinst.perl $(DISTBUILD) leavedb
        perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
-       cd `perl -lne 'do { print $$1; exit; } if /^base_dir\s*=\s*(.*)/' test.cfg`/util ; perl loaddata.pl ../data/db
+       cd `perl -lne 'do { print $$1; exit; } if /^base_dir\s*=\s*(.*)/' test.cfg`/util ; perl upgrade_mysql.pl -b ; perl loaddata.pl ../data/db
 
-test: testinst
-       perl -MTest::Harness=runtests -Isite/cgi-bin/modules -It -e 'runtests glob q!t/*.t!'
+checkver:
+       if [ -d .git ] ; then perl site/util/check_versions.pl ; fi
+
+TEST_FILES=t/*.t
+
+test: testup
+       perl -MTest::Harness=runtests -Isite/cgi-bin/modules -It -e 'runtests @ARGV' $(TEST_FILES)
 
 manicheck:
        perl -MExtUtils::Manifest=manicheck -e 'manicheck()'
 
 filecheck:
        perl -MExtUtils::Manifest=filecheck -e 'filecheck()'
+
+manifest:
+       perl -MExtUtils::Manifest=mkmanifest -e mkmanifest