LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File hedgewars.spec of Package hedgewars (Project games)

#
# spec file for package hedgewars
#
# Copyright (c) 2014 SUSE LINUX Products 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/
#


%define _no_server 0
%define _no_ffmpeg 1

Name:           hedgewars
Version:        0.9.20.5
Release:        0
Summary:        Turn-based artillery game, featuring fighting Hedgehogs
License:        GPL-2.0
Group:          Amusements/Games/Strategy/Turn Based
Url:            http://www.hedgewars.org/
Source:         http://download.gna.org/hedgewars/hedgewars-src-%{version}.tar.bz2
%if 0%{?suse_version} < 1120
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%endif
BuildRequires:  SDL-devel
BuildRequires:  SDL_image-devel
BuildRequires:  SDL_mixer-devel
BuildRequires:  SDL_net-devel
BuildRequires:  SDL_ttf-devel
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  fpc
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  glibc-devel
BuildRequires:  gmp-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  libffi-devel
BuildRequires:  libopenssl-devel
# enable DPHYSFS_SYSTEM once released and packaged
#BuildRequires:  libphysfs-devel >= 2.1.0
BuildRequires:  lzma
BuildRequires:  qt-devel
BuildRequires:  shared-mime-info
%if 0%{?suse_version} > 1210
BuildRequires:  lua51-devel
%else
BuildRequires:  lua-devel >= 5.1
%endif
BuildRequires:  update-desktop-files
BuildRequires:  zlib-devel
Requires:       %{name}-data = %{version}
Recommends:     %{name}-server = %{version}

# to build server
%if %{_no_server} == 0
BuildRequires:  ghc
BuildRequires:  ghc-bytestring-show-devel
BuildRequires:  ghc-dataenc-devel
BuildRequires:  ghc-deepseq-devel
BuildRequires:  ghc-hslogger-devel
BuildRequires:  ghc-network-devel
BuildRequires:  ghc-random-devel
BuildRequires:  ghc-time-devel
BuildRequires:  ghc-utf8-string-devel
BuildRequires:  ghc-vector-devel
%endif

%description
Hedgewars is a turn based artillery game where slow moving hedgehocks fight
each other with over the top weaponary. It can be played both online and
rotational on the same computer.

%package data
Summary:        Turn-based artillery game, featuring fighting Hedgehogs
Group:          Amusements/Games/Strategy/Turn Based
Requires:       %{name} = %{version}
%if 0%{?suse_version} >= 1120
BuildArch:      noarch
%endif

%description data
Hedgewars is a turn based artillery game where slow moving hedgehocks fight
each other with over the top weaponary. It can be played both online and
rotational on the same computer.

This package contains all the data files for hedgewars.

%if %{_no_server} == 0
%package server
Summary:        A turn based strategy game
Group:          Amusements/Games/Strategy/Turn Based
Requires:       %{name}-data = %{version}

%description server
Hedgewars is a turn based artillery game where slow moving hedgehocks fight
each other with over the top weaponary. It can be played both online and
rotational on the same computer.

This package contains a standalone local hedgewars server.
%endif

%prep
%setup -q -n %{name}-src-0.9.20

%build
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
      -DCMAKE_C_FLAGS:STRING="%{optflags}" \
      -DCMAKE_CXX_FLAGS:STRING="%{optflags}" \
      -DDATA_INSTALL_DIR=%{_datadir}/%{name} \
      -DLIB_INSTALL_DIR=%{_lib} \
      -DNOVIDEOREC=%{_no_ffmpeg} \
      -DNOSERVER=%{_no_server} \
      -DPHYSFS_SYSTEM=OFF \
      -DCMAKE_BUILD_TYPE=Release ..
make %{?_smp_mflags}

%install
cd build
make DESTDIR=%{buildroot} install
cd ..
install -D -m 0644 man/%{name}.6 %{buildroot}%{_mandir}/man6/%{name}.6
install -D -m 0644 misc/hedgewars_ico.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
mkdir -p  %{buildroot}%{_datadir}/applications/
mv %{buildroot}%{_datadir}/%{name}/Data/misc/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
mkdir -p  %{buildroot}%{_datadir}/mime/packages
mv %{buildroot}%{_datadir}/%{name}/Data/misc/hedgewars-mimeinfo.xml %{buildroot}%{_datadir}/mime/packages/%{name}.xml

# TODO: $LIB_INSTALL_DIR seems to be ignored.
%ifarch x86_64
mkdir -p %{buildroot}%{_libdir}
mv %{buildroot}/usr/lib/* %{buildroot}%{_libdir}/
%endif

%suse_update_desktop_file %{name}
%fdupes %{buildroot}%{_datadir}

%post
/sbin/ldconfig
%desktop_database_post
%icon_theme_cache_post
%mime_database_post

%postun
/sbin/ldconfig
%desktop_database_postun
%icon_theme_cache_postun
%mime_database_postun

%files
%defattr(-,root,root)
%doc README ChangeLog.txt Fonts_LICENSE.txt
%doc %{_mandir}/man6/*
%{_datadir}/applications/*.desktop
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{_bindir}/%{name}
%{_bindir}/hwengine
# ugly, but necessary:
%{_libdir}/libhwphysfs.so
%{_libdir}/libhwphysfs.so.1
%{_libdir}/libhwphysfs.so.2.1.0
%{_libdir}/libphyslayer.so

%files data
%defattr(-,root,root)
%{_datadir}/%{name}/

%if %{_no_server} == 0
%files server
%defattr(-,root,root)
%{_bindir}/%{name}-server
%endif

%changelog