3bfd81
%?mingw_package_header
3bfd81
3bfd81
Name:           mingw-postgresql
acef46
Version:        11.5
acef46
Release:        1%{?dist}
3bfd81
Summary:        MinGW Windows PostgreSQL library
3bfd81
3bfd81
License:        PostgreSQL
3bfd81
URL:            http://www.postgresql.org/
927d67
Source0:        https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
7b49c9
Source1:        https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2.sha256
3bfd81
927d67
# Allow linking to MinGW TCL DLL
3cf91d
Patch0:         postgresql-10.0-mingw.patch
932e16
# https://www.postgresql.org/message-id/2a6c418e-373b-8466-fcb8-ce729aab255f@gmail.com
932e16
Patch1:         postgresql-11.2-import-name.patch
932e16
# https://www.postgresql.org/message-id/2a6c418e-373b-8466-fcb8-ce729aab255f@gmail.com
932e16
Patch2:         postgresql-11.2-static-libraries.patch
b33405
3bfd81
BuildArch:      noarch
3bfd81
3bfd81
BuildRequires:  mingw32-filesystem >= 95
3bfd81
BuildRequires:  mingw32-gcc
0086e9
BuildRequires:  mingw32-gettext
0086e9
BuildRequires:  mingw32-libxml2
0086e9
BuildRequires:  mingw32-libxslt
3bfd81
BuildRequires:  mingw32-openssl
0086e9
BuildRequires:  mingw32-tcl
3bfd81
BuildRequires:  mingw32-readline
3bfd81
BuildRequires:  mingw32-zlib
3bfd81
3bfd81
BuildRequires:  mingw64-filesystem >= 95
3bfd81
BuildRequires:  mingw64-gcc
0086e9
BuildRequires:  mingw64-gettext
0086e9
BuildRequires:  mingw64-libxml2
0086e9
BuildRequires:  mingw64-libxslt
3bfd81
BuildRequires:  mingw64-openssl
3bfd81
BuildRequires:  mingw64-readline
0086e9
BuildRequires:  mingw64-tcl
3bfd81
BuildRequires:  mingw64-zlib
3bfd81
e5c5c6
BuildRequires:  bison flex gettext pkgconfig tcl
3bfd81
3bfd81
3bfd81
%description
3bfd81
MinGW Windows copy of PostgreSQL. PostgreSQL is an advanced Object-Relational
3bfd81
database management system (DBMS).
3bfd81
3bfd81
3bfd81
# Win32
3bfd81
%package -n mingw32-postgresql
3bfd81
Summary:        MinGW Windows PostgreSQL library
3bfd81
3bfd81
%description -n mingw32-postgresql
3bfd81
MinGW Windows copy of PostgreSQL. PostgreSQL is an advanced Object-Relational
3bfd81
database management system (DBMS).
3bfd81
75b2fc
%package -n mingw32-postgresql-static
75b2fc
Summary:        Static libraries for MinGW PostgreSQL
75b2fc
Requires:       mingw32-postgresql = %{version}-%{release}
75b2fc
75b2fc
%description -n mingw32-postgresql-static
75b2fc
%{summary}
75b2fc
3bfd81
# Win64
3bfd81
%package -n mingw64-postgresql
3bfd81
Summary:        MinGW Windows PostgreSQL library
3bfd81
3bfd81
%description -n mingw64-postgresql
3bfd81
MinGW Windows copy of PostgreSQL. PostgreSQL is an advanced Object-Relational
3bfd81
database management system (DBMS).
3bfd81
75b2fc
%package -n mingw64-postgresql-static
75b2fc
Summary:        Static libraries for MinGW PostgreSQL
75b2fc
Requires:       mingw64-postgresql = %{version}-%{release}
75b2fc
75b2fc
%description -n mingw64-postgresql-static
75b2fc
%{summary}
75b2fc
3bfd81
3bfd81
%?mingw_debug_package
3bfd81
3bfd81
3bfd81
%prep
3bfd81
%setup -q -n postgresql-%{version}
927d67
%patch0 -p1
932e16
%patch1 -p1
932e16
%patch2 -p1
3bfd81
3bfd81
3bfd81
%build
0086e9
mkdir build_win32
0086e9
pushd build_win32
0086e9
%mingw32_configure \
0086e9
    --with-openssl \
0086e9
    --enable-thread-safety \
0086e9
    --enable-integer-datetimes \
0086e9
    --enable-nls \
0086e9
    --with-ldap \
0086e9
    --with-libxml \
0086e9
    --with-libxslt \
0086e9
    --with-tcl --with-tclconfig=/usr/i686-w64-mingw32/sys-root/mingw/lib
0086e9
popd
0086e9
mkdir build_win64
0086e9
pushd build_win64
0086e9
%mingw64_configure \
0086e9
    --with-openssl \
0086e9
    --enable-thread-safety \
0086e9
    --enable-integer-datetimes \
0086e9
    --enable-nls \
0086e9
    --with-ldap \
0086e9
    --with-libxml \
0086e9
    --with-libxslt \
0086e9
    --with-tcl --with-tclconfig=/usr/x86_64-w64-mingw32/sys-root/mingw/lib
0086e9
popd
3bfd81
# Make DLL definition file visible during each arch build
3bfd81
ln -s %{_builddir}/%{buildsubdir}/src/interfaces/libpq/libpqdll.def ./build_win32/src/interfaces/libpq/
3bfd81
ln -s %{_builddir}/%{buildsubdir}/src/interfaces/libpq/libpqdll.def ./build_win64/src/interfaces/libpq/
3bfd81
ln -s %{_builddir}/%{buildsubdir}/src/interfaces/ecpg/ecpglib/libecpgdll.def ./build_win32/src/interfaces/ecpg/ecpglib/
3bfd81
ln -s %{_builddir}/%{buildsubdir}/src/interfaces/ecpg/ecpglib/libecpgdll.def ./build_win64/src/interfaces/ecpg/ecpglib/
3bfd81
ln -s %{_builddir}/%{buildsubdir}/src/interfaces/ecpg/pgtypeslib/libpgtypesdll.def ./build_win32/src/interfaces/ecpg/pgtypeslib/
3bfd81
ln -s %{_builddir}/%{buildsubdir}/src/interfaces/ecpg/pgtypeslib/libpgtypesdll.def ./build_win64/src/interfaces/ecpg/pgtypeslib/
3bfd81
ln -s %{_builddir}/%{buildsubdir}/src/interfaces/ecpg/compatlib/libecpg_compatdll.def ./build_win32/src/interfaces/ecpg/compatlib/
3bfd81
ln -s %{_builddir}/%{buildsubdir}/src/interfaces/ecpg/compatlib/libecpg_compatdll.def ./build_win64/src/interfaces/ecpg/compatlib/
3bfd81
%mingw_make %{?_smp_mflags}
3bfd81
3bfd81
3bfd81
%install
3bfd81
%mingw_make install DESTDIR=$RPM_BUILD_ROOT
3bfd81
3bfd81
# move DLLs to bin
3bfd81
mv $RPM_BUILD_ROOT%{mingw32_libdir}/*.dll \
3bfd81
   $RPM_BUILD_ROOT%{mingw32_bindir}
3bfd81
mv $RPM_BUILD_ROOT%{mingw64_libdir}/*.dll \
3bfd81
   $RPM_BUILD_ROOT%{mingw64_bindir}
3bfd81
3bfd81
# due to Fedora packaging policy, delete executables
3bfd81
rm $RPM_BUILD_ROOT%{mingw32_bindir}/*.exe
3bfd81
rm $RPM_BUILD_ROOT%{mingw64_bindir}/*.exe
3bfd81
rm -rf $RPM_BUILD_ROOT%{mingw32_libdir}/postgresql/
3bfd81
rm -rf $RPM_BUILD_ROOT%{mingw64_libdir}/postgresql/
3bfd81
932e16
# libpostgres.dll.a is just the import library for postgres.exe, delete it
932e16
rm -f $RPM_BUILD_ROOT%{mingw32_libdir}/libpostgres.{a,dll.a}
932e16
rm -f $RPM_BUILD_ROOT%{mingw64_libdir}/libpostgres.{a,dll.a}
932e16
3bfd81
# remove server support files
0086e9
rm -rf $RPM_BUILD_ROOT%{mingw32_bindir}/pltcl*
0086e9
rm -rf $RPM_BUILD_ROOT%{mingw64_bindir}/pltcl*
3bfd81
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}
3bfd81
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}
3bfd81
3bfd81
3bfd81
# Win32
3bfd81
%files -n mingw32-postgresql
927d67
%license COPYRIGHT
3bfd81
%{mingw32_bindir}/libecpg.dll
3bfd81
%{mingw32_bindir}/libecpg_compat.dll
3bfd81
%{mingw32_bindir}/libpgtypes.dll
3bfd81
%{mingw32_bindir}/libpq.dll
3bfd81
%{mingw32_includedir}/libpq/
3bfd81
%{mingw32_includedir}/postgresql/
3bfd81
%{mingw32_includedir}/ecpg*.h
3bfd81
%{mingw32_includedir}/libpq-events.h
3bfd81
%{mingw32_includedir}/libpq-fe.h
3bfd81
%{mingw32_includedir}/pg*.h
3bfd81
%{mingw32_includedir}/postgres_ext.h
3bfd81
%{mingw32_includedir}/sql*.h
3bfd81
%{mingw32_libdir}/libecpg.dll.a
3bfd81
%{mingw32_libdir}/libecpg_compat.dll.a
3bfd81
%{mingw32_libdir}/libpgtypes.dll.a
3bfd81
%{mingw32_libdir}/libpq.dll.a
249f17
%{mingw32_libdir}/pkgconfig/*.pc
3bfd81
3bfd81
75b2fc
%files -n mingw32-postgresql-static
932e16
%{mingw32_libdir}/libecpg.a
932e16
%{mingw32_libdir}/libecpg_compat.a
932e16
%{mingw32_libdir}/libpq.a
75b2fc
%{mingw32_libdir}/libpgcommon.a
75b2fc
%{mingw32_libdir}/libpgfeutils.a
75b2fc
%{mingw32_libdir}/libpgport.a
932e16
%{mingw32_libdir}/libpgtypes.a
75b2fc
75b2fc
3bfd81
# Win64
3bfd81
%files -n mingw64-postgresql
927d67
%license COPYRIGHT
3bfd81
%{mingw64_bindir}/libecpg.dll
3bfd81
%{mingw64_bindir}/libecpg_compat.dll
3bfd81
%{mingw64_bindir}/libpgtypes.dll
3bfd81
%{mingw64_bindir}/libpq.dll
3bfd81
%{mingw64_includedir}/libpq/
3bfd81
%{mingw64_includedir}/postgresql/
3bfd81
%{mingw64_includedir}/ecpg*.h
3bfd81
%{mingw64_includedir}/libpq-events.h
3bfd81
%{mingw64_includedir}/libpq-fe.h
3bfd81
%{mingw64_includedir}/pg*.h
3bfd81
%{mingw64_includedir}/postgres_ext.h
3bfd81
%{mingw64_includedir}/sql*.h
3bfd81
%{mingw64_libdir}/libecpg.dll.a
3bfd81
%{mingw64_libdir}/libecpg_compat.dll.a
3bfd81
%{mingw64_libdir}/libpgtypes.dll.a
3bfd81
%{mingw64_libdir}/libpq.dll.a
249f17
%{mingw64_libdir}/pkgconfig/*.pc
3bfd81
3bfd81
75b2fc
%files -n mingw64-postgresql-static
932e16
%{mingw64_libdir}/libecpg.a
932e16
%{mingw64_libdir}/libecpg_compat.a
932e16
%{mingw64_libdir}/libpq.a
75b2fc
%{mingw64_libdir}/libpgcommon.a
75b2fc
%{mingw64_libdir}/libpgfeutils.a
75b2fc
%{mingw64_libdir}/libpgport.a
932e16
%{mingw64_libdir}/libpgtypes.a
75b2fc
75b2fc
3bfd81
%changelog
acef46
* Sat Aug 04 2019 Michael Cronenworth <mike@cchtml.com> - 11.5-1
acef46
- New upstream release.
acef46
2be540
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 11.2-3
2be540
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
2be540
932e16
* Tue Apr 16 2019 Michael Cronenworth <mike@cchtml.com> - 11.2-2
932e16
- Add patches to release proper static libraries.
932e16
8c7b11
* Sun Feb 17 2019 Michael Cronenworth <mike@cchtml.com> - 11.2-1
8c7b11
- New upstream release.
8c7b11
fe9711
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 10.5-2
fe9711
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
fe9711
d056af
* Wed Sep 05 2018 Michael Cronenworth <mike@cchtml.com> - 10.5-1
d056af
- New upstream release.
d056af
  https://www.postgresql.org/docs/10/static/release-10-5.html
d056af
e9c387
* Fri Aug 24 2018 Richard W.M. Jones <rjones@redhat.com> - 10.3-3
e9c387
- Rebuild for new mingw-openssl.
e9c387
3da85b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 10.3-2
3da85b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
3da85b
7b49c9
* Fri Mar 02 2018 Michael Cronenworth <mike@cchtml.com> - 10.3-1
7b49c9
- New upstream release.
7b49c9
  https://www.postgresql.org/docs/10/static/release-10-3.html
7b49c9
17b1e4
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 10.1-2
17b1e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
17b1e4
0ff14b
* Wed Nov 22 2017 Michael Cronenworth <mike@cchtml.com> - 10.1-1
0ff14b
- New upstream release.
0ff14b
  https://www.postgresql.org/docs/10/static/release-10-1.html
0ff14b
3cf91d
* Sat Nov 04 2017 Michael Cronenworth <mike@cchtml.com> - 10.0-1
3cf91d
- New upstream release.
3cf91d
  https://www.postgresql.org/docs/10/static/release-10.html
3cf91d
6cfee4
* Fri Aug 11 2017 Kalev Lember <klember@redhat.com> - 9.6.4-2
6cfee4
- Bump and rebuild for an rpm signing issue
6cfee4
8d9193
* Thu Aug 10 2017 Michael Cronenworth <mike@cchtml.com> - 9.6.4-1
8d9193
- New upstream release. (CVE-2017-7546 CVE-2017-7547 CVE-2017-7548)
8d9193
fe762d
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 9.6.3-2
fe762d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
fe762d
655de6
* Thu May 11 2017 Michael Cronenworth <mike@cchtml.com> - 9.6.3-1
655de6
- New upstream release. (CVE-2017-7484 CVE-2017-7485 CVE-2017-7486)
655de6
131ee4
* Sat Apr 01 2017 Michael Cronenworth <mike@cchtml.com> - 9.6.2-1
131ee4
- New upstream release.
131ee4
1d305b
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 9.6.1-2
1d305b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
1d305b
75b2fc
* Thu Dec 01 2016 Michael Cronenworth <mike@cchtml.com> - 9.6.1-1
75b2fc
- New upstream release.
75b2fc
31a319
* Wed Sep 21 2016 Michael Cronenworth <mike@cchtml.com> - 9.5.4-1
31a319
- New upstream release.
31a319
2853e8
* Wed Jun 01 2016 Michael Cronenworth <mike@cchtml.com> - 9.5.3-1
2853e8
- New upstream release.
2853e8
293c65
* Thu Apr 14 2016 Michael Cronenworth <mike@cchtml.com> - 9.5.2-1
293c65
- New upstream release.
293c65
c44e5a
* Tue Feb 02 2016 Michael Cronenworth <mike@cchtml.com> - 9.5.0-1
c44e5a
- New upstream release.
c44e5a
61d065
* Mon Dec 28 2015 Michael Cronenworth <mike@cchtml.com> - 9.4.5-1
61d065
- New upstream release.
61d065
ae7ee1
* Mon Jul 27 2015 Michael Cronenworth <mike@cchtml.com> - 9.4.4-1
ae7ee1
- New upstream release.
ae7ee1
2b3522
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.4.2-2
2b3522
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2b3522
8f69ff
* Thu May 28 2015 Michael Cronenworth <mike@cchtml.com> - 9.4.2-1
8f69ff
- New upstream release.
8f69ff
a1b23f
* Wed Feb 25 2015 Michael Cronenworth <mike@cchtml.com> - 9.4.1-1
a1b23f
- New upstream release.
a1b23f
927d67
* Tue Feb 03 2015 Michael Cronenworth <mike@cchtml.com> - 9.4.0-1
927d67
- New upstream release.
927d67
b33405
* Sat Aug 16 2014 Michael Cronenworth <mike@cchtml.com> - 9.3.5-1
b33405
- New upstream release.
b33405
ad83a4
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.3.4-2
ad83a4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
ad83a4
1f6d0b
* Tue Mar 25 2014 Michael Cronenworth <mike@cchtml.com> - 9.3.4-1
1f6d0b
- New upstream release.
1f6d0b
f772e8
* Thu Mar 06 2014 Michael Cronenworth <mike@cchtml.com> - 9.3.3-1
f772e8
- New upstream release.
f772e8
be338e
* Tue Jan 07 2014 Michael Cronenworth <mike@cchtml.com> - 9.3.2-1
be338e
- New upstream release.
be338e
249f17
* Mon Oct 28 2013 Michael Cronenworth <mike@cchtml.com> - 9.3.1-1
249f17
- Rebase to 9.3 branch.
249f17
bed7b1
* Thu Aug 22 2013 Michael Cronenworth <mike@cchtml.com> - 9.2.4-4
bed7b1
- Use upstream patch for Windows error checking
bed7b1
0086e9
* Thu Aug 15 2013 Michael Cronenworth <mike@cchtml.com> - 9.2.4-3
0086e9
- Enable NLS, LDAP, TCL, and XML features.
0086e9
- Patch for Windows error checking (RHBZ# 996529)
0086e9
fdd36d
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.2.4-2
fdd36d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
fdd36d
3bfd81
* Mon Jul 15 2013 Michael Cronenworth <mike@cchtml.com> - 9.2.4-1
3bfd81
- Initial RPM release
3bfd81