r22524 - in /trunk/libxml-xslt-perl: Makefile.PL debian/changelog debian/libxml-xslt-perl.docs debian/libxml-xslt-perl.examples debian/rules xslt-parser

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Mon Jun 30 15:45:17 UTC 2008


Author: gregoa
Date: Mon Jun 30 15:45:16 2008
New Revision: 22524

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=22524
Log:
* Revert undocumented changes to xslt-parser (installed as an example) and
  Makefile.PL (remove /usr/bin in debian/rules instead).
* Delete debian/libxml-xslt-perl.*, let debian/rules do the job.
* Refresh debian/rules, no functional changes.

Removed:
    trunk/libxml-xslt-perl/debian/libxml-xslt-perl.docs
    trunk/libxml-xslt-perl/debian/libxml-xslt-perl.examples
Modified:
    trunk/libxml-xslt-perl/Makefile.PL
    trunk/libxml-xslt-perl/debian/changelog
    trunk/libxml-xslt-perl/debian/rules
    trunk/libxml-xslt-perl/xslt-parser

Modified: trunk/libxml-xslt-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xslt-perl/Makefile.PL?rev=22524&op=diff
==============================================================================
--- trunk/libxml-xslt-perl/Makefile.PL (original)
+++ trunk/libxml-xslt-perl/Makefile.PL Mon Jun 30 15:45:16 2008
@@ -13,6 +13,6 @@
               PREREQ_PM     => { XML::Parser => '2.23',
 				                     XML::DOM    => '1.25',
                                  Test::More  => '0.33' },
-	      #EXE_FILES      => ['xslt-parser'],
+	      EXE_FILES      => ['xslt-parser'],
              );
 

Modified: trunk/libxml-xslt-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xslt-perl/debian/changelog?rev=22524&op=diff
==============================================================================
--- trunk/libxml-xslt-perl/debian/changelog (original)
+++ trunk/libxml-xslt-perl/debian/changelog Mon Jun 30 15:45:16 2008
@@ -5,6 +5,10 @@
   * Set Maintainer to Debian Perl Group.
   * Use dist-based URL in debian/watch.
   * debian/rules: delete /usr/lib/perl5 only if it exists.
+  * Revert undocumented changes to xslt-parser (installed as an example) and
+    Makefile.PL (remove /usr/bin in debian/rules instead).
+  * Delete debian/libxml-xslt-perl.*, let debian/rules do the job.
+  * Refresh debian/rules, no functional changes.
 
  -- gregor herrmann <gregor+debian at comodo.priv.at>  Sat, 01 Dec 2007 18:55:48 +0100
 

Modified: trunk/libxml-xslt-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xslt-perl/debian/rules?rev=22524&op=diff
==============================================================================
--- trunk/libxml-xslt-perl/debian/rules (original)
+++ trunk/libxml-xslt-perl/debian/rules Mon Jun 30 15:45:16 2008
@@ -1,54 +1,66 @@
 #!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
+# This debian/rules file is provided as a template for normal perl
+# packages. It was created by Marc Brockschmidt <marc at dch-faq.de> for
+# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
+# be used freely wherever it is useful.
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-# This is the debhelper compatibility version to use.
-# export DH_COMPAT=4
+# If set to a true value then MakeMaker's prompt function will
+# always return the default without waiting for user input.
+export PERL_MM_USE_DEFAULT=1
 
-PACKAGE=`pwd | sed -e "s/.*\/\\(.*\\)-.*/\\1/"`
+PERL   ?= /usr/bin/perl
+PACKAGE = $(shell dh_listpackages)
+TMP     = $(CURDIR)/debian/$(PACKAGE)
 
+build: build-stamp
+build-stamp:
+	dh_testdir
+	$(PERL) Makefile.PL INSTALLDIRS=vendor
+	$(MAKE)
+	$(MAKE) test
+	touch $@
 
-build:
-	dh_testdir
-	# Add here commands to compile the package.
-	perl Makefile.PL verbose INSTALLDIRS=vendor
 clean:
 	dh_testdir
 	dh_testroot
+	dh_clean build-stamp install-stamp
+	[ ! -f Makefile ] || $(MAKE) realclean
 
-	-$(MAKE) clean
-	rm -f Makefile.old
-	dh_clean
-
-install:
+install: install-stamp
+install-stamp: build-stamp
 	dh_testdir
 	dh_testroot
 	dh_clean -k
-	dh_installdirs
+	$(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
 
-	$(MAKE) PREFIX=$(CURDIR)/debian/$(PACKAGE)/usr OPTIMIZE="-O2 -g -Wall" test install
-	[ ! -d $(CURDIR)/debian/$(shell dh_listpackages)/usr/lib/perl5 ] || rmdir --ignore-fail-on-non-empty --parents --verbose $(CURDIR)/debian/$(shell dh_listpackages)/usr/lib/perl5
+	# xslt-parser as an example is enough
+	[ ! -d $(TMP)/usr/bin ] || $(RM) -rv $(TMP)/usr/bin
+	[ ! -d $(TMP)/usr/share/man/man1 ] || $(RM) -rv $(TMP)/usr/share/man/man1
 
-binary-arch:;
+	[ ! -d $(TMP)/usr/lib/perl5 ] || \
+		rmdir --ignore-fail-on-non-empty --parents --verbose \
+		$(TMP)/usr/lib/perl5
+	touch $@
+
+binary-arch:
+# We have nothing to do here for an architecture-independent package
+
 binary-indep: build install
 	dh_testdir
 	dh_testroot
-	dh_installdocs
-	dh_installman
-	dh_installexamples
+	dh_installexamples examples/* xslt-parser
+	dh_installdocs README
 	dh_installchangelogs ChangeLog
-	dh_link
-	dh_strip
+	dh_perl
 	dh_compress
 	dh_fixperms
 	dh_installdeb
-	dh_perl
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+.PHONY: build clean binary-indep binary-arch binary install

Modified: trunk/libxml-xslt-perl/xslt-parser
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-xslt-perl/xslt-parser?rev=22524&op=diff
==============================================================================
--- trunk/libxml-xslt-perl/xslt-parser (original)
+++ trunk/libxml-xslt-perl/xslt-parser Mon Jun 30 15:45:16 2008
@@ -1,61 +1,106 @@
-#!/usr/bin/perl -w
+#!/usr/local/bin/perl -w
 
 # $Id: xslt-parser,v 1.9 2001/03/01 05:22:45 hexmode Exp $
 
+use strict;
 use XML::XSLT;
+use Getopt::Std;
+
+=head1 NAME
+
+xslt-parser - XSLT transformations
+
+=head1 SYNOPSIS
+
+xslt-parser [options] <project>
+
+=head1 DESCRIPTION
+
+xslt-parser performs stylesheet transformations.
+
+When given a project name, it appends `.xsl' for the XSLT stylesheet
+and `.xml' for the XML file to apply the stylesheet to and performs the
+transformation using the XML::XSLT perl module.
+
+=head1 OPTIONS
+
+=over 4
+
+=item -c
+
+Pass through HTML::Clean.  You must have HTML::Clean installed.
+
+=item -d
+
+Turns debugging on.  This can produce a lot of noise.
+
+=item -n
+
+NoWeb.  You can use xslt-parser as a CGI script.  With this option,
+it will not output the headers that are usually needed.
+
+=item -s <file>
+
+Specify a seperate different stylesheet.  Usually, xslt-parser will
+simply append `.xsl' to the project name to get the stylesheet.  A
+different stylesheet can be specified using this option.
+
+=head1 AUTHORS
+
+Geert Josten <gjosten at sci.kun.nl>,
+Mark A. Hershberger <mah at everybody.org>
+
+=head1 SEE ALSO
+
+L<XML::XSLT>
+
+The w3.org XSLT recommendation at L<http://www.w3.org/TR/xslt>
+
+=cut
+
+my %opt;
+my $usage = "Usage: $0 [options] <project>
+
+  -d	     turn debugging mode on
+  -n	     don't print content-type
+  -s <file>  use <file> instead of <project>.xsl as template
+  -w	     turns warnings on\n";
+getopts('cdnws:h', \%opt) || die $usage;
+
+die $usage if $opt{h};
 
 ## global vars ##
-my $noweb = ""; # False #
-my $debug = ""; # False #
-my $warnings = "Active";
-my $project = "";
-my $xslfile = "";
-my $xmlfile = "";
+my $noweb = $opt{n} || 0;
+my $debug = $opt{d} || 0;
+my $warnings = $opt{w} || 0;
+my $project = shift || die $usage;
+my $xslfile = $opt{'s'} || "$project.xsl";
+my $xmlfile = $project;
 
-&process_arguments (@ARGV);
-print $/ if $debug;
+my $xslt = XML::XSLT->new (Source   => $xslfile,
+			   debug    => $debug,
+			   warnings => $debug);
 
-my $XSLTparser = XML::XSLT->new ($xslfile, "FILE", debug => $debug, warnings => $warnings);
-$XSLTparser->transform_document ($xmlfile, "FILE");
-print "Content-type: text/html$/$/" unless $noweb;
-$XSLTparser->print_result();
+if (! -f $xslfile) {
+  die "$xslfile does not exist.";
+}
 
-exit;
-
-
-sub process_arguments {
-  my @argv = @_;
-  if (@argv) {
-    while ((@argv > 1) && ($argv[0] =~ /^\-/)) {
-      my $param = shift @argv;
-
-      $debug = "active" if ($param =~ /^\-d/i);
-      $noweb = "active" if ($param =~ /^\-n/i);
-      $warnings = "active" if ($param =~ /^\-w/i);
-      if (($param =~ /^\-s/i) && ((@argv > 1) && ($argv[0] !~ /^\-/))) {
-        $param = shift (@argv);
-        $xslfile = $param;
-      }
-
-      $noweb = "" if $debug;
-      $warnings = "" if $debug;
-
-    }
-
-    print "Content-type: text/html$/$/" if $debug;
-    print "Debug   : \"",$debug,"\"$/NoWeb   : \"$noweb\"$/Warnings: \"",$warnings,"\"$/" if $debug;
-
-    if (@argv && ($argv[0] !~ /^\-/)) {
-      $project = shift (@argv);
-      $xmlfile = "$project.xml";
-      $xslfile = "$project.xsl" unless $xslfile;
-      die "Error: could not open $xmlfile, make sure it exists.$/" if (! (-f $xmlfile));
-      die "Error: could not open $xslfile, make sure it exists.$/" if (! (-f $xslfile));
-    } else {
-      die "Error: no project specified, give a name of a project.$/";
-    }
-    print "Project : \"",$project,"\"$/  XML-file: \"$xmlfile\"$/  XSL-file: \"$xslfile\"$/" if $debug;
-  } else {
-    die "Usage: $0 [options] <project>$/$/  -d[ebug]\t\tturn debugging mode on$/  -n[oweb]\t\tdon't print content-type$/  -s[tylesheet] <file>\tuse <file> instead of <project>.xsl as template$/  -w[arnings]\t\tturns warnings on$/";
+if (! -f $xmlfile) {
+  $xmlfile .= ".xml";
+  if (! -f $xmlfile) {
+    die "$xmlfile does not exist."
   }
 }
+
+print STDERR qq{Debug   : "$debug"
+NoWeb   : "$noweb"
+Warnings: "$warnings"
+Project : "$project"
+XML-file: "$xmlfile"
+XSL-file: "$xslfile"
+} if $debug;
+
+print $xslt->serve(Source       => $xmlfile,
+		   clean        => $opt{c},
+		   http_headers => ! $noweb);
+




More information about the Pkg-perl-cvs-commits mailing list