Commit c6bb9935 authored by Ardo van Rangelrooij's avatar Ardo van Rangelrooij Committed by Mattia Rizzolo

Import Debian version 0.09

parents
This diff is collapsed.
## ----------------------------------------------------------------------
## MAKE/include : include makefile for xml-core
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
## System directory definitions
prefix = /usr
bin_dir = $(prefix)/bin
sbin_dir = $(prefix)/sbin
share_dir = $(prefix)/share
## ----------------------------------------------------------------------
## Local directory definitions
local_dir = $(prefix)/local
local_share_dir = $(local_dir)/share
## ----------------------------------------------------------------------
## Manual pages directory definitions
man_dir = $(share_dir)/man
man1_ext = 1
man1_dir = $(man_dir)/man$(man1_ext)
man8_ext = 8
man8_dir = $(man_dir)/man$(man8_ext)
## ----------------------------------------------------------------------
## XML directory definitions
xml_dir = $(share_dir)/xml
local_xml_dir = $(local_share_dir)/xml
schema_dir = $(xml_dir)/schema
## ----------------------------------------------------------------------
## Build definitions
POD2MAN = pod2man
## ----------------------------------------------------------------------
## Install definitions
INSTALL = install
INSTALL_DIR = $(INSTALL) -m 755 -d
INSTALL_BIN = $(INSTALL) -m 755
INSTALL_FILE = $(INSTALL) -m 644
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
## Makefile : makefile for xml-core
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
include MAKE/include
## ----------------------------------------------------------------------
## source package subdirectory definitions
subdirs = \
debhelper \
schemas \
tools
## ----------------------------------------------------------------------
## XML infrastructure directory definitions
xml_dirs = \
declaration \
entities \
misc \
schema
## ----------------------------------------------------------------------
## targets
all:
set -e; \
for d in $(subdirs); \
do \
$(MAKE) -C $${d} ${@}; \
done
install:
set -e; \
for d in $(xml_dirs); \
do \
$(INSTALL_DIR) $(xml_dir)/$$d; \
$(INSTALL_DIR) $(local_xml_dir)/$$d; \
done
set -e; \
for d in $(subdirs); \
do \
$(MAKE) -C $${d} ${@}; \
done
.PHONY: \
all \
install
## ----------------------------------------------------------------------
This is the Debian xml-core package. To install it on a non-Debian
system edit the Makefile and then run `make`, `make install`.
The changelog is in the 'debian' directory.
--
Ardo van Rangelrooij <ardo@debian.org>
## ----------------------------------------------------------------------
## Makefile : makefile for xml-core/debhelper
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
include ../MAKE/include
## ----------------------------------------------------------------------
## Debhelper directory definitions
debhelper_dir = $(share_dir)/debhelper
autoscripts_dir = $(debhelper_dir)/autoscripts
## ----------------------------------------------------------------------
## Debhelper file definitions
autoscripts = \
postinst-xmlcatalog \
postrm-xmlcatalog \
prerm-xmlcatalog
dh_scripts = \
dh_installxmlcatalogs
man1s = \
$(addsuffix .$(man1_ext),$(dh_scripts))
## ----------------------------------------------------------------------
## Targets
all: $(man1s)
%.$(man1_ext): %
$(POD2MAN) --section $(man1_ext) --center Debhelper ${<} ${@}
install:
set -e; \
$(INSTALL_DIR) $(autoscripts_dir); \
for f in $(autoscripts); \
do \
$(INSTALL_FILE) $${f} $(autoscripts_dir); \
done
set -e; \
$(INSTALL_DIR) $(bin_dir); \
for f in $(dh_scripts); \
do \
$(INSTALL_BIN) $${f} $(bin_dir); \
done
set -e; \
$(INSTALL_DIR) $(man1_dir); \
for f in $(man1s); \
do \
$(INSTALL_FILE) $${f} $(man1_dir); \
done
.PHONY: \
all \
install
## ----------------------------------------------------------------------
#!/usr/bin/perl -w
## ----------------------------------------------------------------------
## Debian dh_installxmlcatalogs
## ----------------------------------------------------------------------
## Copyright (c) 2004 Ardo van Rangelrooij, Adam Di Carlo
##
## This is free software; see the GNU General Public Licence version 2
## or later for copying conditions. There is NO warranty.
## ----------------------------------------------------------------------
=head1 NAME
dh_installxmlcatalogs - install and register XML catalog files
=head1 SYNOPSIS
B<dh_installxmlcatalogs> [S<I<debhelper options>>] [B<-n>]
=head1 DESCRIPTION
B<dh_installxmlcatalogs> is a debhelper program that installs and
registers XML catalog files. It complies with the Debian XML/SGML
policy.
The file F<debian/I<package>.xmlcatalogs> lists the local XML catalog
files to be installed per package as well as the XML entities in those
local XML catalog files that are to be registered in the XML catalog
system.
The local XML catalog file entries in that file should be of the form
C<local;source;dest>, where the verbatim C<local> indicates this is an
entry for a local XML catalog file, C<source> indicates where the
local XML catalog resides in the source tree, and C<dest> indicates
the destination location for the local XML catalog under the package
build area. C<dest> should start with F</usr/share/xml/>.
The entries for the XML entities to be registered in the package XML
catalog file should be of the form C<package;type;id;catalog>, where
the verbatim C<package> indicates this is an entry for an XML entity
to be registered in the package XML catalog file, C<type> indicates
the XML entity type (public, system, uri), C<id> indicates the XML
entity id, and C<catalog> indicates the local XML catalog file.
The entries for the XML entities to be registered in the root XML
catalog file should be of the form C<root;type;id>, where the verbatim
C<root> indicates this is an entry for an XML entity to be registered
in the root XML catalog file, C<type> indicates the XML entity type
(public, system, uri), and C<id> indicates the XML entity id.
If an entry for is to be registered identically in the root catalog
and the package catalog file, you can use the form
C<root-and-package;type;id;catalog>, where the verbatim
C<root-and-package> indicates this is an entry for an XML entity to be
registered in both the root and package XML catalog files, C<type>
indicates the XML entity type (public, system, uri), C<id> indicates
the XML entity id, and C<catalog> indicates the local XML catalog
file.
XML entity types are described in L<update-xmlcatalog(8)>. Using the
C<root> or C<package> commands, a type of C<public> will general
C<delegatePublic> statements in the applicable catalog file. Generally
you will want to use the types C<public> for any formal public
identifiers, and C<system> for any files on the local filesystem or
URLs. C<uri> is only used for non-local files which are not part of
the external document subset, e.g., they are not used for entities or
DTDs.
B<dh_installxmlcatalogs> automatically adds maintainer script snippets
for the registration and unregistration of the listed XML entities in
the XML catalog system (unless B<-n> is used). A dependency on the
B<xml-core> package will be added to C<${misc:Depends}>, so be sure to
use that variable in the file F<debian/control>. See
L<dh_installdeb(1)> for an explantion of Debhelper maintainer script
snippets.
=head1 OPTIONS
=over 4
=item B<-n>, B<--noscripts>
Do not modify F<postinst>/F<postrm>/F<prerm> scripts.
=back
=head1 NOTES
Note that this command is not idempotent. "dh_clean -k" should be
called between invocations of this command. Otherwise, it may cause
multiple instances of the same text to be added to maintainer scripts.
=head1 SEE ALSO
L<debhelper(7)>
=over 0
=item
F</usr/share/doc/xml-core/>
=back
=head1 AUTHOR
=over 0
=item
Ardo van Rangelrooij <ardo@debian.org>
=item
Adam Di Carlo <aph@debian.org>
=back
=cut
## ----------------------------------------------------------------------
use strict;
## ----------------------------------------------------------------------
use Debian::Debhelper::Dh_Lib;
## ----------------------------------------------------------------------
my $xmlcorever = "0.05";
## ----------------------------------------------------------------------
my $debug_update_xmlcatalog = 0;
## ----------------------------------------------------------------------
init();
## ----------------------------------------------------------------------
sub add_xmlcat_cmd ($$$;$) {
my ($pkg, $type, $id, $local) = @_;
my $cmd = 'update-xmlcatalog';
$cmd .= ' --add';
$cmd .= " --type $type";
$cmd .= " --id \\\"$id\\\"";
$cmd .= " --package $pkg";
if ( $local ) {
$cmd .= " --local $local";
} else {
$cmd .= " --root";
}
$debug_update_xmlcatalog and $cmd .= ' --verbose';
return $cmd;
}
## ----------------------------------------------------------------------
sub del_xmlcat_cmd ($$$;$) {
my ($pkg, $type, $id, $root) = @_;
my $cmd = 'update-xmlcatalog';
$cmd .= ' --del';
$cmd .= " --type $type";
$cmd .= " --id \\\"$id\\\"";
if ( $root ) {
$cmd .= " --root";
} else {
$cmd .= " --package $pkg";
}
$debug_update_xmlcatalog and $cmd .= ' --verbose';
$cmd .= ' || true';
return $cmd;
}
## ----------------------------------------------------------------------
foreach my $package (@{$dh{DOPACKAGES}}) {
if ($#ARGV >= 0) {
error("extra command-line arguments");
}
my $tmpdir = tmpdir($package);
my $xmlcatlistfile = pkgfile( $package, "xmlcatalogs" );
if ( $xmlcatlistfile ) {
my @xml_data = ();
open ( DH_FARRAY_IN, $xmlcatlistfile )
|| error( "cannot read $xmlcatlistfile: $1" );
while ( <DH_FARRAY_IN> ) {
chomp;
s/#.*//;
s/^\s+//;
s/\s+$//;
next unless length;
my @line = split( /;/ );
push( @xml_data, [@line] );
}
close( DH_FARRAY_IN );
my $packagecat = "/etc/xml/$package.xml";
my $ADD_PACKAGE = '';
my $ADD_ROOT = '';
my $DEL_PACKAGE = '';
my $DEL_ROOT = '';
foreach my $line ( @xml_data ) {
if ( $line->[0] eq 'local' ) {
my $source = $line->[1];
my $dest = $line->[2];
my $fulldest = "$tmpdir/$dest";
$fulldest =~ s|//|/|g; # beautification
if ( ! -d dirname( $fulldest ) ) {
doit( "install", "-d", "-m755",
$tmpdir . "/" . dirname( $dest ) );
}
doit( "install", "-p", "-m644", $source, $fulldest );
} elsif ( $line->[0] eq 'package' ) {
if ( ! $dh{ NOSCRIPTS } ) {
my $type = $line->[1];
my $id = $line->[2];
my $local = $line->[3];
if ( ! $local ) {
die("error: package command with ID '$id' incorrect, must specify local catalog\n");
} elsif ( ! -f "$tmpdir/$local" ) {
die("error: package command with ID '$id' uses non-existent catalog '$local'\n");
}
$ADD_PACKAGE .= "\t" . add_xmlcat_cmd($package, $type, $id, $local) . "\\n";
$DEL_PACKAGE .= "\t" . del_xmlcat_cmd($package, $type, $id) . "\\n";
}
} elsif ( $line->[0] eq 'root' ) {
if ( ! $dh{ NOSCRIPTS } ) {
my $type = $line->[1];
my $id = $line->[2];
$ADD_ROOT .= "\t" . add_xmlcat_cmd($package, $type, $id) . "\\n";
$DEL_ROOT .= "\t" . del_xmlcat_cmd($package, $type, $id, 1) . "\\n";
}
} elsif ( $line->[0] eq 'root-and-package' ) {
if ( ! $dh{ NOSCRIPTS } ) {
my $type = $line->[1];
my $id = $line->[2];
my $local = $line->[3];
if ( ! $local ) {
die("error: root-and-package command with ID '$id' incorrect, must specify local catalog\n");
} elsif ( ! -f "$tmpdir/$local" ) {
die("error: root-and-package command with ID '$id' uses non-existent catalog '$local'\n");
}
$ADD_PACKAGE .= "\t" . add_xmlcat_cmd($package, $type, $id, $local) . "\\n";
$DEL_PACKAGE .= "\t" . del_xmlcat_cmd($package, $type, $id) . "\\n";
$ADD_ROOT .= "\t" . add_xmlcat_cmd($package, $type, $id) . "\\n";
$DEL_ROOT .= "\t" . del_xmlcat_cmd($package, $type, $id, 1) . "\\n";
}
} else {
die("cannot understand command '" . $line->[0] .
"' in file $xmlcatlistfile\n");
}
}
# sanity checking
if ( $ADD_PACKAGE and not $ADD_ROOT ) {
warn("warning: elements added to package XML catalog, but not entry for root catalog\n");
}
if ( not $ADD_PACKAGE and not $ADD_ROOT ) {
warning("warning: no catalogs registered\n");
} else {
$ADD_PACKAGE or $ADD_PACKAGE = "\t:";
$ADD_ROOT or $ADD_ROOT = "\t:";
$DEL_PACKAGE or $DEL_PACKAGE = "\t:";
$DEL_ROOT or $DEL_ROOT = "\t:";
autoscript( $package, "postinst", "postinst-xmlcatalog",
"s%#ADD_PACKAGE#%$ADD_PACKAGE%g; s%#ADD_ROOT#%$ADD_ROOT%g;" );
autoscript( $package, "prerm", "prerm-xmlcatalog",
"s%#DEL_PACKAGE#%$DEL_PACKAGE%g; s%#DEL_ROOT#%$DEL_ROOT%g;" );
autoscript( $package, "postrm", "postrm-xmlcatalog",
"s%#PACKAGECAT#%$packagecat%g;" );
addsubstvar( $package,
"misc:Depends", "xml-core", ">= $xmlcorever" );
}
}
}
## ----------------------------------------------------------------------
if [ "$1" = "configure" ]; then
#ADD_PACKAGE#
#ADD_ROOT#
fi
if [ "$1" = "purge" ]; then
rm -f #PACKAGECAT# #PACKAGECAT#.old
fi
if [ "$1" = "remove" ] || [ "$1" = "upgrade" ]; then
#DEL_ROOT#
#DEL_PACKAGE#
fi
xml-core for Debian
-------------------
De-Facto Standard Tool for Debian XML Catalog System Maintenance
----------------------------------------------------------------
update-xmlcatalog(8) in the xml-core package is the de-facto standard
tool to be used to maintain XML catalog files on a Debian system,
just as update-catalog(8) in the sgml-base package is the standard
tool to be used to maintain SGML catalog files on a Debian system. A
Debian XML/SGML Policy document to this effect is currently under
development.
Incompatibility of update-xmlcatalog(8) and xmlcatalog(1)
---------------------------------------------------------
update-xmlcatalog(8) in the xml-core package and xmlcatalog(1) in the
libxml2-utils package are _incompatible_. The former has an internal
database of all the entries in all the XML catalog files it maintains
and regenerates the indicated XML catalog file completely from scratch
upon an update. The latter updates the indicated XML catalog file
directly. This means that any change made to an XML catalog file
using xmlcatalog(1) is overwritten the next time that XML catalog file
is updated using update-xmlcatalog(8).
Debhelper Support
-----------------
This package contains the debhelper script 'dh_installxmlcatalogs'
to support installing local XML catalog files and registering XML
entities in the XML catalog system. It complies with the current
draft Debian XML/SGML policy. For more information see the manual
page.
Debian XML & SGML Mailing List
------------------------------
The Debian mailing list 'debian-sgml@lists.debian.org' is used to
discuss issues related to XML and SGML on Debian systems, with an
emphasis on proper integration of tools, packaging standards and the
writing of documentation for XML and SGML users.
Debian XML & SGML Group Project
-------------------------------
The 'Debian XML/SGML Group' project (http://debian-xml-sgml.alioth.debian.org/)
has been setup on Debian Alioth (http://alioth.debian.org/) to develop
and maintain XML and SGML packages for the Debian Project in a
collaborative effort.
--
Ardo van Rangelrooij (ardo@debian.org)
------------------------------------------------------------------------------
To do list for xml-core
------------------------------------------------------------------------------
BUGS:
------------------------------------------------------------------------------
Number Description
------------------------------------------------------------------------------
------------------------------------------------------------------------------
WISHLIST:
------------------------------------------------------------------------------
Number Description
------------------------------------------------------------------------------
------------------------------------------------------------------------------
VARIOUS:
------------------------------------------------------------------------------
Description
------------------------------------------------------------------------------
* public CVS repository (Alioth?)
* support regenerate CLI to regenerate the root XML catalog files and
package XML catalog files
* install and register all versions of the XML catalog schema
(including symlinks under /usr/share/sgml and registration in the
SGML catalog system) (don't forget the copyright)
* put as much as possible code in a module (e.g. Debian::XML::Catalog)
* add John Cowan's script:
http://lists.oasis-open.org/archives/entity-resolution/200106/msg00021.html
------------------------------------------------------------------------------
xml-core (0.09) unstable; urgency=low
* schemas/catalog: added official FPI for XML catalog DTD
(closes: Bug#231816)
-- Ardo van Rangelrooij <ardo@debian.org> Sun, 25 Apr 2004 11:09:19 -0500
xml-core (0.08) unstable; urgency=low
* Moved 'dh_installxmlcatalogs' and 'autoscripts' into 'debhelper' directory
- debian/rules: updated accordingly
* Moved schemas and associated catalogs into 'schemas' directory
- debian/xml-core.sgmlcatalogs; updated accordingly
- debian/xml-core.xmlcatalogs; updated accordingly
* Moved 'update-xmlcatalog*' and XML catalog templates to 'tools' directory
* Added Makefiles to all new subdirectories and put all the common parts
in 'MAKE/include'
* tools/update-xmlcatalog: absorbed manual page in POD format
* debian/control: changed maintainer's email address to the new Debian
XML/SGML Group's packages mailing list
-- Ardo van Rangelrooij <ardo@debian.org> Wed, 21 Apr 2004 11:09:24 -0500
xml-core (0.07) unstable; urgency=low
* update-xmlcatalog: changed to be idempotent for XML entity registration
(closes: Bug#232502)
* debian/README.Debian: fixed various small typos and such
(closes: Bug#230845)
* debian/control: changed 'Maintainer' to 'Debian XML/SGML Group
<debian-xml-sgml-devel@lists.alioth.debian.org>' and added current
maintainer as 'Uploaders'
-- Ardo van Rangelrooij <ardo@debian.org> Mon, 23 Feb 2004 22:31:10 -0600
xml-core (0.06) unstable; urgency=low
* update-xmlcatalog.8: updated to match update-xmlcatalog
* Added XML infrastructure directories
(closes: Bug#228656)
- Makefile: created the XML infrastructure directories under
/usr/share/xml and under /usr/share/local/xml
- debian/rules: updated to use 'dh_usrlocal'
- debian/xml-core.{post,pre}*: removed obsolete code
* Added dh_installxmlcatalogs and associated autoscripts
- Makefile: updated to generate dh_installxmlcatalogs(1)
- debian/control: added build-dependency on 'perl'
- Makefile: updated to install dh_installxmlcatalogs and associated files
- debian/control: added 'Suggests' for 'debhelper (>= 4.1)'
- debian/README.Debian: updated to mention debhelper support
* Converted to use dh_installxmlcatalogs
- debian/xml-core.xmlcatalogs: added
- debian/rules: updated to use dh_installxmlcatalogs
- debian/xml-core.{post,pre}*: removed obsolete code
* Added registration of XML catalog schema in SGML catalog system
(closes: Bug#229259)
- debian/xml-core.links: added
- debian/rules: updated to use dh_link
- catalog: added
- debian/xml-core.sgmlcatalogs: added
- debian/rules: updated to use dh_installcatalogs
* Provided proper examples
(closes: Bug#227130)
- examples/foo.xmlcatalogs: added
- examples/foo.p*: updated
* debian/control: rewrote short and long description
-- Ardo van Rangelrooij <ardo@debian.org> Sun, 1 Feb 2004 13:06:52 -0600
xml-core (0.05) unstable; urgency=low
* update-xmlcatalog: changed catalog path generation for root catalog to
add "file://" protocol just as is done for package catalogs
-- Ardo van Rangelrooij <ardo@debian.org> Sat, 10 Jan 2004 16:45:24 -0600
xml-core (0.04) unstable; urgency=low
* catalog.xml: reverted back to original version
* catalog.header: changed prolog to support bootstrapping XML catalog system
(now really closing bug #223041)
* debian/control: upgraded to Debian Policy 3.6.1 (no changes)
-- Ardo van Rangelrooij <ardo@debian.org> Thu, 25 Dec 2003 10:10:26 -0600
xml-core (0.03) unstable; urgency=low
* catalog.xml: changed prolog to support bootstrapping the XML catalog system
(closes: Bug#223041)
* Added debian/README.Debian
* update-xmlcatalog.8: added a link to the README.Debian
* update-xmlcatalog.8: added a note about update-xmlcatalog(8) being the
de-facto standard tool to maintain the XML catalog system on a Debian
system
* update-xmlcatalog.8: added a note about the impopatibility between
update-xmlcatalog(8) and xmlcatalog(1) (from the libxml2-utils package)
(closes: Bug#207470)
* update-xmlcatalog.8: various cosmetic updates
-- Ardo van Rangelrooij <ardo@debian.org> Sat, 6 Dec 2003 14:03:38 -0600
xml-core (0.02) unstable; urgency=low
* update-xmlcatalog: improved legacy /etc/xml/catalog handling
(closes: Bug#207070)
- preinst moves legacy '/etc/xml/catalog' to '/etc/xml/catalog.legacy'
- postrm moves legacy '/etc/xml/catalog.legacy' back to '/etc/xml/catalog'
- update-xmlcatalog: fixed erroneous catalog data file check
* debian/prerm: improved to clean own catalog files more robustly
(closes: Bug#207171)
* update-xmlcatalog: improved command-line option checking
* update-xmlcatalog: added proper support for local XML catalog files
* debian/control: removed suggestion of not yet existing 'xml-core-doc'
* debian/control: improved long description
* README: various small cosmetic updates
-- Ardo van Rangelrooij <ardo@debian.org> Mon, 25 Aug 2003 19:55:00 -0500
xml-core (0.01) unstable; urgency=low
* Initial official release
-- Ardo van Rangelrooij <ardo@debian.org> Sat, 16 Aug 2003 12:50:43 -0500
xml-core (0.0.02) experimental; urgency=low
* First public, highly experimental prelimenary release
-- Ardo van Rangelrooij <ardo@debian.org> Sun, 10 Aug 2003 12:16:54 -0500
xml-core (0.0.01) experimental; urgency=low
* Initial private prelimenary release
-- Ardo van Rangelrooij <ardo@debian.org> Sat, 5 Apr 2003 16:26:27 -0600
Source: xml-core
Section: text
Priority: optional
Maintainer: Debian XML/SGML Group <debian-xml-sgml-pkgs@lists.alioth.debian.org>
Uploaders: Ardo van Rangelrooij <ardo@debian.org>
Standards-Version: 3.6.1
Build-Depends-Indep: perl, debhelper (>= 4.1.75)
Package: xml-core
Section: text
Priority: optional
Architecture: all
Depends: ${perl:Depends}, sgml-base (>= 1.17)
Suggests: debhelper (>= 4.1.75)
Description: XML infrastructure and XML catalog file support
This package creates the XML infrastructure directories and provides
XML catalog file support in compliance with the current Debian XML
Policy draft:
.
* infrastructure directories:
- /etc/xml
- /usr/share/xml/{declaration,entities,misc,schema}
- /usr/share/local/xml/{declaration,entities,misc,schema}
.
* XML catalog schema: OASIS XML Catalog Committee Specification 1.0
.
* update-xmlcatalog(8): tool for maintaining the root XML catalog
file and the package XML catalog files in the '/etc/xml' directory
as well as local XML catalog files.
.
* dh_installxmlcatalogs(1): debhelper tool for installing local XML
catalog files and registering XML entities in package XML catalog
files and the root XML catalog file (requires debhelper package)
This is the Debian package of xml-core. It is assembled and maintained
by Ardo van Rangelrooij <ardo@debian.org>.
Authors: Ardo van Rangelrooij <ardo@debian.org>
Copyright:
Copyright (c) 2003 Ardo van Rangelrooij
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License with
the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
if not, write to the Free Software Foundation, Inc., 59 Temple Place,