Bug#553538: iog: dir-or-file-in-var-www /var/www/iog/in.gif and three others

2010-01-24 Thread Meike Reichle
Dear maintainer,

sorry for not informing you about the intended NMU. I used a borrowed
Laptop during the BSP[0] and did not notice the mails I generated weren't
sent out. It wasn't meant as an offence. I generated the patch again and
attached it to this mail.

Regards,
Meike

[0] http://lists.debian.org/debian-devel-announce/2009/12/msg0.html
diff -u iog-1.03/iog.cfg iog-1.03/iog.cfg
--- iog-1.03/iog.cfg
+++ iog-1.03/iog.cfg
@@ -27,6 +27,6 @@
 # sw2-port20:192.168.0.11:public:ifHCInOctets.20:ifHCOutOctets.20:/www/iog/
 #
-[localhost:127.0.0.1:public:sysUpTime.0:/var/www/iog]
-localhost:127.0.0.1:public:ifInOctets.2:ifOutOctets.2:/var/www/iog
+[localhost:127.0.0.1:public:sysUpTime.0:/var/lib/iog]
+localhost:127.0.0.1:public:ifInOctets.2:ifOutOctets.2:/var/lib/iog
 
 
diff -u iog-1.03/debian/rules iog-1.03/debian/rules
--- iog-1.03/debian/rules
+++ iog-1.03/debian/rules
@@ -46,8 +46,10 @@
dh_installdocs
dh_installexamples iog.cfg
dh_installcron
+   dh_link
dh_undocumented iog.1
dh_installchangelogs 
+   dh_installdebconf
dh_compress
dh_fixperms
dh_installdeb
diff -u iog-1.03/debian/changelog iog-1.03/debian/changelog
--- iog-1.03/debian/changelog
+++ iog-1.03/debian/changelog
@@ -1,3 +1,41 @@
+iog (1.03-3.3) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Included the patch provided by Mats Erik Andersson, which fixes
+dir-or-file-in-var-www  and offers migration if there are already
+files there (Closes: #553538)
+
+ -- Meike Reichle me...@debian.org  Sat, 23 Jan 2010 17:53:44 +0100
+
+iog (1.03-3.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Repair 'dir-or-file-in-var-www'. (Closes: #553538)
++ debian/NEWS: New file with package notes refering to FHS.
++ debian/README.Debian: New file with further hints.
++ debian/control: Policy compliant dependencies:
+  - Depends: Add ucf, debconf, and ${misc:Depends}.
+  - Build-Depends-Indep: po-debconf.
+  - Build-Depends: debhelper.
++ Replace '/var/www/iog' with '/var/lib/iog' in 'iog.cfg'.
++ Use 'ucf' to handle '/etc/iog.cfg'. The package ships the new
+  configuration file as '/usr/share/iog/iog.cfg'.
++ Use 'debconf' to handle the interaction needed for migrating old
+  data in '/var/www/iog/' to preferred location '/var/lib/iog/'.
+  - debian/iog.templates: New file.
+  - debian/iog.config: New file.
+  - debian/po/*: New files.
++ debian/postinst: Now acts on '/var/lib/iog'. Registers the file
+  '/etc/iog.cfg' with 'ucf' and 'ucfr'. Uses debconf for migration.
++ debian/postrm: New file. Upon purge, deregisters '/etc/iog.cfg'
+  using 'ucf' and 'ucfr'.
++ Store images '*.gif' in '/usr/share/iog/' and symlink these
+  to '/var/lib/iog/'.
++ debian/rules: Use dh_link, dh_installdebconf.
++ debian/iog.links: New file, describes links of images.
+
+ -- Mats Erik Andersson mats.anders...@gisladisker.se  Tue, 19 Jan 2010 
12:28:05 +0100
+
 iog (1.03-3.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u iog-1.03/debian/control iog-1.03/debian/control
--- iog-1.03/debian/control
+++ iog-1.03/debian/control
@@ -2,12 +2,13 @@
 Section: net
 Priority: extra
 Maintainer: Mark Purcell m...@debian.org
-Build-Depends-Indep: debhelper ( 3.0.0)
+Build-Depends: debhelper ( 3.0.0)
+Build-Depends-Indep: po-debconf
 Standards-Version: 3.5.2
 
 Package: iog
 Architecture: all
-Depends: libsnmp-session-perl
+Depends: libsnmp-session-perl, ucf, debconf, ${misc:Depends}
 Recommends: snmpd
 Description: Network I/O byte grapher
  IOG is a network I/O byte grapher made to graph cumulative KB/MB/GB
diff -u iog-1.03/debian/iog.install iog-1.03/debian/iog.install
--- iog-1.03/debian/iog.install
+++ iog-1.03/debian/iog.install
@@ -1,3 +1,3 @@
-*.gif  var/www/iog/
+*.gif  usr/share/iog/
 iogusr/sbin/
-iog.cfg etc/
+iog.cfg usr/share/iog/
diff -u iog-1.03/debian/dirs iog-1.03/debian/dirs
--- iog-1.03/debian/dirs
+++ iog-1.03/debian/dirs
@@ -3 +3,2 @@
-var/www/iog
+usr/share/iog
+var/lib/iog
diff -u iog-1.03/debian/postinst iog-1.03/debian/postinst
--- iog-1.03/debian/postinst
+++ iog-1.03/debian/postinst
@@ -11,10 +11,34 @@
 #  failed-install-package version `removing'
 #  conflicting-package version
 
+LIBRARY=/usr/share/iog
+OLDLOCATION=/var/www/iog
+NEWLOCATION=/var/lib/iog
+
+CONFIG=/etc/iog.cfg
+PKGCONFIG=$LIBRARY/iog.cfg
+
 case $1 in
 configure)
 
-   chown -R www-data.www-data /var/www/iog
+   chown -R www-data:www-data /var/lib/iog
+   test -x /usr/bin/ucf  ucf --three-way --debconf-ok $PKGCONFIG $CONFIG
+   test -x /usr/bin/ucfr  ucfr iog $CONFIG
+
+   # Detect an old page depository and activate the desired location.
+
+   if [ -f $OLDLOCATION/uptimes.pag ]
+   then
+   . /usr/share/debconf/confmodule
+   db_get iog/migrate || RET=false
+   if [ $RET = true ]
+   then
+ 

Bug#553538: iog: dir-or-file-in-var-www /var/www/iog/in.gif and three others

2009-10-31 Thread Manoj Srivastava
Package: iog
Version: 1.03-3.1
Severity: serious
User: lintian-ma...@debian.org
Usertags: dir-or-file-in-var-www

Debian packages should not install files under /var/www. This is not
one of the /var directories in the File Hierarchy Standard and is
under the control of the local administrator. Packages should not
assume that it is the document root for a web server; it is very
common for users to change the default document root and packages
should not assume that users will keep any particular setting. 

Packages that want to make files available via an installed web server
should instead put instructions for the local administrator in a
README.Debian file and ideally include configuration fragments for
common web servers such as Apache.

As an exception, packages are permitted to create the /var/www
directory due to its past history as the default document root, but
should at most copy over a default file in postinst for a new install.

Refer to Filesystem Hierarchy Standard (The /var Hierarchy) for
details.

One solution that works is to put configuration files into
/etc/package_name, put static content, if any, into
/usr/{share,lib}/package_name, then create /var/lib/package name
as home for the package, and symlink the files from /etc and /usr/
into the /var/lib/package_name. Then create a simple set of
configuration snippets for popular web servers (for example, files one
may link into /etc/apache2/conf.d) and put them into
/etc/package_name. This way user modifiable files stil live in /etc,
and a simple operation can make the package go live.

Filed as serious, since this is a violation of the FHS (which is part
of policy), and also since a package with these files will currently
get this package rejected. See
  http://lists.debian.org/debian-devel-announce/2009/10/msg4.html
for details. This means the package has been deemed too buggy to be in
Debian.

manoj


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'oldstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31.4-anzu-2 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages iog depends on:
pn  libsnmp-session-perl  none (no description available)

Versions of packages iog recommends:
pn  snmpd none (no description available)

iog suggests no packages.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org