Fix Maven artifact installation
- Resolves: rhbz#1358134
This commit is contained in:
parent
367f2e7252
commit
1b1f0eaad2
@ -56,9 +56,6 @@ URL: http://jdbc.postgresql.org/
|
|||||||
Source0: https://github.com/pgjdbc/pgjdbc/archive/REL%version.tar.gz
|
Source0: https://github.com/pgjdbc/pgjdbc/archive/REL%version.tar.gz
|
||||||
Source1: postgres-testing.sh
|
Source1: postgres-testing.sh
|
||||||
|
|
||||||
Provides: mvn(org.postgresql:postgresql)
|
|
||||||
Provides: mvn(postgresql:postgresql)
|
|
||||||
|
|
||||||
# Upstream moved parent pom.xml into separate project (even though there is only
|
# Upstream moved parent pom.xml into separate project (even though there is only
|
||||||
# one dependant project on it?). Let's try to not complicate packaging by
|
# one dependant project on it?). Let's try to not complicate packaging by
|
||||||
# having separate spec file for it, too.
|
# having separate spec file for it, too.
|
||||||
@ -118,15 +115,16 @@ find -name "*.jar" -or -name "*.class" | xargs rm -f
|
|||||||
|
|
||||||
%pom_disable_module ubenchmark
|
%pom_disable_module ubenchmark
|
||||||
|
|
||||||
# Hack #0! For upstream it is to some extent important to have the parent-poms
|
# Build parent POMs in the same Maven call.
|
||||||
# project separated. Having it like that on downstream level does not help at
|
%pom_xpath_inject pom:modules "<module>%parent_poms_builddir</module>"
|
||||||
# all. Note that we have to revert this patch before we do the installation.
|
%pom_xpath_inject pom:parent "<relativePath>pgjdbc-parent-poms/pgjdbc-versions</relativePath>"
|
||||||
sed -i.hack-parent-poms \
|
%pom_xpath_set pom:relativePath ../pgjdbc-parent-poms/pgjdbc-core-parent pgjdbc
|
||||||
's!<relativePath />!<relativePath>../pgjdbc-parent-poms/pgjdbc-core-parent/pom.xml</relativePath>!' \
|
|
||||||
pgjdbc/pom.xml
|
# Parent POMs should be installed in a separate subpackage.
|
||||||
sed -i.hack-parent-poms \
|
%mvn_package ":*{parent,versions,prevjre}*" parent-poms
|
||||||
'/<artifactId>pgjdbc-versions/a <relativePath>pgjdbc-parent-poms/pgjdbc-versions/pom.xml</relativePath>' \
|
|
||||||
pom.xml
|
# For compat reasons, make Maven artifact available under older coordinates.
|
||||||
|
%mvn_alias org.postgresql:postgresql postgresql:postgresql
|
||||||
|
|
||||||
# Hack #1! This directory is missing for some reason, it is most probably some
|
# Hack #1! This directory is missing for some reason, it is most probably some
|
||||||
# misunderstanding between maven, maven-compiler-plugin and
|
# misunderstanding between maven, maven-compiler-plugin and
|
||||||
@ -164,29 +162,15 @@ EOF
|
|||||||
pgtests_start
|
pgtests_start
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# First "build" the parent-poms ..
|
|
||||||
cd %parent_poms_builddir
|
|
||||||
%mvn_build -- %pgjdbc_mvn_options
|
|
||||||
cd ..
|
|
||||||
# .. and then build pgjdbc.
|
|
||||||
|
|
||||||
%if %runselftest
|
%if %runselftest
|
||||||
%mvn_build -- %pgjdbc_mvn_options
|
%mvn_build -- %pgjdbc_mvn_options
|
||||||
%else
|
%else
|
||||||
%mvn_build -- %pgjdbc_mvn_options -Dmaven.test.skip=true
|
%mvn_build -- %pgjdbc_mvn_options -Dmaven.test.skip=true
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Hack #0! Revert the patch above.
|
|
||||||
for i in `find -name '*.hack-parent-poms'`
|
|
||||||
do
|
|
||||||
mv $i ${i%%%%.hack-parent-poms}
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%mvn_install
|
%mvn_install
|
||||||
cd %parent_poms_builddir
|
|
||||||
%mvn_install
|
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@ -196,7 +180,7 @@ cd %parent_poms_builddir
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
|
|
||||||
%files parent-poms -f %parent_poms_builddir/.mfiles
|
%files parent-poms -f .mfiles-parent-poms
|
||||||
|
|
||||||
%files javadoc
|
%files javadoc
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
Loading…
Reference in New Issue
Block a user