Compare commits

..

No commits in common. "rawhide" and "f42" have entirely different histories.

6 changed files with 44 additions and 83 deletions

4
.gitignore vendored
View file

@ -25,7 +25,3 @@
/postgresql-42.7.2-jdbc-src.tar.gz
/postgresql-42.7.3-jdbc-src.tar.gz
/postgresql-42.7.4-jdbc-src.tar.gz
/postgresql-42.7.5-jdbc-src.tar.gz
/postgresql-42.7.6-jdbc-src.tar.gz
/postgresql-42.7.7-jdbc-src.tar.gz
/postgresql-42.7.8-jdbc-src.tar.gz

View file

@ -1,7 +1,7 @@
summary: Run javapackages-specific tests
discover:
how: fmf
url: https://gitlab.com/redhat/centos-stream/tests/javapackages.git
url: https://src.fedoraproject.org/tests/javapackages
ref: main
execute:
how: tmt

View file

@ -1,10 +0,0 @@
summary: Basic smoke test
discover:
how: fmf
url: https://gitlab.com/redhat/centos-stream/tests/postgresql-jdbc.git
prepare:
how: install
package:
- java-21-openjdk-devel
execute:
how: tmt

View file

@ -48,22 +48,24 @@
Summary: JDBC driver for PostgreSQL
Name: postgresql-jdbc
Version: 42.7.8
Version: 42.7.4
Release: %autorelease
License: BSD-2-Clause
URL: https://jdbc.postgresql.org/
Source0: https://repo1.maven.org/maven2/org/postgresql/postgresql/%{version}/postgresql-%{version}-jdbc-src.tar.gz
Source1: postgresql_jdbc_tests_init.sh
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
Provides: pgjdbc = %{version}-%{release}
Provides: pgjdbc = %version-%release
BuildRequires: maven-local-openjdk25
BuildRequires: maven-local
BuildRequires: mvn(com.ongres.scram:scram-client)
BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-shade-plugin)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-api)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-engine)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-params)
BuildRequires: mvn(org.junit.vintage:junit-vintage-engine)
BuildRequires: mvn(se.jiderhamn:classloader-leak-test-framework)
%if %runselftest
BuildRequires: postgresql-contrib
@ -73,24 +75,18 @@ BuildRequires: postgresql-test-rpm-macros
# gettext is only needed if we try to update translations
# BuildRequires: gettext
# TODO Remove in Fedora 46
Obsoletes: %{name}-javadoc < 42.7.4-9
Provides: bundled(mvn(com.ongres.scram:scram-client)) = 3.2
Provides: bundled(mvn(com.ongres.scram:scram-common)) = 3.2
Provides: bundled(mvn(com.ongres.stringprep:saslprep)) = 2.2
Provides: bundled(mvn(com.ongres.stringprep:stringprep)) = 2.2
Obsoletes: %{name}-parent-poms < 42.2.2-2
%description
PostgreSQL is an advanced Object-Relational database management system. The
postgresql-jdbc package includes the .jar files needed for Java programs to
access a PostgreSQL database.
%package tests
Summary: Tests for %{name}
%package javadoc
Summary: API docs for %{name}
%description tests
This package contains tests for %{name}.
%description javadoc
This package contains the API Documentation for %{name}.
%prep
%autosetup -p1 -n postgresql-%{version}-jdbc-src
@ -98,6 +94,9 @@ This package contains tests for %{name}.
# remove any binary libs
find -type f \( -name "*.jar" -or -name "*.class" \) -delete
# Build parent POMs in the same Maven call.
%pom_remove_plugin :maven-shade-plugin
# compat symlink: requested by dtardon (libreoffice), reverts part of
# 0af97ce32de877 commit.
%mvn_file org.postgresql:postgresql %{name}/postgresql %{name} postgresql
@ -107,19 +106,13 @@ find -type f \( -name "*.jar" -or -name "*.class" \) -delete
# remove unmet dependency
%pom_remove_dep uk.org.webcompere:system-stubs-jupiter
# remove tests that depend on the system-stubs-jupiter
grep -l -r '^import uk\.org\.webcompere\.systemstubs' src/test | xargs rm -v
# Install -tests Jar as well
%pom_xpath_inject 'pom:build/pom:plugins/pom:plugin[pom:artifactId="maven-jar-plugin"]' '
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>'
%mvn_package org.postgresql:postgresql::tests: tests
# remove tests that depend on the system-stubs-jupiter
rm src/test/java/org/postgresql/test/jdbc2/DriverTest.java \
src/test/java/org/postgresql/util/OSUtilTest.java \
src/test/java/org/postgresql/jdbcurlresolver/PgServiceConfParserTest.java \
src/test/java/org/postgresql/jdbcurlresolver/PgPassParserTest.java \
src/test/java/org/postgresql/util/StubEnvironmentAndProperties.java
%build
# Ideally we would run "sh update-translations.sh" here, but that results
@ -130,35 +123,41 @@ grep -l -r '^import uk\.org\.webcompere\.systemstubs' src/test | xargs rm -v
# Include PostgreSQL testing methods and variables.
%if %runselftest
. %{SOURCE1}
setup_build_local_properties > build.local.properties
%postgresql_tests_init
PGTESTS_LOCALE=C.UTF-8
cat <<EOF > build.local.properties
server=localhost
port=$PGTESTS_PORT
database=test
username=test
password=test
privilegedUser=$PGTESTS_ADMIN
privilegedPassword=$PGTESTS_ADMINPASS
preparethreshold=5
loglevel=0
protocolVersion=0
EOF
# Start the local PG cluster.
%postgresql_tests_start
%else
# NOTE this parameter skips running tests but still compiles them
opts="-DskipTests=true"
# -f is equal to -Dmaven.test.skip=true
opts="-f"
%endif
%mvn_build -j -- $opts
xmvn --offline -Dmdep.outputFile=tests-classpath dependency:build-classpath
%mvn_build $opts --xmvn-javadoc
%install
%mvn_install
install -m 644 -D tests-classpath %{buildroot}%{_datadir}/%{name}-tests/classpath
install -m 644 -D -t %{buildroot}%{_datadir}/%{name}-tests build.properties ssltest.properties
cp -r -t %{buildroot}%{_datadir}/%{name}-tests certdir
install -m 755 -D -t %{buildroot}%{_libexecdir}/%{name}-tests %{SOURCE1}
%files -f .mfiles
%license LICENSE
%doc README.md
%files tests -f .mfiles-tests
%files javadoc -f .mfiles-javadoc
%license LICENSE
%{_datadir}/%{name}-tests
%{_libexecdir}/%{name}-tests
%changelog
%autochangelog

View file

@ -1,24 +0,0 @@
#!/usr/bin/bash
# Before running tests, source this file.
# Call the function `setup_build_local_properties` and redirect its output into
# the file `build.local.properties` and run the tests in the same directory.
. /usr/share/postgresql-setup/postgresql_pkg_tests.sh
PGTESTS_LOCALE=C.UTF-8
function setup_build_local_properties
{
cat << EOF
test.url.PGHOST=localhost
test.url.PGPORT=$PGTESTS_PORT
test.url.PGDBNAME=test
user=test
password=test
privilegedUser=$PGTESTS_ADMIN
privilegedPassword=$PGTESTS_ADMINPASS
preparethreshold=5
loglevel=0
EOF
}

View file

@ -1 +1 @@
SHA512 (postgresql-42.7.8-jdbc-src.tar.gz) = 4860f6446960ad4d38af28a3cd38cbc6bdd53d8acdd0c20cc3141df3e7a4b41aad67293f19aac6ae6d9da351b7e6379a0a02261d8bb188e1daae914f7ba0139f
SHA512 (postgresql-42.7.4-jdbc-src.tar.gz) = 3f864848d0b6b079daf8abecabb2bd8487fa8bc23ef9265bfa71c484b4ee3b38a76cc38af7a72ac3ac64fa26569952b9b69d08b3b8a115d44bee823151c6c292