widelands/widelands.spec

115 lines
3.3 KiB
RPMSpec

Name: widelands
Version: 15
Release: 1
Summary: Open source realtime-strategy game
Group: Amusements/Games
License: GPLv2+
URL: http://www.widelands.org
Source0: http://launchpad.net/widelands/build%{version}/build%{version}/+download/%{name}-build%{version}-src.tar.bz2
Source1: %{name}.desktop
Patch0: %{name}-localedir.patch
Patch1: %{name}-constructor.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build
BuildRequires: gcc-c++
BuildRequires: boost-devel
BuildRequires: SDL_mixer-devel
BuildRequires: SDL_image-devel
BuildRequires: SDL_net-devel
BuildRequires: SDL_ttf-devel
BuildRequires: SDL_gfx-devel
BuildRequires: libpng-devel
BuildRequires: libjpeg-devel
BuildRequires: libtiff-devel
BuildRequires: zlib-devel
BuildRequires: ggz-client-libs-devel
BuildRequires: lua-devel
BuildRequires: python-devel
BuildRequires: cmake
BuildRequires: gettext
BuildRequires: optipng
BuildRequires: fdupes
BuildRequires: doxygen
BuildRequires: update-desktop-files
Requires: %{name}-data = %{version}
%description
Widelands is an open source (GPLed), realtime-strategy game, using SDL and
other free libraries, which is still under development. Widelands is inspired
by Settlers II (Bluebyte) and is partly similar to it, so if you know it, you
perhaps will have a thought, what Widelands is all about.
%package data
Summary: Data files for Widelands
Group: Amusements/Games
License: GPLv2+
Requires: %{name} = %{version}
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
%description data
Data files for Widelands.
%prep
%setup -q -n %{name}-build%{version}-src
%patch0
%patch1
%build
# recreate build_and_run.sh contents here
mkdir -p build/compile/locale
ln -s build/compile/locale
cd build/compile
cmake \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DWL_INSTALL_PREFIX=%{_prefix} \
-DWL_INSTALL_BINDIR=bin \
-DWL_INSTALL_DATADIR=share/%{name} \
-DWL_INSTALL_LOCALEDIR=%{_datadir}/%{name}/locale \
-DBUILD_SHARED_LIBS=ON \
-DBoost_USE_STATIC_LIBS=OFF \
../..
make %{?_smp_mflags}
%install
cd build/compile
make DESTDIR=$RPM_BUILD_ROOT install
cd ../..
for i in 16 32 48 64 128; do
install -D -m 0644 pics/wl-ico-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
done
install -D -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file %{name}
%fdupes $RPM_BUILD_ROOT%{_datadir}
%find_lang %{name} --all-name
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc COPYING CREDITS ChangeLog
%{_bindir}/%{name}
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/128x128
%dir %{_datadir}/icons/hicolor/128x128/apps
%dir %{_datadir}/icons/hicolor/16x16
%dir %{_datadir}/icons/hicolor/16x16/apps
%dir %{_datadir}/icons/hicolor/32x32
%dir %{_datadir}/icons/hicolor/32x32/apps
%dir %{_datadir}/icons/hicolor/48x48
%dir %{_datadir}/icons/hicolor/48x48/apps
%dir %{_datadir}/icons/hicolor/64x64
%dir %{_datadir}/icons/hicolor/64x64/apps
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%files data -f %{name}.lang
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/locale
# skip locale subdir, included in .lang file
%{_datadir}/%{name}/[^l]*
%changelog