File freeciv.spec of Package freeciv

#
# spec file for package freeciv
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#


Name:           freeciv
Version:        2.5.10
Release:        0
Summary:        Free Civilization Clone
License:        GPL-2.0+
Group:          Amusements/Games/Strategy/Turn Based
Url:            http://www.freeciv.org
Source0:        http://files.freeciv.org/stable/%{name}-%{version}.tar.bz2
Source1:        freeciv-gtk3.desktop
%if 0%{?suse_version} >= 1320
Source2:        freeciv-qt.desktop
%endif
Source3:        freeciv.png
Source4:        freeciv-manual
Source5:        freeciv-manual.desktop
Source6:        freeciv-manual.png
Patch0:         freeciv-appdata-desktop-references.patch
%if 0%{?suse_version} >= 1320
Patch1:         fix-qt5-detection.patch
%endif
Requires:       freeciv_client-%version
BuildRequires:  SDL_mixer-devel
BuildRequires:  audiofile-devel
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  curl-devel >= 7.9.7
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gtk3-devel
BuildRequires:  libbz2-devel
BuildRequires:  libggz2-devel
%if 0%{?suse_version} >= 1320
BuildRequires:  libqt5-qtbase-common-devel
BuildRequires:  libqt5-qtbase-devel
%endif
BuildRequires:  libtool
BuildRequires:  readline-devel
BuildRequires:  update-desktop-files
BuildRequires:  xz-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A clone of the well known game Civilization by Microprose.

Every player is the leader of an imaginary nation. The aim of the game
can be to create a prospering civilization with commerce and knowledge
exchange or (more often) the extinction of all other civilizations.

To start a new game, first start the server 'civserver,' then start the
client 'civclient'. Have fun!

%if 0%{?suse_version} >= 1320
%package qt
Summary:        Qt client for freeciv
Group:          Amusements/Games/Strategy/Turn Based
Provides:       freeciv_client-%version
Requires:       freeciv = %version

%description qt
Freeciv executable using Qt library
%endif

%package gtk3
Summary:        Gtk3 client for freeciv
Group:          Amusements/Games/Strategy/Turn Based
Provides:       freeciv_client-%version
Requires:       freeciv = %version
Obsoletes:      freeciv-gtk2

%description gtk3
Freeciv executable using Gtk3 library


%prep
%setup -q
%patch0 -p1
%if 0%{?suse_version} >= 1320
%patch1
%endif
echo "X-SuSE-translate=false" >> bootstrap/freeciv-server.desktop.in
echo "X-SuSE-translate=false" >> bootstrap/freeciv-modpack.desktop.in

%build
%if 0%{?suse_version} >= 1320
export MOCCMD="moc-qt5"
%endif
autoreconf -fi
%configure \
%if 0%{?suse_version} >= 1320
  --enable-client=gtk3,qt \
%else
  --enable-client=gtk3 \
%endif
  --with-readline \
  --disable-static \
  --docdir=%{_docdir}/freeciv
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
install -m 755 $RPM_SOURCE_DIR/freeciv-manual %{buildroot}%{_prefix}/bin
mkdir -p %{buildroot}%{_datadir}/pixmaps/
install -m 644 $RPM_SOURCE_DIR/*.png %{buildroot}%{_datadir}/pixmaps
rm %{buildroot}%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file -i %{name}-gtk3 Game StrategyGame
%if 0%{?suse_version} >= 1320
%suse_update_desktop_file -i %{name}-qt Game StrategyGame
%endif
%suse_update_desktop_file -i freeciv-manual Game StrategyGame
%if 0%{?sles_version} == 11
rm -rf %{buildroot}/%{_datadir}/locale/no
%endif

%find_lang %{name}
%find_lang %{name}-nations
%fdupes %{buildroot}/%{_datadir}/

%files -f %{name}.lang -f %{name}-nations.lang
%defattr(-,root,root)
%doc %{_docdir}/freeciv
%exclude %{_docdir}/freeciv/INSTALL*
%exclude %{_libdir}/*.a
%exclude %{_libdir}/*.la
%{_mandir}/man6/freeciv-*.6.gz
%dir %{_sysconfdir}/%{name}
%config %{_sysconfdir}/%{name}/database.lua
%{_bindir}/freeciv-server
%{_bindir}/freeciv-manual
#%{_bindir}/freeciv-modpack
%{_datadir}/applications/freeciv-manual.desktop
#%{_datadir}/applications/freeciv-modpack.desktop
%{_datadir}/applications/freeciv-server.desktop
%{_datadir}/freeciv/
%{_datadir}/icons/hicolor/128x128/apps/freeciv-client.png
%{_datadir}/icons/hicolor/128x128/apps/freeciv-server.png
%{_datadir}/icons/hicolor/128x128/apps/freeciv-modpack.png
%{_datadir}/icons/hicolor/16x16/apps/freeciv-client.png
%{_datadir}/icons/hicolor/16x16/apps/freeciv-server.png
%{_datadir}/icons/hicolor/16x16/apps/freeciv-modpack.png
%{_datadir}/icons/hicolor/32x32/apps/freeciv-client.png
%{_datadir}/icons/hicolor/32x32/apps/freeciv-server.png
%{_datadir}/icons/hicolor/32x32/apps/freeciv-modpack.png
%{_datadir}/icons/hicolor/48x48/apps/freeciv-client.png
%{_datadir}/icons/hicolor/48x48/apps/freeciv-server.png
%{_datadir}/icons/hicolor/48x48/apps/freeciv-modpack.png
%{_datadir}/icons/hicolor/64x64/apps/freeciv-client.png
%{_datadir}/icons/hicolor/64x64/apps/freeciv-server.png
%{_datadir}/icons/hicolor/64x64/apps/freeciv-modpack.png
%{_datadir}/pixmaps/freeciv-client.png
%{_datadir}/pixmaps/freeciv-manual.png
%{_datadir}/pixmaps/%{name}.png
%dir %{_datadir}/appdata
%{_datadir}/appdata/freeciv-server.appdata.xml

%files gtk3
%defattr(-,root,root)
%{_bindir}/freeciv-gtk3
%{_bindir}/freeciv-mp-gtk3
%{_datadir}/applications/%{name}-gtk3.desktop
%{_datadir}/appdata/freeciv-gtk3.appdata.xml
%{_datadir}/applications/freeciv-mp-gtk3.desktop
%{_datadir}/appdata/freeciv-mp-gtk3.appdata.xml

%if 0%{?suse_version} >= 1320
%files qt
%defattr(-,root,root)
%{_bindir}/freeciv-qt
%{_datadir}/applications/%{name}-qt.desktop
%{_datadir}/appdata/freeciv-qt.appdata.xml
%endif

%changelog
openSUSE Build Service is sponsored by