postgresql-odbc/postgresql-odbc.spec
2023-02-14 14:07:10 +08:00

82 lines
2.4 KiB
RPMSpec

Name: postgresql-odbc
Summary: Official postgreSQL ODBC driver
Version: 13.01.0000
Release: 1
License: LGPLv2+
URL: https://odbc.postgresql.org/
Source0: http://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-%{version}.tar.gz
BuildRequires: unixODBC-devel postgresql-server-devel postgresql-test-rpm-macros gcc
Provides: psqlodbc = %version-%release
%description
This package is the official PostgreSQL ODBC Driver.
%package devel
Summary: Various testsuite files for psqlodbc
Requires: postgresql-test gcc make unixODBC-devel
Requires: %{name} = %{version}-%{release}
Provides: %{name}-tests = %{version}-%{release}
Obsoletes: %{name}-tests < %{version}-%{release}
%description devel
The package contains different files for various tests for postgresql-odbc.
%prep
%autosetup -n psqlodbc-%{version}
echo "The upstream psqlodbc testsuite is distributed in '%{name}-tests'">README.rpmdist
echo "(sub)package.">>README.rpmdist
%build
CPPFLAGS="-I%{_includedir}/pgsql/internal/"
export CPPFLAGS
%configure --with-unixodbc --disable-dependency-tracking
%make_build
%install
%make_install
mkdir %{buildroot}/%{_libdir}/postgresql-odbc && chmod 755 %{buildroot}/%{_libdir}/postgresql-odbc
cp -R test %{buildroot}/%{_libdir}/postgresql-odbc
sed -i 's~^drvr=.*~drvr=%{_libdir}/psqlodbc~' %{buildroot}/%{_libdir}/postgresql-odbc/test/odbcini-gen.sh
cd %{buildroot}%{_libdir}
ln -s psqlodbcw.so psqlodbc.so ; rm psqlodbcw.la psqlodbca.la
%check
%postgresql_tests_run
cd test && %make_build installcheck || {
echo "=== trying to find all regression.diffs files in build directory ==="
find -name regression.diffs | while read line; do
cat "$line"
done
false
}
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%{_libdir}/{psqlodbc.so,psqlodbca.so,psqlodbcw.so}
%doc license.txt readme.txt docs/* README.rpmdist
%files devel
%doc license.txt
%dir %{_libdir}/postgresql-odbc
%defattr(-,postgres,postgres)
%{_libdir}/postgresql-odbc/test
%changelog
* Tue Feb 14 2023 dillon chen <dillon.chen@gmail.com> - 13.01.0000-1
- Bump to 13.01.0000 verion
* Mon Jun 28 2021 bzhaoop <bzhaojyathousandy@gmail.com> - 13.00.0000-1
- Bump to 13.00.0000 verion
* Mon May 31 2021 huanghaitao <huanghaitao8@huawei.com> - 10.03.0000-4
- Completing build dependencies
* Wed Apr 22 2020 wangyue<wangyue92@huawei.com> - 10.03.0000-3
- Package init