File pgmodeler.spec of Package pgModeler
#
# spec file for package pgmodeler
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: pgmodeler
Version: 1.2.1
Release: 0
Summary: PostgreSQL Database Modeler
License: GPL-3.0-only
Group: Productivity/Databases/Tools
URL: http://www.pgmodeler.com.br/
Source: https://github.com/pgmodeler/pgmodeler/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: %{name}.desktop
Source2: pgmodeler-mime-dbm.xml
Patch1: %{name}.patch
# for convert 300x300 logo file to 256x256
BuildRequires: ImageMagick
BuildRequires: desktop-file-utils
BuildRequires: gettext
BuildRequires: cmake(Qt6Network)
BuildRequires: cmake(Qt6PrintSupport)
BuildRequires: cmake(Qt6Core)
BuildRequires: qt6-core-private-devel
BuildRequires: cmake(Qt6Svg)
BuildRequires: libxml2-devel
BuildRequires: postgresql-devel
BuildRequires: pkgconfig(xext)
%if 0%{?suse_version} > 1500
BuildRequires: gcc
BuildRequires: gcc-c++
%else
BuildRequires: gcc12
BuildRequires: gcc12-c++
%endif
Requires: hicolor-icon-theme
# https://fedoraproject.org/wiki/Packaging:AppData
#BuildRequires: appstream-glib
%description
PostgreSQL Database Modeler, or simply, pgModeler is an
open source tool for modeling databases that merges the classical
concepts of entity-relationship diagrams with specific features that
only PostgreSQL implements. The pgModeler translates the models created
by the user to SQL code and apply them onto database clusters (Version
9.x).
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q
%patch -P 1 -p1
%build
export CXXFLAGS="%{optflags}"
export CC=gcc-12
export CXX=g++-12
%qmake6 -recursive \
PREFIX=%{_prefix} \
BINDIR=%{_bindir} \
PRIVATEBINDIR=%{_libexecdir} \
SHAREDIR=%{_datarootdir}/%{name} \
DOCDIR=%{_docdir}/%{name} \
PRIVATELIBDIR=%{_libdir}/%{name} \
%{name}.pro
#make %%{?_smp_mflags} CXX="g++ -std=c++11"
%make_jobs
%install
%qmake6_install
desktop-file-install --mode 644 --dir %{buildroot}%{_datadir}/applications/ %{SOURCE1}
# icon, mime and menu-entry
convert -resize 256x256 assets/conf/pgmodeler_logo.png pgmodeler_logo.png
install -p -dm 755 %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/ %{buildroot}%{_datadir}/mime/packages/
install -p -m 644 %{name}_logo.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/
install -p -m 644 %{SOURCE2} %{buildroot}%{_datadir}/mime/packages/%{name}.xml
install -Dp -m 644 %{name}.appdata.xml %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml
# ldconfig
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo %{_libdir}/%{name} > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}.conf
%post
/sbin/ldconfig
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
touch --no-create %{_datadir}/mime/packages &>/dev/null || :
update-desktop-database &> /dev/null || :
%postun
/sbin/ldconfig
if [ $1 -eq 0 ] ; then
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
update-mime-database %{_datadir}/mime &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
fi
update-desktop-database &> /dev/null || :
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
%files
%license LICENSE
%doc CHANGELOG.md README.md RELEASENOTES.md
%config %{_sysconfdir}/ld.so.conf.d/%{name}.conf
%{_bindir}/%{name}
%{_bindir}/%{name}-cli
%{_libexecdir}/%{name}-ch
%{_libexecdir}/%{name}-se
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/lib*.so.*
%{_datarootdir}/%{name}
%{_datadir}/icons/hicolor
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/appdata/%{name}.appdata.xml
%files devel
%{_libdir}/%{name}/lib*.so
%changelog