On Sun, 30 Nov 2014 10:29:40 +0100 Andreas Beckmann
wrote:
> Package: pygopherd
> Version: 2.0.18.3+nmu3
> Severity: serious
> User: debian...@lists.debian.org
> Usertags: piuparts
>
> Hi,
>
> a test with piuparts revealed that your package uses files from
> /usr/share/doc in its maintainer scripts which is a violation of
> Policy 12.3: "Packages must not require the existence of any files in
> /usr/share/doc/ in order to function."
> https://www.debian.org/doc/debian-policy/ch-docs.html#s12.3
>
> These files must be moved to /usr/share/$PACKAGE and may be symlinked
> from /usr/share/doc/$PACKAGE.
>
> This piuparts test prevents the installation of (most) files into
> /usr/share/doc with 'dpkg --path-exclude=...'.
>
> >From the attached log (scroll to the bottom...):
>
> Selecting previously unselected package pygopherd.
> (Reading database ... 8452 files and directories currently
installed.)
> Preparing to unpack .../pygopherd_2.0.18.3+nmu3_all.deb ...
> Unpacking pygopherd (2.0.18.3+nmu3) ...
> Setting up pygopherd (2.0.18.3+nmu3) ...
> Adding system user `gopher' (UID 150) ...
> Adding new group `gopher' (GID 151) ...
> Adding new user `gopher' (UID 150) with group `gopher' ...
> Creating home directory `/var/gopher' ...
> cp: cannot stat '/usr/share/doc/pygopherd/examples/gophermap': No
such file or directory
> dpkg: error processing package pygopherd (--configure):
>subprocess installed post-installation script returned error exit
status 1
> Errors were encountered while processing:
>pygopherd
>
I have attached a patch to fix this issue. The patch has the side
effect of also fixing #670437.
Best regards,
--
Cameron Norman
diff -Nru pygopherd-2.0.18.3+nmu3/debian/changelog pygopherd-2.0.18.3+nmu4/debian/changelog
--- pygopherd-2.0.18.3+nmu3/debian/changelog 2013-06-30 05:30:23.0 -0700
+++ pygopherd-2.0.18.3+nmu4/debian/changelog 2014-12-05 21:24:42.0 -0800
@@ -1,3 +1,11 @@
+pygopherd (2.0.18.3+nmu4) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Install gophermap in rules from upstream source, not from
+/usr/share/doc in postinst (Closes: #771501, #670437)
+
+ -- Cameron Norman Fri, 05 Dec 2014 20:51:00 -0800
+
pygopherd (2.0.18.3+nmu3) unstable; urgency=low
* Non-maintainer upload.
diff -Nru pygopherd-2.0.18.3+nmu3/debian/postinst pygopherd-2.0.18.3+nmu4/debian/postinst
--- pygopherd-2.0.18.3+nmu3/debian/postinst 2008-04-10 06:56:55.0 -0700
+++ pygopherd-2.0.18.3+nmu4/debian/postinst 2014-12-05 21:22:48.0 -0800
@@ -31,13 +31,10 @@
set +e
UNAME=gopher
-HOMEDIR=/var/gopher
-if test -d $HOMEDIR; then HOMEDIREXISTS=yes; else HOMEDIREXISTS=no; fi
-
-if ! grep -q "^${UNAME}:.*${HOMEDIR}" /etc/passwd
+if ! grep -q "^${UNAME}:" /etc/passwd
then
- adduser --system --home $HOMEDIR --group $UNAME
+ adduser --system --home /nonexistent --no-create-home --group $UNAME
else
echo "Gopher account already in place; not modifying."
fi
@@ -62,14 +59,8 @@
chsh -s /bin/sh gopher
fi
-
-if [ "$HOMEDIREXISTS" = "no" ]; then
- if ! test -d $HOMEDIR; then
-mkdir $HOMEDIR
- fi
- cp /usr/share/doc/pygopherd/examples/gophermap $HOMEDIR/gophermap
- chown -R gopher.gopher $HOMEDIR
-fi
+# fix permissions on /var/gopher, since the gopher u/gid is now present
+chown -R gopher.gopher /var/gopher
;;
diff -Nru pygopherd-2.0.18.3+nmu3/debian/rules pygopherd-2.0.18.3+nmu4/debian/rules
--- pygopherd-2.0.18.3+nmu3/debian/rules 2013-06-30 05:30:23.0 -0700
+++ pygopherd-2.0.18.3+nmu4/debian/rules 2014-12-05 21:13:53.0 -0800
@@ -75,6 +75,7 @@
mv debian/pygopherd/usr/bin/pygopherd \
debian/pygopherd/usr/sbin/pygopherd
rm debian/pygopherd/etc/pygopherd/mime.types
+ install -D examples/gophermap debian/pygopherd/var/gopher/gophermap
cp pygfarm/*.pyg debian/pygfarm/usr/share/pygfarm
chown root.root debian/pygfarm/usr/share/pygfarm/*
chmod 0755 debian/pygfarm/usr/share/pygfarm/*