Blob Blame History Raw
# Use the libssh2-1.6.1 embedded with pgadmin3
%global use_embedded 1
%bcond_with wxGTK3

%if %{with wxGTK3}
%global wx_pkg wxGTK3-devel
%global wx_ver 3.0
%else 
%if 0%{?fedora} >= 28 
%global wx_pkg compat-wxGTK3-gtk2-devel
%global wx_ver 3.0
%else
%global wx_pkg wxGTK-devel
%global wx_ver 2.8
%endif
%endif

Summary:	Graphical client for PostgreSQL
Name:		pgadmin3
Version:	1.22.2
Release:	14%{?dist}
License:	PostgreSQL
Source:		https://ftp.postgresql.org/pub/pgadmin/pgadmin3/v%{version}/src/%{name}-%{version}.tar.gz
Source1:	pgadmin3.appdata.xml
Source2:	pgadmin3.xpm
Patch0:		%{name}-1.14.2-cflags.patch
Patch2:		%{name}-desktop.patch
# Move this == null check to a static function.  This works, but I opted
# for the compiler flag since it "fixes" all cases, and pgadmin4 is on the
# way.
Patch3:		%{name}-nullthis.patch
# Fix failure to use EVP_CIPHER_CTX_new()
Patch4:		%{name}-ssh2.patch

# PG 10 support, adapted from:
# https://bitbucket.org/openscg/pgadmin3-lts/commits/ea8a31af779b101248fc13242cb7a34e252cf49e/raw
# https://bitbucket.org/openscg/pgadmin3-lts/commits/1d65e012f7bb88d3b6c5a08946a2456617213c35/raw
Patch5:		pgadmin3-PG10.patch

# PG 11 support, adapted from:
# https://abdulyadi.wordpress.com/2018/11/03/pgadmin3-adjustment-for-postgresql-11-0/
Patch6:		pgadmin3-PG11.patch

URL:		http://www.pgadmin.org/
BuildRequires:	gcc-c++
BuildRequires:	libappstream-glib
BuildRequires:	%{wx_pkg} libpq-devel desktop-file-utils compat-openssl10-devel libxml2-devel libxslt-devel postgresql-server-devel
%if 0%{use_embedded}
Provides: bundled(libssh2) = 1.6.1_DEV
%endif

%description
pgAdmin III is a powerful administration and development
platform for the PostgreSQL database, free for any use.
It is designed to answer the needs of all users,
from writing simple SQL queries to developing complex
databases. The graphical interface supports all PostgreSQL
features and makes administration easy.

pgAdmin III is designed to answer the needs of all users,
from writing simple SQL queries to developing complex databases.
The graphical interface supports all PostgreSQL features and
makes administration easy. The application also includes a syntax
highlighting SQL editor, a server-side code editor, an
SQL/batch/shell job scheduling agent, support for the Slony-I
replication engine and much more. No additional drivers are
required to communicate with the database server.

%prep
%setup -q
%patch0 -p1
%patch2 -p0
%patch3 -p0 -b .nullthis
%if !0%{use_embedded}
# remove embedded libssh2 
rm -rf pgadmin/libssh2 pgadmin/include/libssh2
%patch4 -p0 -b .ssh2
%endif
%patch5 -p1
%patch6 -p1

%build
export CXXFLAGS="%optflags -fno-delete-null-pointer-checks -Wno-unused-local-typedefs"
%configure --disable-debug --disable-dependency-tracking --with-wx-version=%{wx_ver} --with-wx=%{_prefix}
make %{?_smp_mflags} all

%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install

mkdir -p %{buildroot}%{_datadir}/%{name}/
cp -f %{SOURCE2} %{buildroot}/%{_datadir}/%{name}/%{name}.xpm

mkdir -p %{buildroot}/%{_datadir}/applications

desktop-file-install --dir %{buildroot}%{_datadir}/applications \
%if 0%{?rhel}
	--vendor="" \
%endif
	--add-category Development pkg/%{name}.desktop

# Convert changelog, fix incorrect end-of-line encoding
iconv -f iso-8859-1 -t utf-8 -o CHANGELOG.utf8 CHANGELOG
sed -i 's/\r$//' CHANGELOG.utf8
touch -c -r CHANGELOG CHANGELOG.utf8
mv -f CHANGELOG.utf8 CHANGELOG

# Remove unwanted and double files
rm -f docs/{Docs.vcproj,builddocs.bat}
rm -f %{buildroot}%{_datadir}/%{name}/i18n/{*,.}/wxstd.mo

# Move locales to their correct place
mkdir -p %{buildroot}%{_datadir}/locale
mv -f %{buildroot}%{_datadir}/%{name}/i18n/??_?? %{buildroot}%{_datadir}/locale

%find_lang %{name}

# install gnome metainfo
mkdir -p %{buildroot}%{_metainfodir}
cp -p %{SOURCE1} %{buildroot}%{_metainfodir}/org.postgresql.pgadmin3.appdata.xml

%check
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml

%files -f %{name}.lang
%doc BUGS CHANGELOG LICENSE README docs/*
%{_bindir}/*
%{_datadir}/%{name}
%{_datadir}/applications/*
%{_metainfodir}/*

%changelog
* Fri Mar 15 2019 Sandro Mani <manisandro@gmail.com> - 1.22.2-14
- Add PG11 support
- Build with wxWidgets 3.0 and gtk2 compatibility also on F30+ unless explicitly requested

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.22.2-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Wed Dec 19 2018 Stuart Gathman <stuart@gathman.org> - 1.22.2-12
- Generate larger icon from 
- https://www.postgresql.org/media/img/about/press/elephant.png

* Wed Dec 19 2018 Stuart Gathman <stuart@gathman.org> - 1.22.2-11
- Add appdata

* Thu Nov 08 2018 Scott Talbert <swt@techie.net> - 1.22.2-10
- Restore missing patch for PG10
- Build with wxWidgets 3.0 on F30+ only
- Build with wxWidgets 3.0 and gtk2 compatibility on F27-F29

* Wed Nov 07 2018 Scott Talbert <swt@techie.net> - 1.22.2-9
- Rebuild with wxWidgets 3.0

* Tue Nov 06 2018 Scott Talbert <swt@techie.net> - 1.22.2-8
- Adjust BRs to fix FTBFS	

* Tue Nov 06 2018 Stuart Gathman <stuart@gathman.org> - 1.22.2-7
- Build against compat-openssl10	Sandro Mani <manisandro@gmail.com>
- Fix failure to use EVP_CIPHER_CTX_new() 
- Fix broken pgadmin3-nullthis.patch
- Add patch for PG10 support

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.22.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.22.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.22.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.22.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.22.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Fri Nov 11 2016 Devrim Gündüz <devrim@gunduz.org> 1.22.2-1
- Update to 1.22.2 -- the final release of pgadmin3
- Update patch3

* Tue Aug 23 2016 Stuart Gathman <stuart@gathman.org> 1.22.1-3
- Fix a few of the null pointer problems, bz#1369520

* Tue Jul 19 2016 Stuart Gathman <stuart@gathman.org> 1.22.1-2
- Compile with --no-delete-null-pointer-checks, bz#1335043

* Fri Jul  1 2016 Stuart Gathman <stuart@gathman.org> 1.22.1-1.3
- Attempt to mitigate pervasive this == 0 coding error

* Wed Feb 17 2016 Devrim Gündüz <devrim@gunduz.org> 1.22.1-1
- Update to 1.22.1
- Update download URL

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.20.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.20.0-2
- Rebuilt for GCC 5 C++11 ABI change

* Tue Mar 10 2015 Kevin Fenzi <kevin@scrye.com> 1.20.0-1
- Rebuild for new gcc

* Mon Dec 22 2014 Devrim Gündüz <devrim@gunduz.org> 1.20.0-1
- Update to 1.20.0
- Update download URL -- community will deprecate FTP service.

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.18.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.18.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue Oct 8 2013 Devrim Gündüz <devrim@gunduz.org> 1.18.1-1
- Update to 1.18.1

* Wed Sep 11 2013 Devrim Gündüz <devrim@gunduz.org> 1.18.0-1
- Update to 1.18.0
- Trim changelog

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.16.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri Jan 25 2013 Devrim Gündüz <devrim@gunduz.org> 1.16.1-1
- Update to 1.16.1

* Mon Oct 29 2012 Devrim Gündüz <devrim@gunduz.org> 1.16.0-2
- Update licence, per bz #871183.

* Sun Oct 28 2012 Devrim Gündüz <devrim@gunduz.org> 1.16.0-1
- Update to 1.16.0

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.14.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri May 11 2012 Ville Skyttä <ville.skytta@iki.fi> - 1.14.2-2
- Fix -debuginfo (#746349).

* Thu May 10 2012 Devrim Gündüz <devrim@gunduz.org> 1.14.2-1
- Update to 1.14.2

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.14.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Thu Oct 13 2011 Devrim Gündüz <devrim@gunduz.org> 1.14.0-1
- Update to 1.14.0

* Tue Apr 19 2011 Devrim Gündüz <devrim@gunduz.org> 1.12.3-1
- Update to 1.12.3

* Wed Feb 23 2011 Devrim Gündüz <devrim@gunduz.org> 1.12.2-3
- Actually install desktop file.

* Tue Feb 15 2011 Devrim Gündüz <devrim@gunduz.org> 1.12.2-2
- Update to 1.12.2

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Aug 3 2010 Devrim Gündüz <devrim@gunduz.org> 1.10.5-1
- Update to 1.10.5

* Wed Jul 14 2010 Dan Horák <dan@danny.cz> - 1.10.3-3
- rebuilt against wxGTK-2.8.11-2

* Tue Jun 15 2010 Michel Salim <salimma@fedoraproject.org> - 1.10.3-2
- Ship the hints files (bz #513039)

* Thu May 13 2010 Devrim Gündüz <devrim@gunduz.org> 1.10.3-1
- Update to 1.10.3

* Mon Mar 15 2010 Devrim Gündüz <devrim@gunduz.org> 1.10.2-1
- Update to 1.10.2

* Thu Dec 3 2009 Devrim Gündüz <devrim@gunduz.org> 1.10.1-1
- Update to 1.10.1

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jun 29 2009 Devrim Gündüz <devrim@gunduz.org> 1.10.0-1
- Update to 1.10.0
- Update licence
- Incorporate some changes from rpmfusion:
  Corrected pgadmin3 documentation path to avoid errors (#448)
  Re-added the branding directory for some users (RHBZ #473748)
  Removed useless -docs package, main package shipped it anyway
  Many spec file and package cleanups to get rpmlint very silent