1 |
%global git_commit 9555cb9 |
2 |
%global cluster jruby |
3 |
|
4 |
# Prevent brp-java-repack-jars from being run. |
5 |
%define __jar_repack %{nil} |
6 |
%define with_maven 1 |
7 |
Name: jnr-posix |
8 |
Version: 1.1.7 |
9 |
Release: %mkrel 1 |
10 |
Summary: Java Posix layer |
11 |
Group: Development/Java |
12 |
License: CPL,GPL,LGPL |
13 |
URL: http://github.com/%{cluster}/%{name} |
14 |
Source0: %{url}/tarball/%{version}/%{cluster}-%{name}-%{version}-0-g%{git_commit}.tar.gz |
15 |
Patch0: jnr-posix-1.1.7-remove-wagon-webdav.patch |
16 |
BuildArch: noarch |
17 |
|
18 |
%if !%with_maven |
19 |
BuildRequires: ant |
20 |
BuildRequires: jffi |
21 |
BuildRequires: junit4 |
22 |
BuildRequires: objectweb-asm = 3.2 |
23 |
%else |
24 |
BuildRequires: maven |
25 |
BuildRequires: maven-compiler-plugin |
26 |
BuildRequires: maven-jar-plugin |
27 |
BuildRequires: maven-javadoc-plugin |
28 |
%endif |
29 |
BuildRequires: jaffl |
30 |
BuildRequires: java-devel |
31 |
BuildRequires: jnr-constants |
32 |
BuildRequires: jpackage-utils |
33 |
|
34 |
Requires: jaffl |
35 |
Requires: java-devel |
36 |
Requires: jnr-constants |
37 |
Requires: jpackage-utils |
38 |
|
39 |
%description |
40 |
jnr-posix is a lightweight cross-platform POSIX emulation layer for Java, |
41 |
written in Java and is part of the JNR project (http://jnr.kenai.com). |
42 |
|
43 |
%package javadoc |
44 |
Group: Development/Java |
45 |
Summary: Javadoc for %{name} |
46 |
|
47 |
%description javadoc |
48 |
Common cross-project/cross-platform POSIX APIs. |
49 |
|
50 |
This package contains javadoc for %{name}. |
51 |
|
52 |
%prep |
53 |
%setup -q -n %{cluster}-%{name}-%{git_commit} |
54 |
|
55 |
%patch0 -p0 |
56 |
find -name '*.class' -exec rm -f '{}' \; |
57 |
find -name '*.jar' -exec rm -f '{}' \; |
58 |
|
59 |
%if !%with_maven |
60 |
# TODO |
61 |
%endif |
62 |
|
63 |
%build |
64 |
|
65 |
%if %with_maven |
66 |
export MAVEN_REPO_LOCAL=$PWD/.m2/repository |
67 |
mkdir -p $MAVEN_REPO_LOCAL |
68 |
|
69 |
mvn-jpp \ |
70 |
install:install-file \ |
71 |
-DgroupId=org.jruby.extras \ |
72 |
-DartifactId=jffi \ |
73 |
-Dversion=1.0.6 \ |
74 |
-Dclassifier=native \ |
75 |
-Dpackaging=jar \ |
76 |
-Dfile=$(build-classpath jffi) \ |
77 |
-Dmaven.repo.local=$MAVEN_REPO_LOCAL |
78 |
|
79 |
mvn-jpp \ |
80 |
install:install-file \ |
81 |
-DgroupId=org.jruby.extras \ |
82 |
-DartifactId=jffi \ |
83 |
-Dversion=1.0.6 \ |
84 |
-Dpackaging=jar \ |
85 |
-Dfile=$(build-classpath jffi) \ |
86 |
-Dmaven.repo.local=$MAVEN_REPO_LOCAL |
87 |
|
88 |
mvn-jpp \ |
89 |
install:install-file \ |
90 |
-DgroupId=org.jruby.extras \ |
91 |
-DartifactId=constantine \ |
92 |
-Dversion=0.7 \ |
93 |
-Dpackaging=jar \ |
94 |
-Dfile=$(build-classpath jnr-constants) \ |
95 |
-Dmaven.repo.local=$MAVEN_REPO_LOCAL |
96 |
|
97 |
mvn-jpp \ |
98 |
-e \ |
99 |
-Dmaven2.jpp.mode=true \ |
100 |
-Dmaven.test.skip=true \ |
101 |
-Dmaven.repo.local=$MAVEN_REPO_LOCAL \ |
102 |
install javadoc:javadoc |
103 |
|
104 |
%else |
105 |
|
106 |
# TODO |
107 |
|
108 |
%endif |
109 |
|
110 |
%install |
111 |
%__mkdir_p %{buildroot}%{_javadir} |
112 |
|
113 |
%if %with_maven |
114 |
%__cp -p target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar |
115 |
%else |
116 |
%__cp -p dist/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar |
117 |
%endif |
118 |
|
119 |
pushd %{buildroot}%{_javadir}/ |
120 |
%__ln_s %{name}-%{version}.jar %{name}.jar |
121 |
popd |
122 |
|
123 |
mkdir -p %{buildroot}%{_mavenpomdir} |
124 |
%add_to_maven_depmap org.jruby.ext.posix jnr-posix %{version} JPP jnr-posix |
125 |
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-jnr-posix.pom |
126 |
|
127 |
mkdir -p %{buildroot}%{_javadocdir}/jnr-posix-%{version} |
128 |
%if %with_maven |
129 |
cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/jnr-posix-%{version} |
130 |
%else |
131 |
cp -rp dist/javadoc/* %{buildroot}%{_javadir}/%{name}-%{version}.jar |
132 |
%endif |
133 |
ln -s jnr-posix-%{version} %{buildroot}%{_javadocdir}/jnr-posix |
134 |
|
135 |
%post |
136 |
%update_maven_depmap |
137 |
|
138 |
%postun |
139 |
%update_maven_depmap |
140 |
|
141 |
%files |
142 |
%{_javadir}/* |
143 |
%{_mavenpomdir}/* |
144 |
%{_mavendepmapfragdir}/* |
145 |
%doc LICENSE.txt README.txt |
146 |
|
147 |
%files javadoc |
148 |
%{_javadocdir}/jnr-posix-%{version} |
149 |
%{_javadocdir}/jnr-posix |
150 |
|