#
-%bcond_without server # build with local server
-#
-
-# there is no ghc on ppc
-%ifarch ppc
-%undefine with_server
-%endif
+# Server requires some haskel components that are not available in PLD
Summary: hedgewars - free Worms-like turn based strategy game
Summary(hu.UTF-8): hedgewars - ingyenes Worms-szerű körökre osztott stratégiai játék
Summary(pl.UTF-8): hedgewars - strategia czasu rzeczywistego podobna do Worms
Name: hedgewars
-Version: 0.9.16
-Release: 1
+Version: 1.0.2
+Release: 0.2
License: GPL v2 + Public Domain fonts
Group: X11/Applications/Games
-Source0: http://download.gna.org/hedgewars/hedgewars-src-%{version}.tar.bz2
-# Source0-md5: 04f28f454e370a101cbf0d82c6d39bce
-Patch0: %{name}-desktop.patch
-URL: http://www.hedgewars.org/
-BuildRequires: QtCore-devel >= 4.4.0
-BuildRequires: QtNetwork-devel
-BuildRequires: QtSvg-devel >= 4.4.0
-BuildRequires: SDL_image-devel >= 1.2
-BuildRequires: SDL_mixer-devel >= 1.2
-BuildRequires: SDL_net-devel >= 1.2.5
-BuildRequires: SDL_ttf-devel >= 2.0
+Source0: https://www.hedgewars.org/download/releases/%{name}-src-%{version}.tar.bz2
+# Source0-md5: 1a91a973201c91bba2a494d428cadfbf
+URL: https://www.hedgewars.org/
+BuildRequires: Qt5Core-devel
+BuildRequires: Qt5Gui-devel
+BuildRequires: Qt5Network-devel
+BuildRequires: Qt5Widgets-devel
+BuildRequires: SDL2_image-devel >= 2.0
+BuildRequires: SDL2_mixer-devel >= 2.0
+BuildRequires: SDL2_net-devel >= 2.0
+BuildRequires: SDL2_ttf-devel >= 2.0
BuildRequires: cmake >= 2.8.0
BuildRequires: desktop-file-utils
BuildRequires: fpc >= 2.2.0
-%{?with_server:BuildRequires: ghc}
-%{?with_server:BuildRequires: ghc-dataenc}
-%{?with_server:BuildRequires: ghc-hslogger}
-%{?with_server:BuildRequires: ghc-bytestring-show}
-%{?with_server:BuildRequires: gmp-devel}
+BuildRequires: libpng-devel
BuildRequires: lua51-devel
BuildRequires: openssl-devel
-BuildRequires: qt4-build
-BuildRequires: qt4-linguist
-BuildRequires: qt4-qmake
+BuildRequires: physfs-devel
+BuildRequires: qt5-build
+BuildRequires: qt5-linguist
+BuildRequires: qt5-qmake
BuildRequires: rpmbuild(macros) >= 1.577
BuildRequires: zlib-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+Requires(post,postun): desktop-file-utils
+Requires(post,postun): gtk-update-icon-cache
+Requires: hicolor-icon-theme
+
%description
Hedgewars is a free Worms-like turn based strategy game.
Hedgewars jest wolnodostępną strategią czasu rzeczywistego podobną do
Worms.
-%package server
-Summary: Network server for hedgewars
-Summary(pl.UTF-8): Sieciowy serwer dla hedgewars
-Group: X11/Applications/Games
-
-%description server
-Server for playing networked games of hedgewars.
+%post
+%update_icon_cache hicolor
+%update_desktop_database_post
-%description server -l pl.UTF-8
-Serwer do prowadzenia sieciowych gier hedgewars.
+%postun
+%update_icon_cache hicolor
+%update_desktop_database_postun
%prep
%setup -q -n %{name}-src-%{version}
-%patch0 -p1
%build
+mkdir build
+cd build
%cmake \
- %{?with_server:-DWITH_SERVER=1} \
- -DCMAKE_EXE_LINKER_FLAGS="-lz" \
- .
+ -DNOSERVER=ON \
+ -DNOVIDEOREC=ON \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ ..
+
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}}
-
+cd build
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-install misc/hedgewars.desktop $RPM_BUILD_ROOT%{_desktopdir}
-install misc/hedgewars.png $RPM_BUILD_ROOT%{_pixmapsdir}
+cp -p ../misc/hedgewars.png $RPM_BUILD_ROOT%{_pixmapsdir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README Fonts_LICENSE.txt ChangeLog.txt
+%doc README.md Fonts_LICENSE.txt ChangeLog.txt
%attr(755,root,root) %{_bindir}/hedgewars
%attr(755,root,root) %{_bindir}/hwengine
+%attr(755,root,root) %{_libdir}/libphyslayer.so
+%attr(755,root,root) %{_libdir}/libphyslayer.so.1.0
%{_datadir}/%{name}
-%{_pixmapsdir}/%{name}.png
-%{_desktopdir}/%{name}.desktop
-
-%if %{with server}
-%files server
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/hedgewars-server
-%endif
+%{_datadir}/appdata/hedgewars.appdata.xml
+%{_desktopdir}/hedgewars.desktop
+%{_pixmapsdir}/hedgewars.png
+%{_pixmapsdir}/hedgewars.xpm