File crossfire.spec of Package crossfire

#
# spec file for package crossfire
#
# Copyright (c) 2021 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:           crossfire
Version:        1.75.0
Release:        0
Summary:        Game server for Crossfire
License:        GPL-2.0-only
Group:          Amusements/Games/RPG
URL:            http://crossfire.real-time.com/server/index.html
Source:         https://sourceforge.net/projects/crossfire/files/crossfire-server/%{version}/crossfire-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  pkgconfig
BuildRequires:  python3-devel
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(check)
BuildRequires:  pkgconfig(sqlite3)
Requires:       crossfire-maps >= %{version}
Requires(pre):  user(games)
Recommends:     %{name}-plugins = %{version}

%description
Game server for Crossfire.

Crossfire is a highly graphical role-playing adventure game with
characteristics reminiscent of rogue, nethack, omega, and gauntlet.
It has multiplayer capability and presently runs under X11.

%package plugins
Summary:        Extra server plugins for Crossfire
Requires:       %{name} = %{version}

%description plugins
Some extra optional plugins for Crossfire.

Crossfire is a highly graphical role-playing adventure game with
characteristics reminiscent of rogue, nethack, omega, and gauntlet.
It has multiplayer capability and presently runs under X11.

%prep
%setup -q
# Fix interpreters
sed -i "s|#!/usr/bin/env |#!%{_bindir}/|" utils/cfdb_convert utils/player_dl.pl{,.in}

%build
%configure \
  --disable-static \
  --enable-logger \
  --enable-cfrhg  \
  --enable-newspaper \
  --localstatedir=%{_localstatedir}/games

%make_build

%install
%make_install
find "%{buildroot}/%{_libdir}" -name "*.la" -delete
# Need to create an empty accounts file, else crossfire-server will segfault at start
touch %{buildroot}%{_localstatedir}/games/%{name}/accounts
%fdupes "%{buildroot}/%{_datadir}/%{name}/"

%files
%license COPYING
%doc AUTHORS README.rst
%{_bindir}/%{name}-server
%{_bindir}/cfdb_convert
%{_bindir}/crossloop
%{_bindir}/player_dl.pl
%{_datadir}/%{name}/
%dir %{_sysconfdir}/crossfire
%config %{_sysconfdir}/crossfire/*
%{_localstatedir}/games/%{name}/
%dir %{_libexecdir}/crossfire
%{_libexecdir}/crossfire/random_map
%{_datadir}/man/man6/crossfire-server.6%{?ext_man}
%{_datadir}/man/man6/crossloop.6%{?ext_man}
%{_datadir}/man/man6/crossloop.web.6%{?ext_man}
# Base plugins
%dir %{_libdir}/crossfire
%dir %{_libdir}/crossfire/plugins
%{_libdir}/crossfire/plugins/cfanim.so
%{_libdir}/crossfire/plugins/cfcitybell.so
%{_libdir}/crossfire/plugins/cfpython.so
%{_libdir}/crossfire/plugins/citylife.so

%files plugins
%{_libdir}/crossfire/plugins/cfrhg.so
%{_libdir}/crossfire/plugins/cflogger.so
%{_libdir}/crossfire/plugins/cfnewspaper.so

%changelog
openSUSE Build Service is sponsored by