1 |
%define with_jansi 1 |
2 |
Name: groovy18 |
3 |
Version: 1.8.6 |
4 |
Release: %mkrel 1 |
5 |
Summary: Dynamic language for the Java Platform |
6 |
|
7 |
Group: Development/Java |
8 |
License: ASL 2.0 |
9 |
URL: http://groovy.codehaus.org/ |
10 |
Source0: http://dist.groovy.codehaus.org/distributions/groovy-src-%{version}.zip |
11 |
Source1: groovy18-script |
12 |
Source2: groovy18-starter.conf |
13 |
Source3: groovy18.desktop |
14 |
Patch1: groovy-1.8.1-nojansi.patch |
15 |
# remove unavailable deps |
16 |
# org.codehaus.gpars gpars 0.11 https://github.com/GPars |
17 |
# change version for |
18 |
# junit 4.10 |
19 |
# xstream 1.4.1 |
20 |
# jansi 1.7 |
21 |
Patch2: groovy-1.8.3-pom.patch |
22 |
Patch3: groovy-1.8.3-antbuild.patch |
23 |
Patch4: groovy-1.8.3-skipOsgi.patch |
24 |
|
25 |
BuildArch: noarch |
26 |
|
27 |
BuildRequires: ant |
28 |
BuildRequires: antlr |
29 |
BuildRequires: ant-antlr |
30 |
BuildRequires: ant-junit |
31 |
#BuildRequires: ant-testutil |
32 |
BuildRequires: objectweb-asm |
33 |
BuildRequires: bsf |
34 |
BuildRequires: apache-ivy |
35 |
|
36 |
BuildRequires: jline |
37 |
BuildRequires: jsp21 |
38 |
BuildRequires: junit |
39 |
BuildRequires: servlet25 |
40 |
BuildRequires: xstream |
41 |
BuildRequires: java-devel >= 1.6 |
42 |
BuildRequires: desktop-file-utils |
43 |
BuildRequires: jpackage-utils |
44 |
BuildRequires: apache-commons-cli |
45 |
|
46 |
BuildRequires: aqute-bnd |
47 |
BuildRequires: apache-commons-beanutils |
48 |
BuildRequires: apache-commons-lang |
49 |
BuildRequires: apache-commons-logging |
50 |
%if %with_jansi |
51 |
BuildRequires: jansi |
52 |
%endif |
53 |
BuildRequires: livetribe-jsr223 |
54 |
BuildRequires: mockobjects |
55 |
BuildRequires: qdox |
56 |
BuildRequires: jarjar |
57 |
|
58 |
BuildRequires: unzip |
59 |
Requires: jpackage-utils |
60 |
|
61 |
# The are all runtime dependencies of the script |
62 |
# TODO: Think of splitting them into a separate subpackage |
63 |
Requires: ant |
64 |
Requires: ant-antlr |
65 |
Requires: ant-junit |
66 |
Requires: antlr-tool |
67 |
Requires: objectweb-asm |
68 |
Requires: bsf |
69 |
Requires: apache-commons-cli |
70 |
Requires: apache-commons-logging |
71 |
Requires: apache-ivy |
72 |
Requires: jline |
73 |
Requires: jsp21 |
74 |
Requires: junit |
75 |
Requires: servlet25 |
76 |
Requires: xstream |
77 |
%if %with_jansi |
78 |
Requires: jansi |
79 |
%endif |
80 |
Requires: jarjar |
81 |
Requires: livetribe-jsr223 |
82 |
Requires: mockobjects |
83 |
Requires: qdox |
84 |
|
85 |
|
86 |
%description |
87 |
Groovy is an agile and dynamic language for the Java Virtual Machine, |
88 |
built upon Java with features inspired by languages like Python, Ruby and |
89 |
Smalltalk. It seamlessly integrates with all existing Java objects and |
90 |
libraries and compiles straight to Java bytecode so you can use it anywhere |
91 |
you can use Java. |
92 |
|
93 |
|
94 |
%package javadoc |
95 |
Summary: API Documentation for %{name} |
96 |
Group: Development/Java |
97 |
Requires: %{name} = %{version}-%{release} |
98 |
Requires: jpackage-utils |
99 |
|
100 |
%description javadoc |
101 |
JavaDoc documentation for %{name} |
102 |
|
103 |
%prep |
104 |
%setup -q -n groovy-%{version} |
105 |
|
106 |
#%if !%with_jansi |
107 |
#%patch1 -p1 -b .jansi |
108 |
#%endif |
109 |
%patch2 -p0 |
110 |
%patch3 -p1 |
111 |
%patch4 -p0 |
112 |
|
113 |
sed -i "s|/usr/share/java/aqute-bndlib.jar|/usr/share/java/aqute-bnd.jar|" build.xml |
114 |
|
115 |
find -name '*.class' -exec rm -f '{}' \; |
116 |
find -name '*.jar' -exec rm -f '{}' \; |
117 |
|
118 |
%build |
119 |
|
120 |
mkdir -p target/lib/{compile,runtime,tools} |
121 |
# Construct classpath |
122 |
export CLASSPATH="" |
123 |
export JAVA_HOME=%_jvmdir/java-1.6.0 |
124 |
%if %with_jansi |
125 |
CLASSPATH=$CLASSPATH:$(build-classpath jansi) |
126 |
%endif |
127 |
CLASSPATH=$CLASSPATH:$(build-classpath antlr ant ant/ant-junit ant/ant-antlr ant-launcher servlet jsp bsf) |
128 |
CLASSPATH=$CLASSPATH:$(build-classpath commons-cli mockobjects-core qdox jarjar livetribe-jsr223 junit) |
129 |
CLASSPATH=$CLASSPATH:$(build-classpath log4j aqute-bndlib objectweb-asm commons-beanutils commons-beanutils-core) |
130 |
CLASSPATH=$CLASSPATH:$(build-classpath commons-lang commons-logging oro jline xstream ivy) |
131 |
|
132 |
# Build |
133 |
# TODO: Build at least tests, maybe examples |
134 |
ant -DskipTests=on -DskipExamples=on -DskipFetch=on \ |
135 |
createJars javadoc |
136 |
|
137 |
%install |
138 |
|
139 |
# Code |
140 |
install -d $RPM_BUILD_ROOT%{_javadir} |
141 |
install -p -m644 target/dist/groovy.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar |
142 |
install -p -m644 target/dist/groovy-all.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-all.jar |
143 |
# Startup scripts |
144 |
install -d $RPM_BUILD_ROOT%{_bindir} |
145 |
install -p -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/groovy18 |
146 |
%if %with_jansi |
147 |
sed -i 's|#BASE_JARS="$BASE_JARS jansi"|BASE_JARS="$BASE_JARS jansi"|' $RPM_BUILD_ROOT%{_bindir}/groovy18 |
148 |
%endif |
149 |
for TOOL in grape18 groovyc18 groovyConsole18 java2groovy18 groovysh18 |
150 |
do |
151 |
ln $RPM_BUILD_ROOT%{_bindir}/groovy18 \ |
152 |
$RPM_BUILD_ROOT%{_bindir}/$TOOL |
153 |
done |
154 |
|
155 |
# Configuration |
156 |
install -d $RPM_BUILD_ROOT%{_sysconfdir} |
157 |
install -p -m644 %{SOURCE2} \ |
158 |
$RPM_BUILD_ROOT%{_sysconfdir}/%{name}-starter.conf |
159 |
|
160 |
# Desktop icon |
161 |
install -d $RPM_BUILD_ROOT%{_datadir}/pixmaps |
162 |
install -d $RPM_BUILD_ROOT%{_datadir}/applications |
163 |
install -p -m644 src/main/groovy/ui/ConsoleIcon.png \ |
164 |
$RPM_BUILD_ROOT%{_datadir}/pixmaps/groovy.png |
165 |
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \ |
166 |
%{SOURCE3} |
167 |
|
168 |
# API Documentation |
169 |
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name} |
170 |
find target -type d |xargs chmod 755 |
171 |
cp -rp target/html/api/. $RPM_BUILD_ROOT%{_javadocdir}/%{name} |
172 |
|
173 |
# Maven depmap |
174 |
install -d $RPM_BUILD_ROOT%{_mavenpomdir} |
175 |
install -p -m644 pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP-%{name}.pom |
176 |
#dd_maven_depmap JPP-%{name}.pom %{name}.jar |
177 |
%add_to_maven_depmap org.codehaus.groovy %{name} %{version} JPP %{name} |
178 |
install -p -m644 target/groovy-all.pom $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP-%{name}-all.pom |
179 |
#dd_maven_depmap JPP-%{name}-all.pom %{name}-all.jar |
180 |
%add_to_maven_depmap org.codehaus.groovy %{name}-all %{version} JPP %{name}-all |
181 |
|
182 |
%files |
183 |
%defattr(-,root,root,-) |
184 |
%{_bindir}/* |
185 |
%{_javadir}/* |
186 |
%{_datadir}/pixmaps/* |
187 |
%{_datadir}/applications/* |
188 |
%{_mavendepmapfragdir}/%{name} |
189 |
%{_mavenpomdir}/JPP-%{name}*.pom |
190 |
%config(noreplace) %{_sysconfdir}/* |
191 |
%doc LICENSE.txt NOTICE.txt README.md |
192 |
|
193 |
%files javadoc |
194 |
%{_javadocdir}/%{name} |
195 |
|
196 |
%pre javadoc |
197 |
[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \ |
198 |
rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || : |
199 |
|
200 |
|