Просмотр исходного кода

* build debian and ubuntu package from the same source

Michael Vogt лет назад: 21
Родитель
Сommit
31efb9e8e8
2 измененных файлов с 17 добавлено и 3 удалено
  1. 1 1
      debian/control
  2. 16 2
      debian/rules

+ 1 - 1
debian/control

@@ -4,7 +4,7 @@ Priority: important
 Maintainer: APT Development Team <deity@lists.debian.org>
 Uploaders: Jason Gunthorpe <jgg@debian.org>, Adam Heath <doogie@debian.org>, Matt Zimmerman <mdz@debian.org>, Michael Vogt <mvo@debian.org>
 Standards-Version: 3.6.1
-Build-Depends: debhelper (>= 4.1.62), libdb4.2-dev, gettext (>= 0.12)
+Build-Depends: debhelper (>= 4.1.62), libdb4.2-dev, gettext (>= 0.12), lsb-release, dpatch
 Build-Depends-Indep: debiandoc-sgml, docbook-utils (>= 0.6.12-1)
 
 Package: apt

+ 16 - 2
debian/rules

@@ -17,6 +17,9 @@
 export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
+# apt can be build from the same source on debian and ubuntu
+DIST = $(shell lsb_release -i -s)
+
 # FOR AUTOCONF 2.52 AND NEWER ONLY
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
   confflags += --build $(DEB_HOST_GNU_TYPE)
@@ -111,7 +114,7 @@ build/configure-stamp: configure
 	cd build && CXXFLAGS="$(confcxxflags)" ../configure $(confflags)
 	touch $@
 
-build/build-stamp: build/configure-stamp
+build/build-stamp: build/configure-stamp patch
 	# Add here commands to compile the package.
 	$(MAKE) binary
 	touch $@
@@ -121,7 +124,7 @@ build/build-doc-stamp: build/configure-stamp
 	$(MAKE) doc
 	touch $@
 
-clean:
+clean: unpatch
 	dh_testdir
 #	dh_testroot
 	-$(MAKE) clean
@@ -331,6 +334,17 @@ cvs-mkul:
 	-mkdir -p ../upload-$(APT_DEBVER)
 	cp `find debian/cvs-build -maxdepth 1 -type f` ../upload-$(APT_DEBVER)
 
+patch: patch-stamp
+patch-stamp:
+	cp debian/patches/00list.$(DIST) debian/patches/00list
+	dpatch apply-all
+	touch patch-stamp
+
+unpatch:
+	cp debian/patches/00list.$(DIST) debian/patches/00list
+	dpatch deapply-all
+	rm -rf patch-stamp debian/patched
+
 arch-build:
 	rm -rf debian/arch-build
 	mkdir -p debian/arch-build/apt-$(APT_DEBVER)