Bug#304131: doc directory follow the library or not ?

Alban browaeys browaeys.alban@wanadoo.fr, 304131@bugs.debian.org
Sat, 16 Apr 2005 20:23:26 +0200


As:
http://packages.debian.org/cgi-bin/search_contents.pl?searchmode=3Dfilelist=
&word=3Dlibgnomedb2-doc&version=3Dunstable&arch=3Dall&page=3D2&number=3D50

show the libgnomedb2-doc package ship files in=20
/usr/share/doc/libgnomedb2-doc
and
/usr/share/doc/libgnomedb2-4-doc

Per se it is not a problem though the rule file also use both to make
symlinks and some end in nowhere land.

libgnomedb2-doc: error at upgrade - cannot create dhelp file :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D304131
Setup libgnomedb2-doc (1.2.1-2) ...
cannot create dhelp file
'/usr/share/doc/libgnomedb2-doc/libgnomedb/.dhelp': No such file
or directory=20
dpkg error processing libgnomedb2-doc (--configure)=EF=BF=BD:
... postinst script returned with exit status 2

the libgnomedb doc directory is there : /usr/share/doc/libgnomedb2-4-doc/li=
bgnomedb/


i think about changing :
libgnomedb2-doc.doc-base.libgnomedb-reference
to something like control.in and generate a new file with @SONAME@ in it ot=
 end up with :

Document: libgnomedb2-reference
Title: libgnomedb Reference Manual
Author: Rodrigo Moya <rodrigo@gnome-db.org>
Abstract: This manual describes API which libgnomedb offers
Section: Apps/Programming

Format: HTML
Index: /usr/share/doc/libgnomedb2-4-doc/libgnomedb/index.html
Files: /usr/share/doc/libgnomedb2-4-doc/libgnomedb/*.html


instead of :
Format: HTML
Index: /usr/share/doc/libgnomedb2-doc/libgnomedb/index.html
Files: /usr/share/doc/libgnomedb2-doc/libgnomedb/*.html


but again i have a problem. cdbs read all files  in the packagename.doc-bas=
e.* so it end up using my:
libgnomedb2-doc.doc-base.libgnomedb-reference.in and not the generated libg=
nomedb2-doc.doc-base.libgnomedb-reference

By the way what is the point of creating : libgnomedb2-4-doc.doc-base.libgn=
omedb-reference
from libgnomedb2-doc.doc-base.libgnomedb-reference ? from my tests cdbs end=
 up using the latter and does nothing=20
with the former.

cdbs use this to get the document id and generate the postinst/prerm:

      opendir(DEB,"debian/") || error("can't read debian directory: $!");
        # If this is the main package, we need to handle unprefixed filenam=
es.
        # For all packages, we must support both the usual filename format =
plus
        # that format with a period an something appended.
        my $regexp=3D"\Q$package\E\.";
        if ($package eq $dh{MAINPACKAGE}) {
                $regexp=3D"(|$regexp)";
        }
        foreach my $fn (grep {/^${regexp}doc-base(\..*)?$/} readdir(DEB)) {
                # .EX are example files, generated by eg, dh-make
                next if $fn=3D~/\.EX$/;
                # Parse the file to get the doc id.
                open (IN, "debian/$fn") || die "Cannot read debian/$fn.";
                while (<IN>) {
                        if (/^Document:\s+(.*)(\s+)?/) {
                                $doc_ids{$fn}=3D$1;
                                last;
                        }
                }
                close IN;
        }
        closedir(DEB);

        if (%doc_ids) {
                if (! -d "$tmp/usr/share/doc-base/") {
                        doit("install","-g",0,"-o",0,"-d","$tmp/usr/share/d=
oc-base/");
                }
        }
        foreach my $fn (keys %doc_ids) {
                doit("install","-g",0,"-o",0,"-m644","-p","debian/$fn",
                     "$tmp/usr/share/doc-base/$doc_ids{$fn}");
                if (! $dh{NOSCRIPTS}) {
                        autoscript($package,"postinst","postinst-doc-base",
                                "s/#DOC-ID#/$doc_ids{$fn}/",
                        );
                        autoscript($package,"prerm","prerm-doc-base",
                                "s/#DOC-ID#/$doc_ids{$fn}/",
                        );
                }
        }


=20




I also found out that :
debian/rules
binary-install/libgnomedb2-doc::
        dh_link -plibgnomedb2-doc  \
                --sourcedir=3D${DEB_DH_INSTALL_SOURCEDIR} \
                usr/share/doc/libgnomedb2-doc/libgnomedb \
                usr/share/gtk-doc/html/libgnomedb

lrwxrwxrwx  1 root root 38 2005-04-16 01:37 /usr/share/gtk-doc/html/libgnom=
edb -> ../../doc/libgnomedb2-doc/libgnomedb

when the doc is in :
../../doc/libgnomedb2-4-doc/libgnomedb

I fixed it with this patch:

diff -uNr libgnomedb-1.2.1.orig/debian/rules libgnomedb-1.2.1/debian/rules
--- libgnomedb-1.2.1.orig/debian/rules  2005-04-14 00:32:30.000000000 +0200
+++ libgnomedb-1.2.1/debian/rules       2005-04-16 01:07:31.000000000 +0200
@@ -58,10 +58,10 @@
        --sourcedir=3D${DEB_DH_INSTALL_SOURCEDIR} usr/share/gtk-doc/html/* =
\
        usr/share/doc/libgnomedb2-${soname}-doc
 #      dh_install -plibgnomedb2-doc doc/C/html/{*.devhelp,*.png} \
-#              usr/share/doc/libgnomedb2-doc/libgnomedb
+#              usr/share/doc/libgnomedb2-${soname}-doc/libgnomedb
        dh_link -plibgnomedb2-doc  \
                --sourcedir=3D${DEB_DH_INSTALL_SOURCEDIR} \
-               usr/share/doc/libgnomedb2-doc/libgnomedb \
+               usr/share/doc/libgnomedb2-${soname}-doc/libgnomedb \
                usr/share/gtk-doc/html/libgnomedb

 .PHONY: post-patches clean common-binary-post-install-arch binary-install/=
libgnomedb2-${soname} binary-install/libgnomedb2-common binary-install/libg=
nomedb2-${soname}-dbg binary-install/libgnomedb2-dev binary-install/libgnom=
edb2-doc



The problem is should i rework those patch to get rid
of /usr/share/doc/libgnomedb2-doc  and only keep libgnomedb2-4-doc ?
(maybe also make the doc package name versioned ...)
The current scheme make sense too . The copyright, changelog are not
versioned though the api doc is.
Then above patches are required to get the doc registered on the system.




One last question. Building the package i got ("Permission non accord=C3=A9=
e"
=3D=3D "Permission denied"). IS scrollkeeper update supposed to be called i=
n
the build process ?


make[4]: Leaving directory
`/home/prahal/Projets/ImproveDeb/libgnomedb/prahal_libgnomedb-1.2.1/doc/C'
make[3]: Leaving directory
`/home/prahal/Projets/ImproveDeb/libgnomedb/prahal_libgnomedb-1.2.1/doc/C'
make[3]: Entering directory
`/home/prahal/Projets/ImproveDeb/libgnomedb/prahal_libgnomedb-1.2.1/doc'
make[4]: Entering directory
`/home/prahal/Projets/ImproveDeb/libgnomedb/prahal_libgnomedb-1.2.1/doc'
make[4]: Rien =C3=A0 faire pour =C2=AB install-exec-am =C2=BB.
/bin/sh ../mkinstalldirs /home/prahal/Projets/ImproveDeb/libgnomedb/prahal_=
libgnomedb-1.2.1/debian/tmp//usr/share/omf/libgnomedb
mkdir -p
-- /home/prahal/Projets/ImproveDeb/libgnomedb/prahal_libgnomedb-1.2.1/debia=
n/tmp//usr/share/omf/libgnomedb
for file in ./*.omf; do                        \
/usr/bin/install -c -m 644
$file /home/prahal/Projets/ImproveDeb/libgnomedb/prahal_libgnomedb-1.2.1/de=
bian/tmp//usr/share/omf/libgnomedb; \
done
scrollkeeper-update -p /var/lib/scrollkeeper
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
OMF file [/usr/share/omf/gnome-utils/gfloppy-ja.omf] does not validate
against ScrollKeeper-OMF
DTD: /usr/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Unable to register /usr/share/omf/gnome-utils/gfloppy-ja.omf
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
Cannot write to log file: /var/log/scrollkeeper.log : Permission non
accord=C3=A9e
make[4]: Leaving directory
`/home/prahal/Projets/ImproveDeb/libgnomedb/prahal_libgnomedb-1.2.1/doc'
make[3]: Leaving directory
`/home/prahal/Projets/ImproveDeb/libgnomedb/prahal_libgnomedb-1.2.1/doc'
make[2]: Leaving directory
`/home/prahal/Projets/ImproveDeb/libgnomedb/prahal_libgnomedb-1.2.1/doc'


and this package still ship its gconf schema in /etc/gconf ... would it
be hard to move it to/usr/share/gconf with the cdbs packaging ?
The cdbs gnome macro seems to take care of it though i do not see why it
does not work here (dh_gconf is installed).


Greetings
Alban