Code

update headers include path replacement
authorMarc Fournier <marc.fournier@camptocamp.com>
Mon, 6 Jul 2015 21:44:56 +0000 (23:44 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Mon, 6 Jul 2015 22:06:46 +0000 (00:06 +0200)
Now that part of the headers have been moved to the daemon/
subdirectory, this bit needs to be slightly more sophisticated.

debian/changelog
debian/rules

index c5cfc2f0f2cf0c261d0ca2ff4815033693862a21..138a11932434c1f8a4c5e550848e5c7115a55373 100644 (file)
@@ -13,7 +13,7 @@ collectd (5.5.0-1) UNRELEASED; urgency=medium
     - Removed bts770694_loglevel.dpatch; merged upstream.
     - Removed collection.cgi.dpatch; merged upstream.
     - Removed myplugin_api.dpatch; merged upstream.
-  * debian/collectd-dev.install, myplugin_includes.dpatch:
+  * debian/rules, debian/collectd-dev.install, myplugin_includes.dpatch:
     - Update path to header files moved to daemon/ subdirectory upstream.
   * debian/rules, debian/control:
     - Enable redis, write_redis plugins and add Build-depend on
index 334690908861e71a24e7abd044a3afac8f1e1656..c38d9af584f0b6ffcdfae8ea55006f416e64bec1 100755 (executable)
@@ -209,10 +209,15 @@ install-indep:
        dh_install -i
        
        # update include path for collectd header files
-       sed -r -i -e 's/include "(.*)"/include "collectd\/core\/\1"/' \
-               $(CURDIR)/debian/collectd-dev/usr/include/collectd/core/*
-       sed -r -i -e 's/"collectd\/core\/(liboconfig\/.*)"/"collectd\/\1"/' \
-               $(CURDIR)/debian/collectd-dev/usr/include/collectd/core/*
+       (       set -e; \
+               cd $(CURDIR)/debian/collectd-dev/usr/include/collectd/; \
+               for lib in $$(find . -type f -name '*.h'); do \
+                       libname=$$(basename $$lib); \
+                       fullpath=$$(echo $$lib | sed -r -e 's,^\./,collectd/,'); \
+                       for dir in $$(find . -mindepth 1 -type d); do \
+                               sed -r -i -e "s,(include\s+)\".*$$libname\",\1\"$$fullpath\"," $$dir/*.h; \
+                       done; \
+               done )
 
 install-arch: build
        dh_testdir