Skip to content
Permalink
Browse files

debian packaging: support multiple conditions

  • Loading branch information
jef-n committed Aug 27, 2015
1 parent 95dd734 commit 3c3a4be461fb6cc5fdde4bdf0d57b0216fa90aec
Showing with 13 additions and 16 deletions.
  1. +4 −4 debian/control.in
  2. +9 −12 debian/rules
@@ -289,8 +289,8 @@ Description: GRASS plugin for QGIS
#grass6# qgis-provider-grass (= ${source:Version}),
#grass6# ${shlibs:Depends},
#grass6# ${misc:Depends},
#!sid !precise# grass-core
#precise# grass
#grass6##!precise# grass-core (<< 7)
#grass6##precise# grass (<< 7)
#grass6#Description: GRASS plugin for QGIS
#grass6# QGIS is a Geographic Information System (GIS) which manages, analyzes and
#grass6# display databases of geographic information.
@@ -300,8 +300,8 @@ Description: GRASS plugin for QGIS
#grass6#Package: qgis-plugin-grass-common
#grass6#Architecture: all
#grass6#Depends:
#jessie saucy trusty# python2.7,
#wheezy precise# python,
#grass6##saucy trusty# python2.7,
#grass6##precise# python,
#grass6# ${misc:Depends}
#grass6#Breaks: qgis-common (<< 1.5)
#grass6#Replaces: qgis-common (<< 1.5)
@@ -148,26 +148,23 @@ ifneq (,$(findstring profile,$(DEB_BUILD_OPTIONS)))
endif

# multi distribution support:
# - remove prefixes for current distribution
# - remove lines that exclude current distribution
# - remove prefixes that exclude other distributions
# - remove lines with applicable excludes
# - remove prefixes with applicable includes
# - remove prefixes with not applicable excludes
# - remove remaining comments

CONTROL_EXPRESSIONS = $(DISTRIBUTION) grass$(GRASSVER)

ifneq (,$(WITH_ORACLE))
FILTER_ORACLE = \
-e 's/^#(.* |)oracle( .*|)#//' \
-e '/^#(.* |)!oracle( .*|)#/d'
CONTROL_EXPRESSIONS += oracle
endif

define gentemplate
$(2): $(1)
sed -r \
-e 's/^#(.* |)$(DISTRIBUTION)( .*|)#//' \
-e '/^#(.* |)!$(DISTRIBUTION)( .*|)#/d' \
-e 's/^#(.* |)grass$(GRASSVER)( .*|)#//' \
-e '/^#(.* |)!grass$(GRASSVER)( .*|)#/d' \
$(FILTER_ORACLE) \
-e 's/^#(.* |)![^ ]*( .*|)#//' \
-e '/#(.+ |)!($(subst $(eval) ,|,$(CONTROL_EXPRESSIONS)))( .+|)#/d' \
-e 's/#([^#]+ |)($(subst $(eval) ,|,$(CONTROL_EXPRESSIONS)))( [^#]+|)#//g' \
-e 's/#([^#]+ |)![^#]+( [^#]*|)#//g' \
-e '/^#/d' \
-e "s/\{DEB_BUILD_GNU_TYPE\}/$(DEB_BUILD_GNU_TYPE)/g" \
-e "s#\{QT_PLUGIN_DIR\}#$(QT_PLUGIN_DIR)#g" \

0 comments on commit 3c3a4be

Please sign in to comment.
You can’t perform that action at this time.