[Pkg-javascript-commits] [jquery] 10/15: also build jquery-compat

Antonio Terceiro terceiro at moszumanska.debian.org
Wed Sep 2 14:44:33 UTC 2015


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

terceiro pushed a commit to branch master
in repository jquery.

commit 526e8beb78eeb3318c421dfbfb86754f3496fac2
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Mon Aug 31 15:36:40 2015 -0300

    also build jquery-compat
    
    FIXME: assumes src-compat is already in the tree. need to change
    debian/watch to make uscan inject that in the orig tarball
---
 debian/build.js |  4 ++--
 debian/control  |  5 +++++
 debian/install  |  6 ++++--
 debian/links    |  2 --
 debian/minify   | 11 +++++++++++
 debian/rules    | 23 +++++++++++++----------
 6 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/debian/build.js b/debian/build.js
index 1b20d62..517371b 100644
--- a/debian/build.js
+++ b/debian/build.js
@@ -1,9 +1,9 @@
 /* This file is based on build/tasks/build.js
  */
 ({
-  baseUrl: "src",
+  baseUrl: process.env['INPUT'] || "src",
   name: "jquery",
-  out: "dist/jquery.js",
+  out: process.env['OUTPUT'] || "dist/jquery.js",
   // We have multiple minify steps
   optimize: "none",
   // Include dependencies loaded with require
diff --git a/debian/control b/debian/control
index 5ab5255..18e56cf 100644
--- a/debian/control
+++ b/debian/control
@@ -20,6 +20,7 @@ Architecture: all
 Multi-Arch: foreign
 Conflicts: jquery
 Replaces: jquery
+Provides: libjs-jquery-compat
 Breaks: movabletype-opensource (<< 5.1.4+dfsg-3~)
 Depends: ${misc:Depends}
 Recommends: javascript-common
@@ -28,3 +29,7 @@ Description: JavaScript library for dynamic web applications
  traverse HTML documents, handle events, perform animations, and add Ajax
  interactions to your web pages. jQuery is designed to change the way
  that you write JavaScript.
+ .
+ This package provides both the regular branch of jQuery, optimized for modern
+ browsers and non-browser environments, and the jquery-compat branch, which
+ retains compatibility with older browsers such as Internet Explorer 8.
diff --git a/debian/install b/debian/install
index 3d1c70d..79e95ea 100644
--- a/debian/install
+++ b/debian/install
@@ -1,2 +1,4 @@
-dist/*.js		/usr/share/javascript/jquery
-dist/*.map		/usr/share/javascript/jquery
+dist/*.js             /usr/share/javascript/jquery
+dist/*.map            /usr/share/javascript/jquery
+dist-compat/*.js      /usr/share/javascript/jquery-compat
+dist-compat/*.map     /usr/share/javascript/jquery-compat
diff --git a/debian/links b/debian/links
deleted file mode 100644
index f7a047d..0000000
--- a/debian/links
+++ /dev/null
@@ -1,2 +0,0 @@
-/usr/share/javascript/jquery/jquery.min.js	/usr/share/javascript/jquery/jquery.lite.js
-/usr/share/javascript/jquery/jquery.min.js	/usr/share/javascript/jquery/jquery.pack.js
diff --git a/debian/minify b/debian/minify
new file mode 100755
index 0000000..3f8e043
--- /dev/null
+++ b/debian/minify
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+output="$1"
+
+set -x
+
+uglifyjs \
+	--source-map ${output%%.js}.min.map \
+	--source-map-url jquery.min.map \
+	--output ${output%%.js}.min.js \
+	"$output"
diff --git a/debian/rules b/debian/rules
index d4c76ec..77dea06 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,28 +1,31 @@
 #!/usr/bin/make -f
 
-source = $(shell find src/ -name '*.js')
 timestamp = $(shell date --iso-8601=minutes --utc --date="$(shell dpkg-parsechangelog -S Date)" | sed -e 's/+0000/Z/')
 version = $(shell dpkg-parsechangelog -SVersion | cut -d + -f 1 | sed 's/~/-/')
 
-override_dh_auto_build: dist/jquery.js dist/jquery.min.js dist/jquery.min.map
+dist = dist/jquery.js dist/jquery.min.js dist/jquery.min.map
+dist_compat = dist-compat/jquery.js dist-compat/jquery.min.js dist-compat/jquery.min.map
+
+override_dh_auto_build: $(dist) $(dist_compat)
 	dh_auto_build
 
 build.js: debian/build.js
 	cp $< $@
 
-dist/jquery.js: build.js $(source)
-	nodejs /usr/lib/nodejs/r.js -o build.js
+dist/jquery.js dist-compat/jquery.js: %/jquery.js: build.js $(shell find $* -name '*.js')
+	INPUT=$$(echo $* | sed -e 's/dist/src/') \
+		OUTPUT=$@ \
+		nodejs /usr/lib/nodejs/r.js -o build.js
 	sed -i -e 's/@DATE/$(timestamp)/; s/@VERSION/$(version)/' $@
 
 dist/jquery.min.js dist/jquery.min.map: dist/jquery.js
-	uglifyjs \
-		--source-map dist/jquery.min.map \
-		--source-map-url jquery.min.map \
-		--output dist/jquery.min.js \
-		$^
+	./debian/minify $^
+
+dist-compat/jquery.min.js dist-compat/jquery.min.map: dist-compat/jquery.js
+	./debian/minify $^
 
 override_dh_auto_clean:
-	$(RM) -rf dist/
+	$(RM) -rf dist/ dist-compat/
 	$(RM) build.js
 	dh_auto_clean
 

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



More information about the Pkg-javascript-commits mailing list