FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 12-11-2008, 10:35 PM
Till Maas
 
Default Packaging dtds

Hiyas,

I would like to package a dtd for a package of mine: pam_mount. It has an xml
config file that has this dtd line:

<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">

Where do I now have to install the dtd? Is it
/usr/share/xml/dtds/pam_mount/pam_mount.conf.xml.dtd? I guess I will also have
to create some XML catalog file, probably with xmlcatalog to make xmllint find
the dtd automatically. This seems to work:

# for /etc/catalog and xmlcatalog
Requires: xml-common
Requires(post): xml-common libxml2
Requires(postun): xml-common libxml2

%post
/usr/bin/xmlcatalog --noout --add "rewriteSystem" pam_mount.conf.xml.dtd
file:///usr/share/xml/pam_mount/dtds/pam_mount.conf.xml.dtd /etc/xml/catalog
&> /dev/null || :

%postun
if [ $1 = 0 ]; then
/usr/bin/xmlcatalog --noout --add "rewriteSystem" pam_mount.conf.xml.dtd
file:///usr/share/xml/pam_mount/dtds/pam_mount.conf.xml.dtd /etc/xml/catalog
fi

If this is good, I will suggest to include this in the Guidelines or add it
somewhere else in the wiki. Or is there already some guidance that I did not
find?

Regards,
Till
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 12-11-2008, 11:31 PM
Till Maas
 
Default Packaging dtds

On Fri December 12 2008, Till Maas wrote:

> %postun
> if [ $1 = 0 ]; then
> /usr/bin/xmlcatalog --noout --add "rewriteSystem" pam_mount.conf.xml.dtd
> file:///usr/share/xml/pam_mount/dtds/pam_mount.conf.xml.dtd
> /etc/xml/catalog fi

This should be the following:

/usr/bin/xmlcatalog --noout --del
file://%{_datadir}/xml/pam_mount/dtds/pam_mount.conf.xml.dtd
%{_sysconfdir}/catalog

Regards,
Till
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 12-12-2008, 12:39 AM
Toshio Kuratomi
 
Default Packaging dtds

I wrote some a catalog handling %post(un) in the Red Hat Linux 9/Fedora
Core 1 time frame. Not sure if it's still up to date, though.

> I would like to package a dtd for a package of mine: pam_mount. It has an xml
> config file that has this dtd line:
>
> <!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
>
The DOCTYPE that I was dealing with was:

<!DOCTYPE checklist
PUBLIC "-//BadgerWare//DTD QA Assistant Checklist File 0.3//EN"
"http://qa-assistant.sf.net/dtds/checklist/0.3/checklist.dtd">

I think some of the differences we see below are due to PUBLIC instead
of SYSTEM. Some other differences are due to upstream's use of a
subcatalog.

> Where do I now have to install the dtd? Is it
> /usr/share/xml/dtds/pam_mount/pam_mount.conf.xml.dtd? I guess I will also have
> to create some XML catalog file, probably with xmlcatalog to make xmllint find
> the dtd automatically. This seems to work:
>
> # for /etc/catalog and xmlcatalog
> Requires: xml-common
> Requires(post): xml-common libxml2
> Requires(postun): xml-common libxml2
>
This looks correct.

> %post
> /usr/bin/xmlcatalog --noout --add "rewriteSystem" pam_mount.conf.xml.dtd
> file:///usr/share/xml/pam_mount/dtds/pam_mount.conf.xml.dtd /etc/xml/catalog
> &> /dev/null || :
>

I did:

ROOTCATALOG=%{_sysconfdir}/xml/catalog
/usr/bin/xmlcatalog --noout --add "delegatePublic"
"-//BadgerWare//DTD QA Assistant"
"file://$CATALOG" $ROOTCATALOG &> /dev/null || :
/usr/bin/xmlcatalog --noout --add "delegateSystem"
"http://qa-assistant.sf.net/dtds"
"file://$CATALOG" $ROOTCATALOG &> /dev/null || :
/usr/bin/xmlcatalog --noout --add "delegateURI"
"http://qa-assistant.sf.net/dtds"
"file://$CATALOG" $ROOTCATALOG &> /dev/null || :

[Corrected from next post]
> %postun
> if [ $1 = 0 ]; then
> /usr/bin/xmlcatalog --noout --del
> file://%{_datadir}/xml/pam_mount/dtds/pam_mount.conf.xml.dtd
> %{_sysconfdir}/catalog
> fi
>
ROOTCATALOG=%{_sysconfdir}/xml/catalog
CATALOG=%{_datadir}/xml/qa-assistant/xmlcatalog

/usr/bin/xmlcatalog --noout --del
"-//BadgerWare//DTD QA Assistant" &> /dev/null || :
/usr/bin/xmlcatalog --noout --del
"http://qa-assistant.sf.net/dtds"

The $CATALOG file referenced in the above snippets was created by the
upstream Makefile. It added rewriteSystem as you do and also rewriteURI
and public:

$(XMLCATALOG) --noout --add "public"
"-//BadgerWare//DTD QA Assistant Checklist File 0.3//EN"
"checklist/0.3/checklist.dtd" $(DESTDIR)$(CATALOG);
$(XMLCATALOG) --noout --add "rewriteSystem"
"http://qa-assistant.sf.net/dtds/checklist/0.3"
"checklist/0.3/" $(DESTDIR)$(CATALOG);
$(XMLCATALOG) --noout --add "rewriteURI"
"http://qa-assistant.sf.net/dtds/checklist/0.3"
"checklist/0.3/" $(DESTDIR)$(CATALOG);

The dtd ended up in %{_datadir}/xml/qa-assistant/checklist/0.3/checklist.dtd

The catalog referencing it was in %{_datadir}/xml/qa-assistant/xmlcatalog

> If this is good, I will suggest to include this in the Guidelines or add it
> somewhere else in the wiki. Or is there already some guidance that I did not
> find?
>
This should go on Packaging/ScriptletSnippets when done.

-Toshio

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 12-12-2008, 08:17 AM
"Nicolas Mailhot"
 
Default Packaging dtds

Le Ven 12 décembre 2008 02:39, Toshio Kuratomi a écrit :

> I think some of the differences we see below are due to PUBLIC instead
> of SYSTEM. Some other differences are due to upstream's use of a
> subcatalog.

IIRC a catalog indexes PUBLIC objects, so you need to add a PUBLIC id
to your DTD to catalog it.

SYSTEM is "direct reference to local system path"

--
Nicolas Mailhot

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 12-12-2008, 08:23 AM
Till Maas
 
Default Packaging dtds

On Fri December 12 2008, Nicolas Mailhot wrote:

> IIRC a catalog indexes PUBLIC objects, so you need to add a PUBLIC id
> to your DTD to catalog it.

/etc/xml/catalog also works for SYSTEM objects.

Regards,
Till
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 12-12-2008, 03:47 PM
Ville Skyttä
 
Default Packaging dtds

On Friday 12 December 2008, Till Maas wrote:

> If this is good, I will suggest to include this in the Guidelines or add it
> somewhere else in the wiki. Or is there already some guidance that I did
> not find?

Unless you already have, I suggest taking a look at the xhtml1-dtds package;
quite a bit of work has went to it (as well as html401-dtds) to get things
right. See also discussion in bugs 181068 and 226559.

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 

Thread Tools




All times are GMT. The time now is 08:47 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org