File closure.spec of Package closure

#
# spec file for package closure.spec
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# NOTE: this spec currently just packages the pre-compiled .jar file into an
# RPM. The full build process requires maven.

Name:           closure
Version:        20190929
Release:        0
Summary:        JavaScript compiler to compress, optimize, find mistakes in code
License:        Apache-2.0
Group:          Development/Tools
Url:            https://developers.google.com/closure/compiler/docs/gettingstarted_app
Source:         closure-compiler-latest.zip
BuildRequires:  pkgconfig
BuildRequires:  unzip
Requires:       jre-headless >= 8
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The Closure Compiler application is a Java-based command-line utility that compresses, optimizes, and looks for mistakes in your JavaScript.

%prep
%setup -q -c -n closure-compiler-latest

%build


%install
install -dm0755 %{buildroot}%{_libdir}
mv closure-compiler-v%{version}.jar %{buildroot}%{_libdir}
install -dm0755 %{buildroot}%{_bindir}
echo -e '#!/bin/sh\njava -jar %{_libdir}/closure-compiler-v%{version}.jar "$@"' > %{buildroot}%{_bindir}/%{name}
chmod 0755 %{buildroot}%{_bindir}/%{name}

%files
%defattr(-,root,root)
%doc README.md COPYING
%{_libdir}/closure-compiler-v%{version}.jar
%{_bindir}/closure


%changelog