Skip to content

Commit 3c3a4be

Browse files
committed
debian packaging: support multiple conditions
1 parent 95dd734 commit 3c3a4be

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

debian/control.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ Description: GRASS plugin for QGIS
289289
#grass6# qgis-provider-grass (= ${source:Version}),
290290
#grass6# ${shlibs:Depends},
291291
#grass6# ${misc:Depends},
292-
#!sid !precise# grass-core
293-
#precise# grass
292+
#grass6##!precise# grass-core (<< 7)
293+
#grass6##precise# grass (<< 7)
294294
#grass6#Description: GRASS plugin for QGIS
295295
#grass6# QGIS is a Geographic Information System (GIS) which manages, analyzes and
296296
#grass6# display databases of geographic information.
@@ -300,8 +300,8 @@ Description: GRASS plugin for QGIS
300300
#grass6#Package: qgis-plugin-grass-common
301301
#grass6#Architecture: all
302302
#grass6#Depends:
303-
#jessie saucy trusty# python2.7,
304-
#wheezy precise# python,
303+
#grass6##saucy trusty# python2.7,
304+
#grass6##precise# python,
305305
#grass6# ${misc:Depends}
306306
#grass6#Breaks: qgis-common (<< 1.5)
307307
#grass6#Replaces: qgis-common (<< 1.5)

debian/rules

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,23 @@ ifneq (,$(findstring profile,$(DEB_BUILD_OPTIONS)))
148148
endif
149149

150150
# multi distribution support:
151-
# - remove prefixes for current distribution
152-
# - remove lines that exclude current distribution
153-
# - remove prefixes that exclude other distributions
151+
# - remove lines with applicable excludes
152+
# - remove prefixes with applicable includes
153+
# - remove prefixes with not applicable excludes
154154
# - remove remaining comments
155155

156+
CONTROL_EXPRESSIONS = $(DISTRIBUTION) grass$(GRASSVER)
157+
156158
ifneq (,$(WITH_ORACLE))
157-
FILTER_ORACLE = \
158-
-e 's/^#(.* |)oracle( .*|)#//' \
159-
-e '/^#(.* |)!oracle( .*|)#/d'
159+
CONTROL_EXPRESSIONS += oracle
160160
endif
161161

162162
define gentemplate
163163
$(2): $(1)
164164
sed -r \
165-
-e 's/^#(.* |)$(DISTRIBUTION)( .*|)#//' \
166-
-e '/^#(.* |)!$(DISTRIBUTION)( .*|)#/d' \
167-
-e 's/^#(.* |)grass$(GRASSVER)( .*|)#//' \
168-
-e '/^#(.* |)!grass$(GRASSVER)( .*|)#/d' \
169-
$(FILTER_ORACLE) \
170-
-e 's/^#(.* |)![^ ]*( .*|)#//' \
165+
-e '/#(.+ |)!($(subst $(eval) ,|,$(CONTROL_EXPRESSIONS)))( .+|)#/d' \
166+
-e 's/#([^#]+ |)($(subst $(eval) ,|,$(CONTROL_EXPRESSIONS)))( [^#]+|)#//g' \
167+
-e 's/#([^#]+ |)![^#]+( [^#]*|)#//g' \
171168
-e '/^#/d' \
172169
-e "s/\{DEB_BUILD_GNU_TYPE\}/$(DEB_BUILD_GNU_TYPE)/g" \
173170
-e "s#\{QT_PLUGIN_DIR\}#$(QT_PLUGIN_DIR)#g" \

0 commit comments

Comments
 (0)