[Pkg-javascript-commits] [mathjax-docs] 02/02: Rewrite the tarball-creation code.

Dmitry Shachnev mitya57-guest at moszumanska.debian.org
Wed Feb 12 08:26:58 UTC 2014


This is an automated email from the git hooks/post-receive script.

mitya57-guest pushed a commit to branch master
in repository mathjax-docs.

commit f3a2d919dd74cb80aab9cd65f358be3a33f0393d
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date:   Wed Feb 12 12:26:23 2014 +0400

    Rewrite the tarball-creation code.
    
    * Remove minimized javascript without source from the tarball.
    * Move tarball creation code to debian/get-orig-source.sh.
---
 debian/changelog          |  2 ++
 debian/copyright          | 37 -------------------------------------
 debian/get-orig-source.sh | 35 +++++++++++++++++++++++++++++++++++
 debian/rules              | 12 +-----------
 4 files changed, 38 insertions(+), 48 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index e2cbafa..e22e35d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ mathjax-docs (2.3+20140108-1) unstable; urgency=low
 
   * New upstream snapshot.
   * No longer override dh_builddeb, xz compression is now default.
+  * Remove minimized javascript without source from the tarball.
+  * Move tarball creation code to debian/get-orig-source.sh.
 
  -- Dmitry Shachnev <mitya57 at gmail.com>  Wed, 12 Feb 2014 11:42:41 +0400
 
diff --git a/debian/copyright b/debian/copyright
index 2f32bed..986a703 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -32,43 +32,6 @@ License: BSD
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-Files: _themes/sphinx-bootstrap/*
-Copyright: 2012 Twitter, Inc
-           2012 Design Science, Inc. <support at dessci.com>
-License: Apache-2.0
-
-Files: _themes/sphinx-bootstrap/static/jquery.js
-Copyright: 2010 John Resig
-           2009 The Dojo Foundation
-License: MIT or GPL-2 with Sizzle exception
-    As a special exception, the Sizzle selector engine (which is included
-    inside the jQuery library) is held by the Dojo Foundation and is licensed
-    under the MIT, GPL, and BSD licenses.
-    .
-    MIT license from jQuery source files:
-    Copyright (c) 2011 John Resig, http://jquery.com/
-    .
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-    .
-    The above copyright notice and this permission notice shall be
-    included in all copies or substantial portions of the Software.
-    .
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-Comment: File shipped within source package to avoid changing the original
-    tarball, but binary package doesn't contain it
-
 Files: debian/*
 Copyright: 2012-2013 Dmitry Shachnev <mitya57 at gmail.com>
 License: Apache-2.0
diff --git a/debian/get-orig-source.sh b/debian/get-orig-source.sh
new file mode 100644
index 0000000..23be816
--- /dev/null
+++ b/debian/get-orig-source.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Get the DFSG-compatible source tarball from GitHub
+# Author: 2014 Dmitry Shachnev
+
+export TAR_OPTIONS='--owner root --group root --mode a+rX'
+export GZIP_OPTIONS='-9n'
+
+BRANCH="master"
+MJ_COMMITS="https://github.com/mathjax/mathjax-docs/commits/$BRANCH"
+MJ_TARBALL="https://github.com/mathjax/mathjax-docs/archive/$BRANCH.tar.gz"
+DATE=`wget "$MJ_COMMITS" -qO- | grep -P '\d{4}-\d\d-\d\d' -o | sed 's/-//g' | head -n1`
+
+pwd=$(pwd)
+
+cd "$(dirname "$0")/../"
+tmpdir=$(mktemp -t -d get-orig-source.XXXXXX)
+cd "$tmpdir"
+
+wget -nv "$MJ_TARBALL"
+tar xzf "$BRANCH.tar.gz"
+rm "$BRANCH.tar.gz"
+
+# That theme contains compressed jQuery without source
+rm -rf "MathJax-docs-$BRANCH/_themes/sphinx-bootstrap"
+
+BASEVERSION=`grep ^version "MathJax-docs-$BRANCH/conf.py" | grep '[0-9.]*' -o`
+VERSION="$BASEVERSION+$DATE"
+FILENAME="mathjax-docs_$VERSION.orig.tar.gz"
+
+mv "MathJax-docs-$BRANCH" "mathjax-docs-$VERSION"
+tar -czf "$pwd/$FILENAME" "mathjax-docs-$VERSION"
+cd ..
+rm -Rf "$tmpdir"
+
+echo "Successfully created upstream tarball as $FILENAME."
diff --git a/debian/rules b/debian/rules
index 539d85d..c55fae2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,12 +1,6 @@
 #!/usr/bin/make -f
 # -*- makefile -*-
 
-BRANCH = master
-
-MJ_COMMITS = https://github.com/mathjax/mathjax-docs/commits/$(BRANCH)
-MJ_CONFIG  = https://raw.github.com/mathjax/mathjax-docs/$(BRANCH)/conf.py
-MJ_TARBALL = https://github.com/mathjax/mathjax-docs/archive/$(BRANCH).tar.gz
-
 %:
 	dh $@ --with sphinxdoc
 
@@ -19,8 +13,4 @@ override_dh_auto_clean:
 	dh_auto_clean
 
 get-orig-source:
-	base_version=`wget $(MJ_CONFIG) -qO- | grep -P "(?<=version = ').+(?=')" -o` && \
-	date=`wget $(MJ_COMMITS) -qO- | grep -P '\d{4}-\d\d-\d\d' -o | sed 's/-//g' | head -n1` && \
-	filename=mathjax-docs_$$base_version+$$date.orig.tar.gz && \
-	wget $(MJ_TARBALL) -qO $$filename && \
-	echo "Successfully downloaded tarball and saved to $$filename."
+	sh $(CURDIR)/debian/get-orig-source.sh

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/mathjax-docs.git



More information about the Pkg-javascript-commits mailing list