testsuite: install the testsuite in *-tests subpackage

Install it under %{_libdir}/%{name}/test, as is done in
postgresql package.  Remove the %check phase as it was kludge
anyway.

Version: 09.03.0400-2
This commit is contained in:
Pavel Raiskup 2014-11-19 08:59:15 +01:00
parent 46da9a502d
commit b55cd2405a

View File

@ -1,7 +1,7 @@
Name: postgresql-odbc
Summary: PostgreSQL ODBC driver
Version: 09.03.0400
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+
Group: Applications/Databases
URL: http://psqlodbc.projects.postgresql.org/
@ -22,7 +22,10 @@ PostgreSQL system via ODBC (Open Database Connectivity).
%prep
%setup -q -n psqlodbc-%{version}
cat <<EOF >README.rpmdist
The upstream psqlodbc testsuite is distributed in '%{name}-tests'
(sub)package.
EOF
%build
%configure --with-unixodbc --disable-dependency-tracking
@ -32,18 +35,20 @@ make %{?_smp_mflags}
%install
make DESTDIR=$RPM_BUILD_ROOT install
%check
%if 0%{?runselftest}
# Note that this requires having PostgresSQL server and unixODBC installed
# and properly configured - for this reason, disabled by default
cd test
sed -i "s|^[Uu]sername.*|Username = %{testdbuser}|" odbc.ini
sed -i "s|^[Pp]assword.*|Password = %{testdbpass}|" odbc.ini
cat odbc.ini
make installcheck || { cat regression.diffs ; exit 1; }
%endif
%global testsuitedir %{_libdir}/%{name}
install -d -m 755 $RPM_BUILD_ROOT/%{testsuitedir}
cp -R test $RPM_BUILD_ROOT/%{testsuitedir}
( cd $RPM_BUILD_ROOT/%{testsuitedir}/test
sed -i \
-e "s|^[Uu]sername.*|Username = postgres|" \
-e "s|^[Pp]assword.*|Password = postgres-pass|" \
-e "s|^[Pp]rotocol.*|Protocol = 7.4|" \
-e "s|^[Ss]erver[Nn]ame.*|Servername = /var/run/postgresql/|" \
odbc.ini
sed -i \
-e "s|^[Dd]river.*|Driver = %{_libdir}/psqlodbcw.so|" \
odbcinst.ini
)
# Provide the old library name "psqlodbc.so" as a symlink,
# and remove the rather useless .la file
@ -55,12 +60,32 @@ popd
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%package tests
Summary: Testsuite files for psqlodbc
Requires: postgresql-test
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description tests
The postgresql-odbc-tests package contains files needed for various tests for
the PostgreSQL unixODBC driver.
%files
%{_libdir}/psqlodbcw.so
%{_libdir}/psqlodbc.so
%doc license.txt readme.txt docs/*
%doc license.txt readme.txt docs/* README.rpmdist
%files tests
%doc license.txt
%dir %{testsuitedir}
%defattr(-,postgres,postgres)
%{testsuitedir}/test
%changelog
* Wed Nov 19 2014 Pavel Raiskup <praiskup@redhat.com> - 09.03.0400-2
- install the testsuite
* Wed Oct 29 2014 Pavel Raiskup <praiskup@redhat.com> - 09.03.0400-1
- rebase to latest upstream version, per release notes:
http://psqlodbc.projects.pgfoundry.org/docs/release.html