Skip to content
Permalink
Browse files

packaging: update Fedora's CI

* update Dockerfile to Fedora 27
* spec template synced with Fedora Rawhide
  • Loading branch information
praiskup committed Jan 19, 2018
1 parent 975aaf5 commit dcbf70bc071fe9d602f7c87918982b01452da9ba
@@ -6,6 +6,7 @@ then
# Try to prevent "stdout: write error"
# WA is taken from https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959
python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
export PROJECT_VERSION=$(mvn -B -N org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[')
export PARENT_VERSION=$(mvn -B -N org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.parent.version | grep -v '\[')
exec ./packaging/rpm_ci
fi
@@ -2,4 +2,3 @@ spec: postgresql-jdbc.spec

source0:
method: git_archive
archive_prefix: pgjdbc-REL9.5.git

This file was deleted.

@@ -1,4 +1,4 @@
FROM index.docker.io/fedora:25
FROM index.docker.io/fedora:27
MAINTAINER pgjdbc team

ENV HOME=/rpm
@@ -7,6 +7,8 @@ copr_be_link=https://copr-be.cloud.fedoraproject.org/results/@pgjdbc/pgjdbc-trav
status_file=copr_build_id

test -z "$PARENT_VERSION" && exit 1
test -z "$PROJECT_VERSION" && exit 1
PROJECT_VERSION=${PROJECT_VERSION//-/_}

copr_wrapper ()
(
@@ -32,6 +34,7 @@ git_rev=$(git rev-parse --short=7 HEAD)
date_rev=$(date +%Y%m%d_%H%M%S)
release=${date_rev}.git$git_rev
sed -e "s!^Release:.*\$!Release: 1.$release%{?dist}!" \
-e "s!^Version:.*\$!Version: $PROJECT_VERSION!" \
-e "s!%global parent_ver.*!%global parent_ver $PARENT_VERSION!" \
"$2".spec.tpl > "$2".spec

@@ -35,8 +35,6 @@


%global section devel
%global upstreamrel git
%global upstreammajor 9.5
%global source_path pgjdbc/src/main/java/org/postgresql
%global parent_ver GENERATED
%global parent_poms_builddir ./pgjdbc-parent-poms
@@ -46,30 +44,30 @@

Summary: JDBC driver for PostgreSQL
Name: postgresql-jdbc
Version: %upstreammajor.%{upstreamrel}
Version: GENERATED
Release: GENERATED
License: BSD
URL: http://jdbc.postgresql.org/

Source0: REL%{version}.tar.gz
Source0: https://github.com/pgjdbc/pgjdbc/archive/REL%{version}/pgjdbc-REL%{version}.tar.gz

# 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
# having separate spec file for it, too.
Source1: https://github.com/pgjdbc/pgjdbc-parent-poms/archive/REL%parent_ver.tar.gz
Source1: https://github.com/pgjdbc/pgjdbc-parent-poms/archive/REL%parent_ver/pgjdbc-parent-poms-REL%{parent_ver}.tar.gz

BuildArch: noarch
BuildRequires: java-devel >= 1.8
BuildRequires: maven-local
BuildRequires: java-comment-preprocessor
BuildRequires: properties-maven-plugin
BuildRequires: maven-clean-plugin
BuildRequires: maven-enforcer-plugin
BuildRequires: maven-plugin-bundle
BuildRequires: maven-plugin-build-helper
BuildRequires: classloader-leak-test-framework

BuildRequires: mvn(com.ongres.scram:client)
BuildRequires: mvn(org.apache.maven.plugins:maven-clean-plugin)

%if %runselftest
BuildRequires: postgresql-contrib
@@ -102,7 +100,7 @@ This package contains the API Documentation for %{name}.


%prep
%setup -c -q -a 1 -n pgjdbc-REL%version
%setup -c -q -a 1

mv pgjdbc-REL%version/* .
mv pgjdbc-parent-poms-REL%parent_ver pgjdbc-parent-poms
@@ -143,7 +141,7 @@ mkdir -p pgjdbc/target/generated-sources/annotations

# Include PostgreSQL testing methods and variables.
%if %runselftest
%pgtests_init
%postgresql_tests_init

PGTESTS_LOCALE=C.UTF-8

@@ -161,7 +159,7 @@ protocolVersion=0
EOF

# Start the local PG cluster.
%pgtests_start
%postgresql_tests_start
%else
# -f is equal to -Dmaven.test.skip=true
opts="-f"
@@ -10,6 +10,6 @@ cd "$(dirname "$0")"
echo "$copr_token_password" | gpg --batch --passphrase-fd 0 rpm/copr-token.gpg
) || exit 0

docker run -e HOME=/git -e PARENT_VERSION \
docker run -e HOME=/git -e PARENT_VERSION -e PROJECT_VERSION \
-u `id -u` -ti --rm -v `pwd`/..:/git:Z praiskup/copr-and-jdbc-ci \
copr-ci-git /git/packaging/rpm postgresql-jdbc 9.5.git
copr-ci-git /git/packaging/rpm postgresql-jdbc

0 comments on commit dcbf70b

Please sign in to comment.
You can’t perform that action at this time.