modified site user admin validation
[bse.git] / Makefile
CommitLineData
923b58fc 1VERSION=0.16
41b9d8ec
TC
2DISTNAME=bse-$(VERSION)
3DISTBUILD=$(DISTNAME)
4DISTTAR=../$(DISTNAME).tar
5DISTTGZ=$(DISTTAR).gz
957a90ca 6WEBBASE=/home/httpd/html/bse
41b9d8ec
TC
7
8help:
8b0b2f34 9 @echo make dist - build the tar.gz file and copy to distribution directory
12bcb7ac 10 @echo make 'archive - build the tar.gz (in the parent directory)'
41b9d8ec 11 @echo make clean - delete generated files
6e73144d
TC
12 @echo make distdir - build distribution directory
13 @echo make docs - build documentation
41b9d8ec
TC
14
15# this target needs to be modified so that the output directory includes
16# the release number
957a90ca 17dist: cleantree $(DISTTGZ)
227b99dc
TC
18 cp $(DISTTGZ) $(WEBBASE)/dists/
19 cp site/docs/bse.html $(WEBBASE)/relnotes/bse-$(VERSION).html
20 cp site/docs/*.html $(WEBBASE)/docs
5af99440 21 svn cp . http://svn.develop-help.com/devsvn/bse/tags/bse-$(VERSION)
957a90ca
TC
22
23# make sure everything is committed
24cleantree:
85802bd5
TC
25 if grep -q 'perl.*-d:ptkdb' site/cgi-bin/*.pl site/cgi-bin/admin/*.pl ; \
26 then echo '***' The debugger is still enabled ; \
27 exit 1; \
28 fi
5af99440 29 test -z "`svn status`" || ( echo "Uncommitted files in the tree"; exit 1 )
41b9d8ec 30
8b0b2f34
TC
31archive: $(DISTTGZ)
32
41b9d8ec
TC
33$(DISTTGZ): distdir
34 if [ -e $(DISTTGZ) ] ; \
35 then echo $(DISTTGZ) already exists ; \
36 exit 1 ; \
37 fi
38 tar cf $(DISTTAR) $(DISTBUILD)
09a131dd 39 -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
41b9d8ec
TC
40 gzip $(DISTTAR)
41
42# tar czf $(DISTFILE) -C .. bse --exclude '*~' --exclude '*,v' --exclude 'pod2html-*cache'
43
e9c9a2be
TC
44# recent ExtUtils::Manifest don't copy the executable bit, fix that here
45
d2730773 46distdir: docs dbinfo version
09a131dd 47 -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
41b9d8ec 48 perl -MExtUtils::Manifest=manicopy,maniread -e "manicopy(maniread(), '$(DISTBUILD)')"
6e73144d
TC
49 mkdir $(DISTBUILD)/site/htdocs/shop
50 find $(DISTBUILD) -type f | xargs chmod u+w
e9c9a2be 51 for i in `cat MANIFEST` ; do if [ -x $$i ] ; then chmod a+x $(DISTBUILD)/$$i ; fi ; done
41b9d8ec
TC
52
53clean:
09a131dd 54 -perl -MExtUtils::Command -e rm_f site/htdocs/index.html site/htdocs/shop/*.html site/htdocs/a/*.html
41b9d8ec
TC
55 -cd site/htdocs/images ; \
56 for i in *.gif ; do \
57 if [ $$i != trans_pixel.gif ] ; then \
58 rm $$i ; \
59 fi ; \
60 done
09a131dd
TC
61 -perl -MExtUtils::Command -e rm_f site/htdocs/images/*.jpg
62 -perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
41b9d8ec 63
6e73144d 64docs: INSTALL.txt INSTALL.html otherdocs
41b9d8ec 65
6e73144d
TC
66INSTALL.txt: INSTALL.pod
67 pod2text <INSTALL.pod >INSTALL.txt
41b9d8ec
TC
68
69INSTALL.html: INSTALL.pod
70 pod2html --infile=INSTALL.pod --outfile=INSTALL.html
71 -rm pod2html-dircache pod2html-itemcache
72
73otherdocs:
74 cd site/docs ; make all
6e73144d 75
b19047a6
TC
76dbinfo: site/util/mysql.str
77
78site/util/mysql.str: schema/bse.sql
79 perl schema/mysql_build.pl >site/util/mysql.str
80
d2730773
TC
81version: site/cgi-bin/modules/BSE/Version.pm
82
83site/cgi-bin/modules/BSE/Version.pm: Makefile
84 echo 'package BSE::Version;' >site/cgi-bin/modules/BSE/Version.pm
85 echo 'use strict;' >>site/cgi-bin/modules/BSE/Version.pm
86 echo >>site/cgi-bin/modules/BSE/Version.pm
87 echo 'my $$VERSION = "$(VERSION)";' >>site/cgi-bin/modules/BSE/Version.pm
88 echo >>site/cgi-bin/modules/BSE/Version.pm
89 echo 'sub version { $$VERSION }' >>site/cgi-bin/modules/BSE/Version.pm
90 echo >>site/cgi-bin/modules/BSE/Version.pm
91 echo '1;' >>site/cgi-bin/modules/BSE/Version.pm
92
7057fbc0
TC
93svnversion:
94 perl site/util/bse_mksvnversion.pl $(VERSION) site/cgi-bin/modules/BSE/Version.pm
95
6e73144d
TC
96# this is very rough
97testinst: distdir
98 perl localinst.perl $(DISTBUILD)
09a131dd 99 perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
2076966c 100 cd `perl -lne 'do { print $$1; exit; } if /^base_dir\s*=\s*(.*)/' test.cfg`/util ; perl loaddata.pl ../data/db
34bc5961
TC
101
102testfiles: distdir
103 perl localinst.perl $(DISTBUILD) leavedb
09a131dd 104 perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
2076966c 105 cd `perl -lne 'do { print $$1; exit; } if /^base_dir\s*=\s*(.*)/' test.cfg`/util ; perl loaddata.pl ../data/db
09a131dd 106
41fd1a57 107test: testinst
4772671f 108 perl -MTest::Harness=runtests -Isite/cgi-bin/modules -It -e 'runtests glob q!t/*.t!'
35c0719f
TC
109
110manicheck:
111 perl -MExtUtils::Manifest=manicheck -e 'manicheck()'
112
113filecheck:
114 perl -MExtUtils::Manifest=filecheck -e 'filecheck()'