Commits

Felix Krull  committed af085dc

Also preserve debian/source.lintian-overrides during clean.

  • Participants
  • Parent commits 25ff602
  • Branches oneiric

Comments (0)

Files changed (1)

File debian/rules

 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+# Preserve these generated files when cleaning so they're included in the source package
+PRESERVE_FILES := "debian/control:debian/source.lintian-overrides"
+
 DEB_BUILD_OPTIONS := "nocheck nobench"
 DEB_HOST_ARCH		?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 DEB_HOST_ARCH_OS	?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 	  && rm -f debian/control.tmp && exit 0; \
 	  mv debian/control.tmp debian/control
 
+generated-files: control-file
+	: # We have to prepare the various control files
 
+	for f in debian/*.in; do \
+	  f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \
+	  if [ $$f2 != debian/control ]; then \
+	    sed -e "s/@PVER@/$(PVER)/g;s/@VER@/$(VER)/g" \
+		    -e "s/@PRIORITY@/$(PRIORITY)/g" \
+		    -e "s,@SCRIPTDIR@,/$(scriptdir),g" \
+		    -e "s,@INFO@,$(info_docs),g" \
+		  <$$f >$$f2; \
+	  fi; \
+	done
 
-clean: control-file
+stamps/stamp-control: generated-files
+	touch stamps/stamp-control
+
+clean: generated-files
 	dh_testdir
 	dh_testroot
 	rm -rf stamps
 
 	for f in debian/*.in; do \
 	  f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \
-	  if [ $$f2 != debian/control ]; then \
+	  if [[ "$(PRESERVE_FILES)" != *"$$f2"* ]]; then \
 	    rm -f $$f2; \
 	  fi; \
 	done
 	dh_clean
 
-stamps/stamp-control:
-	: # We have to prepare the various control files
-
-	for f in debian/*.in; do \
-	  f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \
-	  if [ $$f2 != debian/control ]; then \
-	    sed -e "s/@PVER@/$(PVER)/g;s/@VER@/$(VER)/g" \
-		    -e "s/@PRIORITY@/$(PRIORITY)/g" \
-		    -e "s,@SCRIPTDIR@,/$(scriptdir),g" \
-		    -e "s,@INFO@,$(info_docs),g" \
-		  <$$f >$$f2; \
-	  fi; \
-	done
-
 install: $(build_target) stamps/stamp-install
 stamps/stamp-install: stamps/stamp-build control-file stamps/stamp-control
 	dh_testdir