|
|
7c70150 |
Name: yuicompressor
|
|
|
7c70150 |
Version: 2.4.8
|
|
|
69e91b5 |
Release: 2%{?dist}
|
|
|
7c70150 |
Summary: YUI Compressor - The Yahoo JavaScript and CSS Compressor
|
|
|
7c70150 |
|
|
|
7c70150 |
# Source 0 is BSD, Source 1 is MPLv1.1 or GPLv2+
|
|
|
7c70150 |
License: BSD and (MPLv1.1 or GPLv2+)
|
|
|
7c70150 |
URL: https://yui.github.com/%{name}/
|
|
|
7c70150 |
Source0: https://github.com/yui/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
|
7c70150 |
# The yuicompressor uses the javascript parser from rhino.
|
|
|
7c70150 |
# However, it calls private functions not exported by the
|
|
|
7c70150 |
# rhino jar, so it can not use the jar provided by the
|
|
|
7c70150 |
# distribution. The upstream source unjars a bundled copy of
|
|
|
7c70150 |
# the rhino jar and builds using its precompiled class files.
|
|
|
7c70150 |
# This violates the no precompiled sources guidelines. Only
|
|
|
7c70150 |
# part of the rhino source tree is used by yuicompressor. The
|
|
|
7c70150 |
# upstream sources also contains modified versions of a few
|
|
|
7c70150 |
# of the rhino sources. These changes are restored by patch 0.
|
|
|
7c70150 |
# Source 1 is a slimmed down version of the rhino sources of
|
|
|
7c70150 |
# the same version that is bundled in the upstream sources.
|
|
|
7c70150 |
# Source 2 is the script used to create Source 1.
|
|
|
7c70150 |
Source1: %{name}-rhino1_7R2.tar.gz
|
|
|
7c70150 |
Source2: %{name}-rhino.sh
|
|
|
7c70150 |
# Man page - copied from Debian
|
|
|
7c70150 |
Source3: %{name}.1
|
|
|
7c70150 |
# Pom file based on template from upstream:
|
|
|
7c70150 |
# https://github.com/yui/yuicompressor/raw/master/maven_central/template/pom.xml.template
|
|
|
7c70150 |
Source4: %{name}.pom
|
|
|
7c70150 |
# This patch restores yuicompressor's changes to the rhino
|
|
|
7c70150 |
# sources overwritten by Source 1
|
|
|
7c70150 |
Patch0: %{name}-rhino.patch
|
|
|
7c70150 |
# Remove references to prebuilt jars in build.xml
|
|
|
7c70150 |
Patch1: %{name}-remove-jars.patch
|
|
|
7c70150 |
# Fix test script - only test yuicompressor, not rhino
|
|
|
7c70150 |
Patch2: %{name}-tests.patch
|
|
|
7c70150 |
|
|
|
7c70150 |
BuildArch: noarch
|
|
|
7c70150 |
BuildRequires: ant
|
|
|
a11f8f6 |
BuildRequires: javapackages-local
|
|
|
6f5e23a |
BuildRequires: mvn(net.sf:jargs)
|
|
|
7c70150 |
Provides: bundled(rhino) = 1.7R2
|
|
|
7c70150 |
|
|
|
7c70150 |
%description
|
|
|
7c70150 |
The YUI Compressor is a JavaScript compressor which, in addition to
|
|
|
7c70150 |
removing comments and white-spaces, obfuscates local variables using
|
|
|
7c70150 |
the smallest possible variable name. This obfuscation is safe, even
|
|
|
7c70150 |
when using constructs such as 'eval' or 'with' (although the
|
|
|
7c70150 |
compression is not optimal in those cases) Compared to jsmin, the
|
|
|
7c70150 |
average savings is around 20%.
|
|
|
7c70150 |
|
|
|
7c70150 |
The YUI Compressor is also able to safely compress CSS files. The
|
|
|
7c70150 |
decision on which compressor is being used is made on the file
|
|
|
7c70150 |
extension (js or css).
|
|
|
7c70150 |
|
|
|
7c70150 |
%prep
|
|
|
7c70150 |
%setup -q -a 1
|
|
|
7c70150 |
%patch0 -p1
|
|
|
7c70150 |
%patch1 -p1
|
|
|
7c70150 |
%patch2 -p1
|
|
|
7c70150 |
# Remove prebuilt jars
|
|
|
7c70150 |
rm -rf lib/*
|
|
|
7c70150 |
ln -s $(build-classpath jargs) lib
|
|
|
7c70150 |
|
|
|
7c70150 |
%build
|
|
|
7c70150 |
%ant
|
|
|
7c70150 |
|
|
|
7c70150 |
%install
|
|
|
a11f8f6 |
%mvn_artifact %{SOURCE4} build/%{name}-%{version}.jar
|
|
|
a11f8f6 |
%mvn_install
|
|
|
7c70150 |
|
|
|
7c70150 |
%jpackage_script com.yahoo.platform.yui.compressor.Bootstrap "" "" jargs:%{name} %{name} true
|
|
|
7c70150 |
|
|
|
7c70150 |
mkdir -p %{buildroot}%{_mandir}/man1
|
|
|
7c70150 |
install -m 644 %{SOURCE3} %{buildroot}%{_mandir}/man1
|
|
|
7c70150 |
|
|
|
7c70150 |
%check
|
|
|
7c70150 |
tests/suite.sh
|
|
|
7c70150 |
|
|
|
6f5e23a |
%files -f .mfiles
|
|
|
7c70150 |
%{_bindir}/%{name}
|
|
|
7c70150 |
%doc %{_mandir}/man1/%{name}.1*
|
|
|
7c70150 |
%doc README.md doc/CHANGELOG
|
|
|
7c70150 |
%license LICENSE.TXT LICENSE.txt
|
|
|
7c70150 |
|
|
|
7c70150 |
%changelog
|
|
|
69e91b5 |
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.8-2
|
|
|
69e91b5 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
|
|
69e91b5 |
|
|
|
7c70150 |
* Tue Dec 05 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 2.4.8-1
|
|
|
7c70150 |
- Initial packaging for Fedora
|