- compress the .js
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 12 Mar 2009 01:53:33 +0000 (01:53 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dokuwiki-plugin-lightbox.spec -> 1.5

dokuwiki-plugin-lightbox.spec

index ab52549..4b35f0d 100644 (file)
@@ -3,14 +3,17 @@ Summary:      DokuWiki Light Box v2 plugin
 Summary(pl.UTF-8):     Wtyczka lightboxv2 dla DokuWiki
 Name:          dokuwiki-plugin-%{plugin}
 Version:       20080808
-Release:       2
+Release:       2.5
 License:       GPL v2
 Group:         Applications/WWW
 Source0:       http://www.lokeshdhakar.com/projects/lightbox2/releases/lightbox2.04.zip
 # Source0-md5: c930f97a5791f202d7c48303de36f282
 Patch0:                %{name}.patch
+Patch1:                %{name}-dw-jscompress.patch
 URL:           http://wiki.splitbrain.org/plugin:lightboxv2
+BuildRequires: js
 BuildRequires: sharutils
+BuildRequires: shrinksafe
 Requires:      dokuwiki >= 20061106
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -31,6 +34,7 @@ Plugin to integrate LightBox v2 javascript animation in DokuWiki.
        cat js/lightbox.js
 ) > script.js
 %patch0 -p1
+%patch1 -p1
 uudecode blank.gif.uue
 
 rm -f images/bullet.gif
@@ -39,6 +43,19 @@ rm -f images/download-icon.gif
 rm -f images/image-1.jpg
 rm -f images/thumb-1.jpg
 
+%build
+js_compress() {
+       for a in "$@"; do
+               # compress
+               shrinksafe -c script.js > $a.tmp && mv $a.tmp script.js
+               # trim newlines
+               tr -d '\r\n' < script.js > $a.tmp && mv $a.tmp script.js
+               # check syntax
+               js -C -f script.js
+       done
+}
+#js_compress script.js
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{plugindir}
This page took 0.096248 seconds and 4 git commands to generate.