[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Reducing lintian messages on mod_tile



Good Evening , 

Per chat at debian-gis@oftc, I have attached several patches against https://
git.linuxminded.nl/git/pkg-grass/libapache2-mod-tile
 (as it was the most recent mod_tile repository related to the project). 

Except for the patch 0003-use-debian-provided-iniparser-instead-of-self-
compil.patch all patches are there just to remove lintian warning and Errors. 

The patch  0003-use-debian-provided-iniparser-instead-of-self-compil.patch 
remove the need to statically link against an upstream version. 
>From 650eb73375b3da7a6dd9c9943a064a0dd12b9d83 Mon Sep 17 00:00:00 2001
From: Boris Shtrasman <boris@example.com>
Date: Tue, 16 Jul 2019 15:23:56 +0300
Subject: [PATCH 1/5] Use libjs-openlayers to solve privacy-preach lintian
 errors

E: libapache2-mod-tile: privacy-breach-uses-embedded-file usr/share/libapache2-mod-tile/slippymap.html You may use the libjs-openlayers package. (http://openlayers.org/api/openlayers.js)
W: libapache2-mod-tile: privacy-breach-generic usr/share/libapache2-mod-tile/slippymap.html [<script src="http://www.openstreetmap.org/openlayers/openstreetmap.js";>] (http://www.openstreetmap.org/openlayers/openstreetmap.js)
---
 debian/control | 2 +-
 slippymap.html | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 07627af..0d8cce2 100644
--- a/debian/control
+++ b/debian/control
@@ -22,7 +22,7 @@ Depends: apache2,
          renderd | tirex-master,
          ${shlibs:Depends},
          ${misc:Depends},
-Suggests: renderd
+Suggests: renderd, libjs-openlayers
 Description: Apache module to deliver tiles created by renderd
  mod_tile is a system to serve raster tiles for example to use within a
  slippy map. It provides a dynamic combination of efficient caching and
diff --git a/slippymap.html b/slippymap.html
index 52b684d..1351eeb 100644
--- a/slippymap.html
+++ b/slippymap.html
@@ -5,12 +5,12 @@
     <!-- bring in the OpenLayers javascript library
          (here we bring it from the remote site, but you could
          easily serve up this javascript yourself) -->
-    <script src="http://openlayers.org/api/OpenLayers.js";></script>
+    <script src="javascript/OpenLayers/OpenLayers.js"></script>
  
     <!-- bring in the OpenStreetMap OpenLayers layers.
          Using this hosted file will make sure we are kept up
          to date with any necessary changes -->
-    <script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js";></script>
+    <script src="javascript/OpenLayers/Layer/OpenStreetMap.js"></script>
  
     <script type="text/javascript">
 // Start position for the map (hardcoded here for simplicity)
-- 
2.20.1

>From e40528fa6008a0dc135e7f06feda6df1b536c059 Mon Sep 17 00:00:00 2001
From: Boris Shtrasman <boris@example.com>
Date: Tue, 16 Jul 2019 15:49:08 +0300
Subject: [PATCH 2/5] package should not enable module , site or restart a
 server (that is left to the Administrator).

This come from https://wiki.debian.org/Apache/PackagingFor24 "To achieve
this, you should not decide yourself when and if to enable a given piece
of configuration or whether or not to restart the web server after
installation of your configuration snippet. Likewise, do not decide
yourself whether or not to enable a particular module you install in
your package. "

Lintian fixes :
W: libapache2-mod-tile: apache2-reverse-dependency-calls-wrapper-script postinst a2enmod
W: libapache2-mod-tile: apache2-reverse-dependency-calls-wrapper-script postinst a2ensite
W: libapache2-mod-tile: apache2-reverse-dependency-calls-wrapper-script postinst a2dissite
W: libapache2-mod-tile: apache2-reverse-dependency-calls-wrapper-script prerm a2dissite
W: libapache2-mod-tile: apache2-reverse-dependency-calls-wrapper-script prerm a2ensite
W: libapache2-mod-tile: apache2-reverse-dependency-calls-wrapper-script prerm a2dismod

E: renderd: init.d-script-needs-depends-on-lsb-base etc/init.d/renderd (line 37)

W: apache2-reverse-dependency-calls-invoke-rc.d postinst
---
 debian/control                      |  2 +-
 debian/libapache2-mod-tile.examples |  2 ++
 debian/libapache2-mod-tile.install  |  2 --
 debian/libapache2-mod-tile.postinst | 18 +-----------------
 debian/libapache2-mod-tile.prerm    |  7 -------
 5 files changed, 4 insertions(+), 27 deletions(-)
 create mode 100644 debian/libapache2-mod-tile.examples

diff --git a/debian/control b/debian/control
index 0d8cce2..7f8a5b7 100644
--- a/debian/control
+++ b/debian/control
@@ -44,7 +44,7 @@ Package: renderd
 Architecture: any
 Section: utils
 Depends: ${shlibs:Depends},
-         ${misc:Depends}
+         ${misc:Depends}, lsb-base
 Recommends: osm2pgsql,
             openstreetmap-carto | openstreetmap-mapnik-stylesheet-data | openstreetmap-mapnik-carto-stylesheet-data
 Suggests: libapache2-mod-tile
diff --git a/debian/libapache2-mod-tile.examples b/debian/libapache2-mod-tile.examples
new file mode 100644
index 0000000..76381fb
--- /dev/null
+++ b/debian/libapache2-mod-tile.examples
@@ -0,0 +1,2 @@
+debian/tileserver_site.conf
+slippymap.html
diff --git a/debian/libapache2-mod-tile.install b/debian/libapache2-mod-tile.install
index 7ff313f..f07f9c2 100644
--- a/debian/libapache2-mod-tile.install
+++ b/debian/libapache2-mod-tile.install
@@ -1,6 +1,4 @@
 debian/tile.load                  /etc/apache2/mods-available
-debian/tileserver_site.conf       /etc/apache2/sites-available
-slippymap.html                    /usr/share/libapache2-mod-tile
 munin/mod_tile*                   /usr/share/munin/plugins
 openstreetmap-tiles-update-expire /usr/bin
 osmosis-db_replag                 /usr/bin
diff --git a/debian/libapache2-mod-tile.postinst b/debian/libapache2-mod-tile.postinst
index 2d3c116..d6da0fd 100644
--- a/debian/libapache2-mod-tile.postinst
+++ b/debian/libapache2-mod-tile.postinst
@@ -8,23 +8,7 @@ if [ "$1" = configure ] ; then
     mkdir -p /var/lib/mod_tile
     chown www-data:www-data /var/lib/mod_tile
 
-    # only enable on new installs, not on upgrades
-    if [ -z "$2" ] ; then
-        a2enmod tile
-        db_get libapache2-mod-tile/enablesite || true
-        ENABLE_SITE=$RET
-        db_stop
-        if [ "x$ENABLE_SITE" = "xtrue" ] ; then
-            a2ensite tileserver_site
-            a2dissite 000-default
-        fi
-    fi
-    
-    # only restart if mod_something is enabled
-    if [ -e /etc/apache2/mods-enabled/tile.load ] ; then
-        invoke-rc.d apache2 restart
-    fi
-    
+     
     # automatically install munin plugins if munin is present.
     if [ -d /etc/munin/plugins ] ; then
         cd /etc/munin/plugins
diff --git a/debian/libapache2-mod-tile.prerm b/debian/libapache2-mod-tile.prerm
index 01c94a1..4da1119 100644
--- a/debian/libapache2-mod-tile.prerm
+++ b/debian/libapache2-mod-tile.prerm
@@ -1,13 +1,6 @@
 #!/bin/sh
 set -e
 
-if [ "$1" = remove ] ; then
-    a2dissite tileserver_site || true
-    a2ensite 000-default || true
-    a2dismod -q -f tile || true
-    invoke-rc.d apache2 restart || true
-fi
-
 # automatically remove munin plugins
 if [ -d /etc/munin/plugins ]
 then
-- 
2.20.1

>From 49c3ea971194638d16e20ee8d060abfa2e0ff6e4 Mon Sep 17 00:00:00 2001
From: Boris Shtrasman <boris@example.com>
Date: Tue, 16 Jul 2019 18:29:43 +0300
Subject: [PATCH 3/5] use debian provided iniparser instead of self compiled
 version

---
 configure.ac   | 2 +-
 debian/control | 7 +++++--
 src/daemon.c   | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index c6ff10a..328f114 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,7 +75,7 @@ if test "$APXS" = "reject"; then
 fi
 
 AC_SEARCH_LIBS([iniparser_load], [iniparser], [
-	AC_CHECK_HEADERS([iniparser.h], [have_system_iniparser=yes])
+	AC_CHECK_HEADERS([iniparser/iniparser.h], [have_system_iniparser=yes])
 ])
 AM_CONDITIONAL([SYSTEM_LIBINIPARSER], [test "x$have_system_iniparser" = "xyes"])
 if test "x$have_system_iniparser" = "xyes"; then
diff --git a/debian/control b/debian/control
index 7f8a5b7..9192211 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,8 @@ Build-Depends: debhelper (>= 9),
                apache2-dev,
                libcairo2-dev,
                libcurl4-gnutls-dev | libcurl-ssl-dev,
-               libmapnik-dev | libmapnik2-dev
+               libmapnik-dev | libmapnik2-dev,
+               libiniparser-dev
 Standards-Version: 4.4.0
 Vcs-Browser: https://salsa.debian.org/debian-gis-team/libapache2-mod-tile
 Vcs-Git: https://salsa.debian.org/debian-gis-team/libapache2-mod-tile.git
@@ -44,7 +45,9 @@ Package: renderd
 Architecture: any
 Section: utils
 Depends: ${shlibs:Depends},
-         ${misc:Depends}, lsb-base
+         ${misc:Depends}, 
+         lsb-base,
+         libiniparser1
 Recommends: osm2pgsql,
             openstreetmap-carto | openstreetmap-mapnik-stylesheet-data | openstreetmap-mapnik-carto-stylesheet-data
 Suggests: libapache2-mod-tile
diff --git a/src/daemon.c b/src/daemon.c
index 56a5b0b..8e10103 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -29,7 +29,7 @@
 #define PIDFILE "/var/run/renderd/renderd.pid"
 
 #if SYSTEM_LIBINIPARSER
-#include <iniparser.h>
+#include <iniparser/iniparser.h>
 #else
 // extern "C" {
 #include "iniparser3.0b/src/iniparser.h"
-- 
2.20.1

>From 76a201a8ba80201e5a013a5acbaa6716a2e29320 Mon Sep 17 00:00:00 2001
From: Boris Shtrasman <boris@example.com>
Date: Tue, 16 Jul 2019 19:04:27 +0300
Subject: [PATCH 4/5] https://wiki.debian.org/Apache/PackagingFor24 says we
 should not depend on apache2 but on a virtual api version package

---
 debian/control | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 9192211..d83793e 100644
--- a/debian/control
+++ b/debian/control
@@ -19,7 +19,7 @@ Homepage: https://wiki.openstreetmap.org/wiki/Mod_tile
 Package: libapache2-mod-tile
 Architecture: any
 Section: httpd
-Depends: apache2,
+Depends: apache2-api-20120211,
          renderd | tirex-master,
          ${shlibs:Depends},
          ${misc:Depends},
-- 
2.20.1

>From bdff236ae9c15a72972fe38a528aab20aafc3e51 Mon Sep 17 00:00:00 2001
From: Boris Shtrasman <boris@example.com>
Date: Tue, 16 Jul 2019 19:18:13 +0300
Subject: [PATCH 5/5] non-standard-apache2-configuration-name

---
 debian/libapache2-mod-tile.apache2             | 2 +-
 debian/{tile.conf => libapache2-mod-tile.conf} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename debian/{tile.conf => libapache2-mod-tile.conf} (100%)

diff --git a/debian/libapache2-mod-tile.apache2 b/debian/libapache2-mod-tile.apache2
index ead6c48..158c02b 100644
--- a/debian/libapache2-mod-tile.apache2
+++ b/debian/libapache2-mod-tile.apache2
@@ -1,3 +1,3 @@
 mod src/.libs/mod_tile.so
 mod debian/tile.load
-conf debian/tile.conf
+conf debian/libapache2-mod-tile.conf
diff --git a/debian/tile.conf b/debian/libapache2-mod-tile.conf
similarity index 100%
rename from debian/tile.conf
rename to debian/libapache2-mod-tile.conf
-- 
2.20.1


Reply to: