summaryrefslogtreecommitdiffstats
path: root/rubygem-closure-compiler.spec
blob: 77836768bbeba623e697bed822388bb85a31fa6e (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
89
90
91
92
93
94
95
96
# Generated from closure-compiler-1.1.1.gem by gem2rpm -*- rpm-spec -*-
%global gemname closure-compiler

%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
%global rubyabi 1.8

%global testdir %{_tmppath}/%{gemname}-%{version}

Summary: Ruby Wrapper for the Google Closure Compiler
Name: rubygem-%{gemname}
Version: 1.1.1
Release: 1%{?dist}
Group: Development/Languages
License: ASL 2.0
URL: http://github.com/documentcloud/closure-compiler/
Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem
# git clone https://github.com/documentcloud/closure-compiler.git && cd closure-compiler && git checkout 1.1.1
# tar czvf closure-compiler-1.1.1-tests.tgz test/
Source1: %{gemname}-%{version}-tests.tgz
Requires: ruby(abi) = %{rubyabi}
Requires: ruby(rubygems)
Requires: ruby
# TODO: Add runtime dependency on closure-compiler java package
BuildRequires: ruby(abi) = %{rubyabi}
BuildRequires: ruby(rubygems)
BuildRequires: ruby
# TODO: Replace with dependency on closure-compiler java package
BuildRequires: java >= 1:1.6.0
BuildArch: noarch
Provides: rubygem(%{gemname}) = %{version}

%description
A Ruby Wrapper for the Google Closure Compiler.


%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}


%prep
%setup -q -c -T
mkdir -p .%{gemdir}
gem install --local --install-dir .%{gemdir} \
            --force %{SOURCE0}

%build

%install
mkdir -p %{buildroot}%{gemdir}
cp -a .%{gemdir}/* \
        %{buildroot}%{gemdir}/

# TODO: Uncomment when closure-compiller java package is available.

#sed -i -e "s|COMPILER_JAR      = File.join(COMPILER_ROOT|COMPILER_JAR      = File.join('%{_javadir}'|" \
#    %{buildroot}%{geminstdir}/lib/closure-compiler.rb

# TODO: COMPILER_JAR and COMPILER_VERSION will be necessary to change as well.

%check
rm -rf %{testdir}
mkdir %{testdir}
tar xzvf %{SOURCE1} -C %{testdir}
pushd %{testdir}

# ruby -rubygems -I%{buildroot}%{geminstdir}/lib -Itest -e "Dir.glob('test/**/*_test.rb').each {|t| require t}"
testrb -I%{buildroot}%{geminstdir}:test test/

popd
rm -rf %{testdir}

%files
%dir %{geminstdir}
%{geminstdir}/COPYING
%{geminstdir}/LICENSE
%exclude %{geminstdir}/closure-compiler.gemspec
%exclude %{geminstdir}/lib/*.jar
%{geminstdir}/lib
%{gemdir}/cache/%{gemname}-%{version}.gem
%{gemdir}/specifications/%{gemname}-%{version}.gemspec

%files doc
%doc %{geminstdir}/README.textile
%doc %{gemdir}/doc/%{gemname}-%{version}


%changelog
* Tue Jul 26 2011 Vít Ondruch <vondruch@redhat.com> - 1.1.1-1
- Initial package