Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
debian packaging: support multiple conditions
  • Loading branch information
jef-n committed Aug 27, 2015
1 parent 95dd734 commit 3c3a4be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
8 changes: 4 additions & 4 deletions debian/control.in
Expand Up @@ -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.
Expand All @@ -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)
Expand Down
21 changes: 9 additions & 12 deletions debian/rules
Expand Up @@ -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" \
Expand Down

0 comments on commit 3c3a4be

Please sign in to comment.