diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..0f92cc0
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/maven-build.properties b/maven-build.properties
new file mode 100644
index 0000000..0243911
--- /dev/null
+++ b/maven-build.properties
@@ -0,0 +1,34 @@
+#Generated by Maven Ant Plugin - DO NOT EDIT THIS FILE!
+#Fri Jan 05 18:12:39 CET 2018
+maven.settings.offline=true
+voms-api-java.version=3.0.6
+maven.build.finalName=voms-clients-3.0.7
+commons-cli.version=1.2
+plugin.license.version=1.9.0
+maven.build.resourceDir.0=src/main/resources
+maven.build.testOutputDir=${maven.build.dir}/test-classes
+maven.build.testResourceDir.0=src/test/resources
+maven.reporting.outputDirectory=${maven.build.dir}/site
+plugin.compiler.version=3.1
+commons-io.version=2.0.1
+plugin.javadoc.version=2.9.1
+project.build.sourceEncoding=UTF-8
+maven.build.srcDir.0=src/main/java
+plugin.assembly.version=2.4.1
+junit.version=4.10
+project.build.directory=${maven.build.dir}
+maven.test.reports=${maven.build.dir}/test-reports
+maven.build.dir=target
+plugin.jar.version=2.5
+project.build.outputDirectory=${maven.build.outputDir}
+plugin.nexus-staging.version=1.6.3
+plugin.source.version=2.2.1
+plugin.release.version=2.2.2
+project.reporting.outputEncoding=UTF-8
+voms-clients.libs=
+maven.build.testDir.0=src/test/java
+maven.settings.interactiveMode=true
+plugin.gpg.version=1.5
+maven.repo.local=${user.home}/.m2/repository
+plugin.deploy.version=2.8.2
+maven.build.outputDir=${maven.build.dir}/classes
diff --git a/maven-build.xml b/maven-build.xml
new file mode 100644
index 0000000..5fca40a
--- /dev/null
+++ b/maven-build.xml
@@ -0,0 +1,305 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ =================================== WARNING ===================================
+ JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed.
+ ===============================================================================
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/voms-clients-java.spec b/voms-clients-java.spec
index 67f5435..9aa0021 100644
--- a/voms-clients-java.spec
+++ b/voms-clients-java.spec
@@ -6,17 +6,31 @@ Summary: Virtual Organization Membership Service Java clients
License: ASL 2.0
URL: https://wiki.italiangrid.it/VOMS
Source0: https://github.com/italiangrid/voms-clients/archive/v%{version}.tar.gz
+# These are build instructions for ant generated from the maven
+# build instructions using the maven ant plugin.
+# These are used for building on EPEL 6 since there is no maven
+# available there.
+Source1: build.xml
+Source2: maven-build.xml
+Source3: maven-build.properties
# Uncaught exception (backport from upstream)
Patch0: %{name}-except.patch
# Adapt to canl-java 2.5
Patch1: %{name}-canl-2.5.patch
BuildArch: noarch
-BuildRequires: maven-local
-BuildRequires: mvn(commons-cli:commons-cli)
-BuildRequires: mvn(commons-io:commons-io)
-BuildRequires: mvn(org.italiangrid:voms-api-java)
+BuildRequires: java-devel >= 1:1.6
+BuildRequires: jpackage-utils
+BuildRequires: ant
+BuildRequires: ant-junit
+BuildRequires: jakarta-commons-cli
+BuildRequires: jakarta-commons-io
+BuildRequires: junit4
BuildRequires: voms-api-java >= 3.2.0-5
+Requires: java >= 1:1.6
+Requires: jpackage-utils
+Requires: jakarta-commons-cli
+Requires: jakarta-commons-io
Requires: voms-api-java >= 3.2.0-5
Requires(post): %{_sbindir}/update-alternatives
@@ -42,42 +56,43 @@ voms-proxy-init, voms-proxy-destroy and voms-proxy-info.
%setup -q -n voms-clients-%{version}
%patch0 -p1
%patch1 -p1
-
-# Do not create source jars
-%pom_remove_plugin org.apache.maven.plugins:maven-source-plugin
-
-# Don't do assembly
-%pom_remove_plugin :maven-assembly-plugin
-
-# Remove license plugin
-%pom_remove_plugin com.mycila.maven-license-plugin:maven-license-plugin
+cp -p %{SOURCE1} .
+cp -p %{SOURCE2} .
+cp -p %{SOURCE3} .
%build
-%mvn_build -j
+export CLASSPATH=$(build-classpath voms-api-java canl bcpkix bcprov commons-cli commons-io junit4)
+%ant -Dbuild.sysclasspath=last package
%install
-%mvn_install
+mkdir -p %{buildroot}%{_javadir}
+install -m 644 target/voms-clients-%{version}.jar \
+ %{buildroot}%{_javadir}/voms-clients.jar
+
+mkdir -p %{buildroot}%{_mavenpomdir}
+install -p -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-voms-clients.pom
+%add_to_maven_depmap org.italiangrid voms-clients %{version} JPP voms-clients
mkdir -p %{buildroot}%{_bindir}
cat > %{buildroot}%{_bindir}/voms-proxy-init3 << EOF
#!/bin/sh
VOMS_CLIENTS_JAVA_OPTIONS=\${VOMS_CLIENTS_JAVA_OPTIONS:-"-XX:+UseSerialGC -Xmx16m"}
-java \$VOMS_CLIENTS_JAVA_OPTIONS -cp \$(build-classpath voms-clients-java voms-api-java canl-java bcpkix bcprov commons-cli commons-io) org.italiangrid.voms.clients.VomsProxyInit "\$@"
+java \$VOMS_CLIENTS_JAVA_OPTIONS -cp \$(build-classpath voms-clients voms-api-java canl bcpkix bcprov commons-cli commons-io) org.italiangrid.voms.clients.VomsProxyInit "\$@"
EOF
chmod 755 %{buildroot}%{_bindir}/voms-proxy-init3
cat > %{buildroot}%{_bindir}/voms-proxy-info3 << EOF
#!/bin/sh
VOMS_CLIENTS_JAVA_OPTIONS=\${VOMS_CLIENTS_JAVA_OPTIONS:-"-XX:+UseSerialGC -Xmx16m"}
-java \$VOMS_CLIENTS_JAVA_OPTIONS -cp \$(build-classpath voms-clients-java voms-api-java canl-java bcpkix bcprov commons-cli commons-io) org.italiangrid.voms.clients.VomsProxyInfo "\$@"
+java \$VOMS_CLIENTS_JAVA_OPTIONS -cp \$(build-classpath voms-clients voms-api-java canl bcpkix bcprov commons-cli commons-io) org.italiangrid.voms.clients.VomsProxyInfo "\$@"
EOF
chmod 755 %{buildroot}%{_bindir}/voms-proxy-info3
cat > %{buildroot}%{_bindir}/voms-proxy-destroy3 << EOF
#!/bin/sh
VOMS_CLIENTS_JAVA_OPTIONS=\${VOMS_CLIENTS_JAVA_OPTIONS:-"-XX:+UseSerialGC -Xmx16m"}
-java \$VOMS_CLIENTS_JAVA_OPTIONS -cp \$(build-classpath voms-clients-java voms-api-java canl-java bcpkix bcprov commons-cli commons-io) org.italiangrid.voms.clients.VomsProxyDestroy "\$@"
+java \$VOMS_CLIENTS_JAVA_OPTIONS -cp \$(build-classpath voms-clients voms-api-java canl bcpkix bcprov commons-cli commons-io) org.italiangrid.voms.clients.VomsProxyDestroy "\$@"
EOF
chmod 755 %{buildroot}%{_bindir}/voms-proxy-destroy3
@@ -105,6 +120,7 @@ install -p -m 644 man/vomsdir.5 %{buildroot}%{_mandir}/man5/vomsdir.5
install -p -m 644 man/vomses.5 %{buildroot}%{_mandir}/man5/vomses.5
%post
+%update_maven_depmap
%{_sbindir}/update-alternatives --install %{_bindir}/voms-proxy-init \
voms-proxy-init %{_bindir}/voms-proxy-init3 90 \
--slave %{_mandir}/man1/voms-proxy-init.1.gz voms-proxy-init-man \
@@ -119,6 +135,7 @@ install -p -m 644 man/vomses.5 %{buildroot}%{_mandir}/man5/vomses.5
%{_mandir}/man1/voms-proxy-destroy3.1.gz
%postun
+%update_maven_depmap
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove voms-proxy-init \
%{_bindir}/voms-proxy-init3
@@ -128,8 +145,10 @@ if [ $1 -eq 0 ] ; then
%{_bindir}/voms-proxy-destroy3
fi
-%files -f .mfiles
-%dir %{_javadir}/%{name}
+%files
+%{_javadir}/voms-clients.jar
+%{_mavenpomdir}/JPP-voms-clients.pom
+%{_mavendepmapfragdir}/%{name}
%{_bindir}/voms-proxy-destroy3
%{_bindir}/voms-proxy-info3
%{_bindir}/voms-proxy-init3
@@ -150,6 +169,7 @@ fi
%changelog
* Fri Jan 05 2018 Mattias Ellert - 3.0.7-5
- Adapt to canl-java 2.5
+- Create EPEL 6 package using the maven ant plugin
* Tue Aug 08 2017 Mattias Ellert - 3.0.7-4
- Don't do assembly