File gramps.spec of Package gramps
#
# spec file for package gramps
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2010 Dominique Leuenberger, Amsterdam, Netherlands.
#
# 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 http://bugs.opensuse.org/
#
%global __requires_exclude typelib\\(GtkosxApplication\\)|typelib\\(Gtkspell\\)|typelib\\(Glib\\)
Name: gramps
Version: 5.0.2
Release: 0
# FIXME: missing recommends because of missing packages: python-exiv2
Summary: Genealogical Research Software
License: GPL-2.0+
Group: Productivity/Other
Url: http://www.gramps-project.org/
Source: https://github.com/gramps-project/gramps/archive/v%{version}/%{name}-%{version}.tar.gz
Source100: %{name}-rpmlintrc
# PATCH-FIX-OPENSUSE gramps-no-translations-check.patch boo#941490 dimstar@opensuse.org -- Do not warn on missing translations
Patch0: gramps-no-translations-check.patch
BuildRequires: fdupes
BuildRequires: intltool
BuildRequires: python3
# need to build doc
BuildRequires: python3-setuptools
BuildRequires: python3-attrs
BuildRequires: python3-Sphinx
BuildRequires: python3-bsddb3
BuildRequires: python3-PyICU
# For directory ownership
BuildRequires: gnome-icon-theme
# Needed for typelib() - Requires.
BuildRequires: gobject-introspection
BuildRequires: python-gtk-devel
BuildRequires: libosmgpsmap-devel
# We need the %%mime_database_* macros
BuildRequires: shared-mime-info
BuildRequires: update-desktop-files
Requires: gtk3-lang
Requires: gnome-icon-theme
Requires: python3-bsddb3
Requires: python3-cairo
Requires: python3-gobject
###Requires: typelib-1_0-WebKit-3_0
Requires: xdg-utils
Recommends: %{name}-lang
Recommends: graphviz
Recommends: python-gtkspell
Recommends: python-webkitgtk
Recommends: python3-PyICU
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
Gramps gives you the ability to record the many details of an
individual's life as well as the complex relationships between
various people, places and events. All of your research is kept
organized, searchable and as precise as you need it to be.
%lang_package
%prep
%setup -q
%patch0 -p1
%build
python3 setup.py build
# make docs
pushd docs
make html
%if 0%{suse_version} > 1310
rm _build/html/.buildinfo
%endif
popd
%install
python3 setup.py install --root="%{buildroot}"
# fix resource-path containing buildroot information
echo -n %{_datadir} > %{buildroot}%{python3_sitelib}/gramps/gen/utils/resource-path
# fix script-without-shebang
chmod -x %{buildroot}%{_datadir}/%{name}/css/*.css
# Application Registry is obsolete since GNOME 2.8.
rm -r %{buildroot}%{_datadir}/mime-info
# Icon is installed in a non-default location
# We package those files as package docs...
rm -r %{buildroot}%{_datadir}/doc/%{name}/
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
mv %{buildroot}%{_datadir}/icons/gramps.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
%suse_update_desktop_file -r %{name} Office Database
%find_lang %{name} %{?no_lang_C}
%fdupes %{buildroot}%{_datadir}
%post
%desktop_database_post
%icon_theme_cache_post
%icon_theme_cache_post gnome
%mime_database_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%icon_theme_cache_postun gnome
%mime_database_postun
%files
%defattr (-,root,root)
%license COPYING
%doc AUTHORS FAQ NEWS README.md docs/_build/html
%{_bindir}/%{name}
%{_datadir}/%{name}/
%dir %{_datadir}/metainfo
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/icons/gnome/*/mimetypes/gnome-mime-application-x-gedcom.*
%{_datadir}/icons/gnome/*/mimetypes/gnome-mime-application-x-geneweb.*
%{_datadir}/icons/gnome/*/mimetypes/gnome-mime-application-x-%{name}*.*
%{_datadir}/mime/packages/%{name}.xml
%{python3_sitelib}/%{name}/
%{python3_sitelib}/%{name}-%{version}-*.egg-info
%{_mandir}/man1/%{name}.1%{?ext_man}
# We can't really move the localized manpages to the lang package, since they'd
# create a conflict between the lang subpackage and bundles
%lang(cs) %{_mandir}/cs/man1/%{name}.*
%lang(fr) %{_mandir}/fr/man1/%{name}.*
%lang(nl) %{_mandir}/nl/man1/%{name}.*
%lang(pl) %{_mandir}/pl/man1/%{name}.*
%lang(sv) %{_mandir}/sv/man1/%{name}.*
%lang(pt_BR) %{_mandir}/pt_BR/man1/%{name}.*
# man doesn't provide those directories, so we have to own them
%lang(cs) %dir %{_mandir}/cs
%lang(cs) %dir %{_mandir}/cs/man1
%lang(nl) %dir %{_mandir}/nl
%lang(nl) %dir %{_mandir}/nl/man1
%lang(pl) %dir %{_mandir}/pl
%lang(pl) %dir %{_mandir}/pl/man1
%lang(sv) %dir %{_mandir}/sv
%lang(sv) %dir %{_mandir}/sv/man1
%lang(pt_BR) %dir %{_mandir}/pt_BR
%lang(pt_BR) %dir %{_mandir}/pt_BR/man1
%files lang -f %{name}.lang
%changelog