Compare commits
18 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8eb5f89383 | ||
|
|
5aad0aad43 | ||
|
|
28dea36d4b | ||
|
|
dc561ead6d | ||
|
|
43e9f32dc7 | ||
|
|
259e83f2b6 | ||
|
|
04832d877e | ||
|
|
d42690c41d | ||
|
|
64c97d034b | ||
|
|
4fedbe33f7 | ||
|
|
c306c7f95e | ||
|
|
9b7b1c8c29 | ||
|
|
c4976a0dfa | ||
|
|
a5272931f1 | ||
|
|
19a840a099 | ||
|
|
404168fe36 | ||
|
|
ec34358b26 | ||
|
|
d4b3f61bb0 |
6 changed files with 83 additions and 44 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -25,3 +25,7 @@
|
|||
/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
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
summary: Run javapackages-specific tests
|
||||
discover:
|
||||
how: fmf
|
||||
url: https://src.fedoraproject.org/tests/javapackages
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/javapackages.git
|
||||
ref: main
|
||||
execute:
|
||||
how: tmt
|
||||
|
|
|
|||
10
plans/smoke.fmf
Normal file
10
plans/smoke.fmf
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
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
|
||||
|
|
@ -48,24 +48,22 @@
|
|||
|
||||
Summary: JDBC driver for PostgreSQL
|
||||
Name: postgresql-jdbc
|
||||
Version: 42.7.4
|
||||
Version: 42.7.8
|
||||
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
|
||||
BuildRequires: maven-local-openjdk25
|
||||
BuildRequires: mvn(com.ongres.scram:scram-client)
|
||||
BuildRequires: mvn(junit:junit)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-shade-plugin)
|
||||
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
|
||||
|
|
@ -75,18 +73,24 @@ BuildRequires: postgresql-test-rpm-macros
|
|||
# gettext is only needed if we try to update translations
|
||||
# BuildRequires: gettext
|
||||
|
||||
Obsoletes: %{name}-parent-poms < 42.2.2-2
|
||||
# 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
|
||||
|
||||
%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 javadoc
|
||||
Summary: API docs for %{name}
|
||||
%package tests
|
||||
Summary: Tests for %{name}
|
||||
|
||||
%description javadoc
|
||||
This package contains the API Documentation for %{name}.
|
||||
%description tests
|
||||
This package contains tests for %{name}.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n postgresql-%{version}-jdbc-src
|
||||
|
|
@ -94,9 +98,6 @@ This package contains the API Documentation 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
|
||||
|
|
@ -106,13 +107,19 @@ 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
|
||||
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
|
||||
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
|
||||
|
||||
%build
|
||||
# Ideally we would run "sh update-translations.sh" here, but that results
|
||||
|
|
@ -123,41 +130,35 @@ rm src/test/java/org/postgresql/test/jdbc2/DriverTest.java \
|
|||
|
||||
# Include PostgreSQL testing methods and variables.
|
||||
%if %runselftest
|
||||
%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
|
||||
. %{SOURCE1}
|
||||
setup_build_local_properties > build.local.properties
|
||||
|
||||
# Start the local PG cluster.
|
||||
%postgresql_tests_start
|
||||
%else
|
||||
# -f is equal to -Dmaven.test.skip=true
|
||||
opts="-f"
|
||||
# NOTE this parameter skips running tests but still compiles them
|
||||
opts="-DskipTests=true"
|
||||
%endif
|
||||
|
||||
%mvn_build $opts --xmvn-javadoc
|
||||
%mvn_build -j -- $opts
|
||||
|
||||
xmvn --offline -Dmdep.outputFile=tests-classpath dependency:build-classpath
|
||||
|
||||
%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 javadoc -f .mfiles-javadoc
|
||||
%files tests -f .mfiles-tests
|
||||
%license LICENSE
|
||||
%{_datadir}/%{name}-tests
|
||||
%{_libexecdir}/%{name}-tests
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
|
|
|
|||
24
postgresql_jdbc_tests_init.sh
Executable file
24
postgresql_jdbc_tests_init.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/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
|
||||
}
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (postgresql-42.7.4-jdbc-src.tar.gz) = 3f864848d0b6b079daf8abecabb2bd8487fa8bc23ef9265bfa71c484b4ee3b38a76cc38af7a72ac3ac64fa26569952b9b69d08b3b8a115d44bee823151c6c292
|
||||
SHA512 (postgresql-42.7.8-jdbc-src.tar.gz) = 4860f6446960ad4d38af28a3cd38cbc6bdd53d8acdd0c20cc3141df3e7a4b41aad67293f19aac6ae6d9da351b7e6379a0a02261d8bb188e1daae914f7ba0139f
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue