From adf6539386c22827b4652dae96b4b634f6f4b4f2 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 13 Jun 2007 22:28:46 +0100 Subject: [PATCH] * Add html/bugs.css * Switch to ExtUtils::MakeMaker for building the perl modules * Fix read_log_records import in bugreport.cgi * Split the package into three --- Debbugs/Config.pm | 12 ++- Makefile | 11 ++- Makefile.PL | 9 +++ cgi/bugreport.cgi | 2 +- debian/changelog | 2 + debian/control | 30 +++++++- debian/rules | 33 +++++++-- html/bugs.css | 184 ++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 267 insertions(+), 16 deletions(-) create mode 100644 Makefile.PL create mode 100644 html/bugs.css diff --git a/Debbugs/Config.pm b/Debbugs/Config.pm index c9e17dc..1997cbb 100644 --- a/Debbugs/Config.pm +++ b/Debbugs/Config.pm @@ -88,10 +88,14 @@ use Safe; %config = (); # untaint $ENV{DEBBUGS_CONFIG_FILE} if it's owned by us # This enables us to test things that are -T. -if (exists $ENV{DEBBUGS_CONFIG_FILE} and - ${[stat($ENV{DEBBUGS_CONFIG_FILE})]}[4] = $<) { - $ENV{DEBBUGS_CONFIG_FILE} =~ /(.+)/; - $ENV{DEBBUGS_CONFIG_FILE} = $1; +if (exists $ENV{DEBBUGS_CONFIG_FILE}) { + if (${[stat($ENV{DEBBUGS_CONFIG_FILE})]}[4] = $<) { + $ENV{DEBBUGS_CONFIG_FILE} =~ /(.+)/; + $ENV{DEBBUGS_CONFIG_FILE} = $1; + } + else { + die "Environmental variable DEBBUGS_CONFIG_FILE set, and $ENV{DEBBUGS_CONFIG_FILE} is not owned by the user running this script."; + } } read_config(exists $ENV{DEBBUGS_CONFIG_FILE}?$ENV{DEBBUGS_CONFIG_FILE}:'/etc/debbugs/config'); diff --git a/Makefile b/Makefile index 015ef95..4dad840 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,10 @@ examples_dir := $(doc_dir)/examples scripts_in := $(filter-out scripts/config.in scripts/errorlib.in scripts/text.in, $(wildcard scripts/*.in)) htmls_in := $(wildcard html/*.html.in) cgis := $(wildcard cgi/*.cgi cgi/*.pl) -perls := $(foreach name,Log MIME Mail Packages 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 @@ -64,8 +67,10 @@ $(var_dir)/spool/db-h $(scripts_dir) $(perl_dir) $(examples_dir) $(man8_dir); \ 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 Perl modules - for perl in $(perls); do $(install_data) $$perl $(perl_dir); done +# # install Perl modules +# for perl in $(perls); do $(install_data) $$perl $(perl_dir); done + # Make documentation for the perl modules + # install debbugsconfig $(install_exec) debian/debbugsconfig $(sbin_dir) diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..9ee13de --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,9 @@ +#!/usr/bin/perl + +use ExtUtils::MakeMaker; + +WriteMakefile(FIRST_MAKEFILE => 'Makefile.perl', + PMLIBDIRS => ['Debbugs'], + NAME => 'Debbugs', + VERSION => '2.4.2', + ); diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index 98e4741..64547d4 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -11,7 +11,7 @@ use IO::File; use Debbugs::Config qw(:globals :text); # for read_log_records -use Debbugs::Log; +use Debbugs::Log qw(read_log_records); use Debbugs::MIME qw(convert_to_utf8 decode_rfc1522 create_mime_message); use Debbugs::CGI qw(:url :html :util); use Debbugs::Common qw(buglog getmaintainers); diff --git a/debian/changelog b/debian/changelog index 68b7cfc..9334559 100644 --- a/debian/changelog +++ b/debian/changelog @@ -181,6 +181,8 @@ debbugs (2.4.2) UNRELEASED; urgency=low (closes: #428056) - Don't doubly select users - Implement versioning aware archiving support (closes: #419693) + - Split out packages so that you don't have to install the mail stuff + unless you want it. -- Colin Watson Fri, 20 Jun 2003 18:57:25 +0100 diff --git a/debian/control b/debian/control index e8591a7..b2e5db2 100644 --- a/debian/control +++ b/debian/control @@ -8,8 +8,8 @@ Build-Depends-Indep: debhelper, libparams-validate-perl, libmailtools-perl, libm Package: debbugs Architecture: all -Depends: perl5 | perl, exim4 | mail-transport-agent, libmailtools-perl, ed, libmime-perl, libio-stringy-perl, libmldbm-perl, liburi-perl, libsoap-lite-perl, libcgi-simple-perl, libparams-validate-perl -Recommends: apache | httpd, links | lynx +Depends: ${perl:Depends}, exim4 | mail-transport-agent, libdebbugs-perl +Recommends: debbugs-web Suggests: spamassassin (>= 3.0), libcgi-alert-perl Description: The bug tracking system based on the active Debian BTS Debian has a bug tracking system which files details of bugs reported by @@ -21,3 +21,29 @@ Description: The bug tracking system based on the active Debian BTS See /usr/share/doc/debbugs/README.Debian after installation. . Note: there might be various issues with this package, caveat emptor. + +Package: libdebbugs-perl +Architecture: all +Depends: ${perl:Depends}, libmailtools-perl, ed, libmime-perl, libio-stringy-perl, libmldbm-perl, liburi-perl, libsoap-lite-perl, libcgi-simple-perl, libparams-validate-perl +Description: modules used by the active Debian BTS + Debian has a bug tracking system which files details of bugs reported by + users and developers. Each bug is given a number, and is kept on file until + it is marked as having been dealt with. The system is mainly controlled by + e-mail, but the bug reports can be viewed using the WWW. + . + This package contains the perl modules used by the bug tracking + system, some of which may be suitable for custom scripts which + interact with local debbugs mirrors. + +Package: debbugs-web +Architecture: all +Depends: libdebbugs-perl, apache | httpd +Suggests: libcgi-alert-perl +Description: web scripts for the active Debian BTS + Debian has a bug tracking system which files details of bugs reported by + users and developers. Each bug is given a number, and is kept on file until + it is marked as having been dealt with. The system is mainly controlled by + e-mail, but the bug reports can be viewed using the WWW. + . + This package contains the cgi scripts necessary to view bugreports + using the web. diff --git a/debian/rules b/debian/rules index 3b65094..94639f4 100755 --- a/debian/rules +++ b/debian/rules @@ -6,38 +6,59 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -tmp_dir := $(CURDIR)/debian/tmp +DEST_DIR := $(CURDIR)/debian/tmp +PERL ?= /usr/bin/perl -build: + +build: build-stamp +build-stamp: # Call the test suite + $(PERL) Makefile.PL INSTALLDIRS=vendor + $(MAKE) -f Makefile.perl $(MAKE) test + touch $@ clean: dh_testdir dh_testroot + rm -f *-stamp; + -$(MAKE) -f Makefile.perl clean; #something to remove all trace and *.trace files? - dh_clean build-stamp + dh_clean + +install: install-stamp +install-stamp: build + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) install_mostfiles DESTDIR=$(DEST_DIR) + $(MAKE) -f Makefile.perl install PREFIX=$(DEST_DIR)/usr + touch $@ binary-arch: # nothing to do, as there aren't any architecture-dependent packages -binary-indep: build install +binary-indep: dh_testdir dh_testroot dh_clean -k dh_installdirs - $(MAKE) install_mostfiles DESTDIR=$(tmp_dir) + $(MAKE) install_mostfiles DESTDIR=$(DEST_DIR) + $(MAKE) -f Makefile.perl install PREFIX=$(DEST_DIR)/usr + dh_install --sourcedir=debian/tmp --list-missing dh_installdocs dh_installchangelogs dh_strip - dh_compress -X examples/text dh_fixperms #chown bugs.bugs $(var_dir)/spool/incoming dh_installdeb + dh_perl + dh_compress -X examples/text dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb + binary: binary-indep binary-arch .PHONY: build clean install binary-indep binary-arch binary diff --git a/html/bugs.css b/html/bugs.css new file mode 100644 index 0000000..ed42581 --- /dev/null +++ b/html/bugs.css @@ -0,0 +1,184 @@ +html { + color: #000; + background: #fefefe; + font-family: serif; + margin: 1em; + border: 0; + padding: 0; + line-height: 120%; +} + +body { + margin: 0; + border: 0; + padding: 0; +} + +h1, h2, h3 { + text-align: left; + font-family: sans-serif; +} + +h1 { + font-size: 150%; + line-height: 150%; +} + +h2 { + font-size: 130%; +} + +h3 { + font-size: 100%; +} + +a:link { + color: #1b56ce; + font-weight: bold; +} + +a:visited { + color:#1b56ce; +} + +a:link:active, a:link:visited { + color:#ff0000; +} + +a:link:hover, a:visited:hover { + color: #d81e1e; +} + +a.submitter:link { + color: #242424; + font-family: sans-serif; + font-size: 95%; + text-decoration: underline; + font-weight: normal; +} + +a.submitter:visited, a.submitter:active { + color: #6e6e6e; + font-family: sans-serif; + font-size: 95%; +} + +a.submitter:hover, a.submitter:visited:hover { + color: #d01414; + font-family: sans-serif; + font-size: 95%; +} + +pre.message { + font-family: monospace; + padding-top: 0; + margin-top: 0; + border-top: 0; +} + +.sparse li { + padding-top: 1ex; + margin-top: 1ex; + border-top: 1ex; +} + +a.bugtitle { + font-weight: bold; + font-size: 110%; +} + + +pre.headers { + font-family: sans-serif; + font-size: 95%; + color: #3c3c3c; + background-color: #f0f0f0; + padding: 2px; + border: #a7a7a7 1px solid; + line-height: 120% +} + +pre.mime { + font-family: monospace; + font-size: 95%; + color: #797979; +} + +/* This must be separate from the other CSS to make the showing of + unimportant messages work in bugreport.cgi. */ +.infmessage { display: none; } + +.infmessage { + font-family: sans-serif; + font-size: 90%; + color: #686868; +} + +.msgreceived { + font-family: sans-serif; + font-size: 90%; + color: #686868; +} + +pre.tags { + color: #a3a3a3; + font-size: 90%; +} + +hr.thin { + color: #a1a1a1; +} + +em.severity { + color: #c31212; +} + +code, address { + font-family: sans-serif; +} + +p { + font-family: sans-serif; + font-size: 95%; +} + +h2.outstanding { + font-family: sans-serif; + background-color: #f0f0f0; + color: #3c3c3c; + border: #a7a7a7 1px solid; + padding: 10px; +} + +a.options:link, a.options:visited { + font-family: sans-serif; + background-color: #f0f0f0; + color: #3c3c3c; + text-decoration: none; + border-bottom: #3c3c3c 1px dotted; +} + +li { + list-style-type: square; +} + +.bugs li { + margin-top: 5px; +} + +input { + border: #000 1px solid; + margin: 3px; +} + +table.forms { + font-size: 95%; + font-family: sans-serif; + margin-left: 10px; +} + +select { + margin: 3px; + border: #000 1px solid; +} + -- 2.39.2