+# NOTE:
+# - check release notes from here https://code.google.com/p/closure-compiler/wiki/Releases
# TODO
-# - build from source
-# - NOTE: build-data.properties is included twice in .jar
+# - build from source (get-source.sh fetches it)
%include /usr/lib/rpm/macros.java
Summary: Closure Compiler - JavaScript compressor
Name: closure-compiler
-Version: 20100201
-Release: 0.1
+Version: 20130722
+Release: 1
License: Apache v2.0
Group: Applications/WWW
+# Source0Download: https://code.google.com/p/closure-compiler/downloads/list
Source0: http://closure-compiler.googlecode.com/files/compiler-%{version}.tar.gz
-# Source0-md5: 71bb4f8975ffc81fd0b9a82e18318a49
+# Source0-md5: 8d8f3f3d429742ca7fd7bfa9e164d8b5
Source1: %{name}.sh
+Source2: get-source.sh
+Source4: Changes
URL: http://closure-compiler.appspot.com/
BuildRequires: rpm-javaprov
BuildRequires: rpmbuild(macros) >= 1.300
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-Closure Compiler is a JavaScript optimizing compiler. It parses your
-JavaScript, analyzes it, removes dead code and rewrites and minimizes
-what's left. It also checks syntax, variable references, and types,
-and warns about common JavaScript pitfalls. It is used in many of
-Google's JavaScript apps, including Gmail, Google Web Search, Google
-Maps, and Google Docs.
+The Closure Compiler is a tool for making JavaScript download and run
+faster. It is a true compiler for JavaScript. Instead of compiling
+from a source language to machine code, it compiles from JavaScript to
+better JavaScript. It parses your JavaScript, analyzes it, removes
+dead code and rewrites and minimizes what's left. It also checks
+syntax, variable references, and types, and warns about common
+JavaScript pitfalls.
%prep
%setup -qc
+cp -p %{SOURCE4} .
%install
rm -rf $RPM_BUILD_ROOT
install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}
# jars
-cp -a compiler.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
+cp -p compiler.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
%clean
%files
%defattr(644,root,root,755)
-%doc README
+%doc README Changes
%attr(755,root,root) %{_bindir}/%{name}
%{_javadir}/*.jar