Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implement `debian/rules get-orig-source', more or less.

  • Loading branch information...
commit 88de3cabe2e3cc85144012401f5dd2d5e0df00de 1 parent 2522987
@SamB authored
Showing with 29 additions and 1 deletion.
  1. +28 −0 debian/rules
  2. +1 −1  debian/watch
View
28 debian/rules
@@ -17,6 +17,34 @@ override_dh_auto_build-indep:
override_dh_auto_clean:
$(MAKE) -f debian/Makefile clean
+
+# XXX: Policy says this rule should download the latest, but there
+# doesn't seem to be a good way to know what version uscan downloaded,
+# so we don't do that yet.
+#
+# This behaviour is shared by all of the example implementations on
+# <https://wiki.ubuntu.com/PackagingGuide/Basic#Changing_the_Original_Tarball>,
+# though, so I (SamB) can't bring myself to feel very bad about it.
+#
+# Policy also says this rule should work from any directory, but
+# doesn't give any hints on how to figure out where the package is,
+# so it only works from the root of the package source for now.
+
+DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
+DEB_UPSTREAM_MAJOR=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([0-9]+\.[0-9]+).*,\1,p')
+get-orig-source:
+ # Uscan can grab upstream source zip
+ uscan --noconf --force-download --download-current-version --destdir=.
+
+ # Distill the tarball to just the docs (and texi2pod)
+ python debian/extract-doc-tarball-from-upstream \
+ gcc-$(DEB_UPSTREAM_VERSION).tar.gz \
+ gcc-$(DEB_UPSTREAM_MAJOR)-non-dfsg \
+ $(DEB_UPSTREAM_VERSION)
+
+ rm -f gcc-$(DEB_UPSTREAM_VERSION).tar.gz
+
+
# Use override_dh_* targets to customize this.
# ---------------------------------------------------
# Followings are the old debian/rules
View
2  debian/watch
@@ -1,4 +1,4 @@
# format version number, currently 3; this line is compulsory!
version=3
-ftp://gcc.gnu.org/pub/gcc/releases/gcc-(4\.6[\d\.]*)
+ftp://gcc.gnu.org/pub/gcc/releases/gcc-(4\.6[\d\.]*)/gcc-(4\.6[\d\.]*).tar.gz
Please sign in to comment.
Something went wrong with that request. Please try again.