X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Makefile;h=d1185b61bcf9298e4b0c73f89128c52cd2e8a4cf;hb=ac5e5040d1a2e9a6b43783260af9685bbafc61d5;hp=3eccbd7ce3524a96fb3b2abb78fb60b88fb6cfb8;hpb=33174d08602adaea7f103221b82d180c8424971c;p=debbugs.git diff --git a/Makefile b/Makefile index 3eccbd7..d1185b6 100644 --- a/Makefile +++ b/Makefile @@ -7,18 +7,25 @@ var_dir := $(DESTDIR)/var/lib/debbugs scripts_dir := $(DESTDIR)/usr/lib/debbugs perl_dir := $(DESTDIR)/usr/share/perl5/Debbugs doc_dir := $(DESTDIR)/usr/share/doc/debbugs +templates_dir := $(DESTDIR)/usr/share/debbugs/templates man_dir := $(DESTDIR)/usr/share/man man8_dir := $(man_dir)/man8 examples_dir := $(doc_dir)/examples -scripts_in := $(filter-out scripts/config.in scripts/errorlib.in scripts/text.in, $(wildcard scripts/*.in)) +scripts_in := $(filter-out scripts/config scripts/errorlib scripts/text, $(wildcard scripts/*)) htmls_in := $(wildcard html/*.html.in) cgis := $(wildcard cgi/*.cgi cgi/*.pl) -perls := $(foreach name,Log MIME Versions,Debbugs/$(name).pm) + +# We use the Makefile.PL to install these; not totally decided if we +# should switch entirely to this model. +#perls := $(shell find Debbugs -type f -iname '*.pm') install_exec := install -m755 -p install_data := install -m644 -p +test: + perl -MTest::Harness -I. -e 'runtests(glob(q(t/*.t)))' + install: install_mostfiles # install basic debbugs documentation $(install_data) COPYING UPGRADE README debian/README.mail $(doc_dir) @@ -34,14 +41,20 @@ $(var_dir)/spool/lock $(var_dir)/spool/archive $(var_dir)/spool/incoming \ $(var_dir)/spool/db-h $(scripts_dir) $(perl_dir) $(examples_dir) $(man8_dir); \ do test -d $$dir || $(install_exec) -d $$dir; done + # make db-h spool dirs if they don't exist + cd $(var_dir)/spool/db-h; \ + for dir in $(shell seq -w 00 99); \ + do test -d $$dir || $(install_exec) -d $$dir; done + + # install the scripts - $(foreach script,$(scripts_in), $(install_exec) $(script) $(scripts_dir)/$(patsubst scripts/%.in,%,$(script));) - $(install_data) scripts/errorlib.in $(scripts_dir)/errorlib + $(foreach script,$(scripts_in), $(install_exec) $(script) $(scripts_dir)/$(script);) + $(install_data) scripts/errorlib $(scripts_dir)/errorlib # install examples - $(install_data) scripts/config.in $(examples_dir)/config + $(install_data) scripts/config $(examples_dir)/config $(install_data) scripts/config.debian $(examples_dir)/config.debian - $(install_data) scripts/text.in $(examples_dir)/text + $(install_data) scripts/text $(examples_dir)/text $(install_data) debian/crontab misc/nextnumber misc/Maintainers \ misc/Maintainers.override misc/pseudo-packages.description \ misc/sources $(examples_dir) @@ -50,13 +63,16 @@ $(var_dir)/spool/db-h $(scripts_dir) $(perl_dir) $(examples_dir) $(man8_dir); \ # install the HTML pages etc $(foreach html, $(htmls_in), $(install_data) $(html) $(etc_dir)/html;) $(install_data) html/htaccess $(var_dir)/www/db/.htaccess + $(install_data) html/bugs.css $(var_dir)/www/bugs.css # install the CGIs for cgi in $(cgis); do $(install_exec) $$cgi $(var_dir)/www/cgi; done - $(install_exec) cgi/bugs-fetch2.pl.in $(var_dir)/www/cgi/bugs-fetch2.pl + $(install_exec) cgi/bugs-fetch2.pl $(var_dir)/www/cgi/bugs-fetch2.pl + +# # install Perl modules +# for perl in $(perls); do $(install_data) $$perl $(perl_dir); done + # Make documentation for the perl modules - # install Perl modules - for perl in $(perls); do $(install_data) $$perl $(perl_dir); done # install debbugsconfig $(install_exec) debian/debbugsconfig $(sbin_dir) @@ -68,3 +84,10 @@ $(var_dir)/spool/db-h $(scripts_dir) $(perl_dir) $(examples_dir) $(man8_dir); \ # install the updateseqs file $(install_data) misc/updateseqs $(var_dir)/spool + + # install the templates + $(foreach dir $(wildcard templates/*/*) $(install_exec) $(template_dir)/$(patsubst templates/%,%,$(dir))) + $(foreach tmpl $(wildcard templates/*/*/*.tmpl) $(install_data) $(template_dir)/$(patsubst templates/%,%,$(tmpl))) + + +.PHONY: test \ No newline at end of file