blob: c6ac784ddb0a7096227891a84b0514b715efe96f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# TODO
# - use rhino from PLD package
# - do not embed jargs into yuicompressor.jar
#
# Conditional build:
%bcond_without tests # don't build and run tests
%include /usr/lib/rpm/macros.java
Summary: YUI Compressor - JavaScript compressor
Summary(pl.UTF-8): Narzędzie do kompresji kodu JavaScript
Name: yuicompressor
Version: 2.4.8
Release: 1
License: BSD
Group: Applications/WWW
Source0: https://github.com/yui/yuicompressor/archive/v%{version}/%{name}-%{version}.tar.gz
# Source0-md5: a5a0b0d3c99e0a52e24a1da1560560eb
Source1: %{name}.sh
URL: http://yui.github.io/yuicompressor/
BuildRequires: ant
BuildRequires: java-jargs
BuildRequires: jdk >= 1.4
BuildRequires: rpm-javaprov
BuildRequires: rpmbuild(macros) >= 1.300
%if %{with tests}
BuildRequires: bash
%endif
Requires: jpackage-utils
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
The YUI Compressor is a JavaScript/CSS minifier.
Its level of compaction is higher than the Dojo compressor, and it is
as safe as JSMin.
Tests on the YUI library have shown savings of about 18% compared to
JSMin and 10% compared to the Dojo compressor (these respectively
become 10% and 5% after HTTP compression)
%description -l pl.UTF-8
YUI Compressor jest narzędziem do kompresji kodu JavaScript.
Poziom kompresji osiągany przez YUI Compressor jest większy niż w
przypadku Dojo compressor przy czym jest nie mniej bezpieczny niż
JSMin.
Testy wykonane na bibliotece YUI wykazały, że 18% zysk względem JSMin
i 10% zysk względem Dojo Compressor (odpowiednio 10% i 5% po kompresji
HTTP).
%prep
%setup -q
rm -rf build
# Do not remove lib/rhino-1.6R7.jar It does not work with our java-rhino-1.7
rm lib/jargs-1.0.jar
chmod a+x tests/suite.sh
%build
JARGS_JAR=$(find-jar jargs)
ln -sf $JARGS_JAR lib/jargs-1.0.jar
required_jars='jargs'
CLASSPATH=$(build-classpath $required_jars)
%ant -Dbuild.sysclasspath=first
%if %{with tests}
./tests/suite.sh
%endif
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_bindir},%{_javadir}}
install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}
cp -p build/yuicompressor-%{version}.jar $RPM_BUILD_ROOT%{_javadir}
ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc LICENSE.TXT doc/*
%attr(755,root,root) %{_bindir}/%{name}
%{_javadir}/*.jar
|