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

Gustavo R. Montesino "Gustavo R. Montesino" <grmontesino@ig.com.br>, 304131@bugs.debian.org
Sat, 16 Apr 2005 16:03:16 -0300


On Sat, Apr 16, 2005 at 08:23:26PM +0200, Alban browaeys wrote:
> As:
> http://packages.debian.org/cgi-bin/search_contents.pl?searchmode=3Dfile=
list&word=3Dlibgnomedb2-doc&version=3Dunstable&arch=3Dall&page=3D2&number=
=3D50
>=20
> show the libgnomedb2-doc package ship files in=20
> /usr/share/doc/libgnomedb2-doc
> and
> /usr/share/doc/libgnomedb2-4-doc
>=20
> Per se it is not a problem though the rule file also use both to make
> symlinks and some end in nowhere land.

This is an error that will be fixed soon...
=20
> 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)???:
> ... postinst script returned with exit status 2
>
> the libgnomedb doc directory is there : /usr/share/doc/libgnomedb2-4-do=
c/libgnomedb/

Even though I couldn't reproduce this bug yet.
=20
> i think about changing :
> libgnomedb2-doc.doc-base.libgnomedb-reference
> to something like control.in and generate a new file with @SONAME@ in i=
t ot end up with :
>=20
> 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
>=20
> Format: HTML
> Index: /usr/share/doc/libgnomedb2-4-doc/libgnomedb/index.html
> Files: /usr/share/doc/libgnomedb2-4-doc/libgnomedb/*.html
>=20
>=20
> instead of :
> Format: HTML
> Index: /usr/share/doc/libgnomedb2-doc/libgnomedb/index.html
> Files: /usr/share/doc/libgnomedb2-doc/libgnomedb/*.html
>=20
>=20
> but again i have a problem. cdbs read all files  in the packagename.doc=
-base.* so it end up using my:
> libgnomedb2-doc.doc-base.libgnomedb-reference.in and not the generated =
libgnomedb2-doc.doc-base.libgnomedb-reference
>=20
> By the way what is the point of creating : libgnomedb2-4-doc.doc-base.l=
ibgnomedb-reference
> from libgnomedb2-doc.doc-base.libgnomedb-reference ? from my tests cdbs=
 end up using the latter and does nothing=20
> with the former.

This is also an error that will be fixed soon.
=20
> cdbs use this to get the document id and generate the postinst/prerm:
>=20
>       opendir(DEB,"debian/") || error("can't read debian directory: $!"=
);
>         # If this is the main package, we need to handle unprefixed fil=
enames.
>         # For all packages, we must support both the usual filename for=
mat 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);
>=20
>         if (%doc_ids) {
>                 if (! -d "$tmp/usr/share/doc-base/") {
>                         doit("install","-g",0,"-o",0,"-d","$tmp/usr/sha=
re/doc-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-ba=
se",
>                                 "s/#DOC-ID#/$doc_ids{$fn}/",
>                         );
>                         autoscript($package,"prerm","prerm-doc-base",
>                                 "s/#DOC-ID#/$doc_ids{$fn}/",
>                         );
>                 }
>         }
>=20
>=20
> =20
>=20
>=20
>=20
>=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
>=20
> lrwxrwxrwx  1 root root 38 2005-04-16 01:37 /usr/share/gtk-doc/html/lib=
gnomedb -> ../../doc/libgnomedb2-doc/libgnomedb
>=20
> when the doc is in :
> ../../doc/libgnomedb2-4-doc/libgnomedb
>=20
> I fixed it with this patch:
>=20
> diff -uNr libgnomedb-1.2.1.orig/debian/rules libgnomedb-1.2.1/debian/ru=
les
> --- 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/htm=
l/* \
>         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
>=20
>  .PHONY: post-patches clean common-binary-post-install-arch binary-inst=
all/libgnomedb2-${soname} binary-install/libgnomedb2-common binary-instal=
l/libgnomedb2-${soname}-dbg binary-install/libgnomedb2-dev binary-install=
/libgnomedb2-doc

Actually I'm going to fix this the other way around and install all
files in /usr/share/doc/libgnomedb2-doc.
=20
> 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.

As I said, I'll fix it the other way and get rid of libgnomedb2-4-doc.
The code to do so is already on Gnome Team svn repository.
=20
> One last question. Building the package i got ("Permission non accord=E9=
e"
> =3D=3D "Permission denied"). IS scrollkeeper update supposed to be call=
ed in
> the build process ?
>=20
>=20
> 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 =E0 faire pour =AB install-exec-am =BB.
> /bin/sh ../mkinstalldirs /home/prahal/Projets/ImproveDeb/libgnomedb/pra=
hal_libgnomedb-1.2.1/debian/tmp//usr/share/omf/libgnomedb
> mkdir -p
> -- /home/prahal/Projets/ImproveDeb/libgnomedb/prahal_libgnomedb-1.2.1/d=
ebian/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/debian/tmp//usr/share/omf/libgnomedb; \
> done
> scrollkeeper-update -p /var/lib/scrollkeeper
> Cannot write to log file: /var/log/scrollkeeper.log : Permission non
> accord=E9e
>=20
> [...]
>

Hmm... it makes sense to upstream Makefile to call it after
installing... I'm not sure if it pays to change this.
=20
>=20
> 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 i=
t
> does not work here (dh_gconf is installed).

Well... I'll have to take a look at it; as you probably noticed the
gnome macro is being called and isn't doing its work...

BTW, it would be nice if you could open one report for each problem the
next time.

Thanks,

--=20
Gustavo R. Montesino
Debian Brasil - http://www.debianbrasil.org/