292 lines
9.5 KiB
RPMSpec
292 lines
9.5 KiB
RPMSpec
%define _hardened_build 1
|
|
Name: liquidwar
|
|
Version: 5.6.4
|
|
Release: 20%{?dist}
|
|
Summary: Multiplayer wargame with liquid armies
|
|
Group: Amusements/Games
|
|
License: GPLv2+
|
|
URL: http://www.ufoot.org/liquidwar/v5
|
|
Source0: http://download.savannah.nongnu.org/releases/%{name}/%{name}-%{version}.tar.gz
|
|
#Source1: liquidwar.init
|
|
Source2: liquidwar.sysconfig
|
|
Source3: liquidwar.logrotate
|
|
Source4: liquidwar-server.service
|
|
Patch0: liquidwar-5.6.4-srv-overflow.patch
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
BuildRequires: allegro-devel allegro-tools tetex-latex python texinfo
|
|
BuildRequires: desktop-file-utils
|
|
Requires: hicolor-icon-theme
|
|
Requires(post): /sbin/install-info
|
|
Requires(preun): /sbin/install-info
|
|
|
|
%description
|
|
Liquid War is a unique multiplayer wargame. You control an army of liquid
|
|
and have to try and eat your opponents. A single player mode is available,
|
|
but the game is definitely designed to be multiplayer, and has network
|
|
support.
|
|
|
|
|
|
%package doc
|
|
Summary: Documentation for the LiquidWar game in additional formats
|
|
Group: Documentation
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
%description doc
|
|
This package contains the documentation of LiquidWar in html, pdf, ps and txt
|
|
format.
|
|
|
|
|
|
%package server
|
|
Summary: Network game server for the LiquidWar game
|
|
Group: Amusements/Games
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires(pre): /usr/sbin/useradd
|
|
#Requires(post): /sbin/chkconfig
|
|
#Requires(preun): /sbin/chkconfig /sbin/service
|
|
#Requires(postun): /sbin/service
|
|
Requires(post): systemd-units
|
|
Requires(preun): systemd-units
|
|
Requires(postun): systemd-units
|
|
|
|
|
|
%description server
|
|
This package contains the server for hosting network LiquidWar games.
|
|
|
|
|
|
%prep
|
|
%setup -q
|
|
|
|
%patch0 -p0 -b .overflow
|
|
|
|
# don't strip the binaries please
|
|
sed -i 's/install\(\s\+-c\)\?\s\+-s/install/g' Makefile.in
|
|
# fix README.* encoding
|
|
for i in de dk fr; do
|
|
iconv -f ISO-8859-1 -t UTF8 README.$i > $i
|
|
mv $i README.$i
|
|
done
|
|
|
|
|
|
%build
|
|
%configure --disable-target-opt \
|
|
%ifnarch %{ix86}
|
|
--disable-asm \
|
|
%endif
|
|
LDFLAGS="%{__global_ldflags}"
|
|
CFLAGS="$RPM_OPT_FLAGS"
|
|
LDFLAGS="$LDFLAGS -lm"
|
|
|
|
MAKE_FLAGS="DEBUG_FLAGS= GAMEDIR=%{_bindir} DATADIR=%{_datadir}/%{name}"
|
|
# to show to compile flags with out MAKE_FLAGS
|
|
make config $MAKE_FLAGS LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS"
|
|
make %{?_smp_mflags} $MAKE_FLAGS LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS"
|
|
|
|
# make docs utf-8
|
|
iconv -f ISO-8859-1 -t UTF8 doc/man/%{name}.6 | gzip > doc/man/%{name}.6.gz
|
|
gzip -cd doc/info/%{name}.info.gz | \
|
|
iconv -f ISO-8859-1 -t UTF8 > doc/info/%{name}.info
|
|
gzip -f doc/info/%{name}.info
|
|
|
|
|
|
%install
|
|
rm -rf $RPM_BUILD_ROOT
|
|
make install_nolink DESTDIR=$RPM_BUILD_ROOT GAMEDIR=%{_bindir} \
|
|
DATADIR=%{_datadir}/%{name}
|
|
mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name} liquidwardocs
|
|
rm $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.xpm
|
|
|
|
# below is the desktop file and icon stuff.
|
|
desktop-file-install --delete-original \
|
|
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
|
|
--add-category StrategyGame \
|
|
--remove-category Application \
|
|
--remove-category ArcadeGame \
|
|
$RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
|
|
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/{32x32,48x48}/apps
|
|
install -p -m 644 misc/%{name}_32x32.xpm \
|
|
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/%{name}.xpm
|
|
install -p -m 644 misc/%{name}.xpm \
|
|
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/%{name}.xpm
|
|
|
|
#install -p -D -m 755 %%{SOURCE1} \
|
|
# $RPM_BUILD_ROOT/%%{_initrddir}/%%{name}-server
|
|
install -p -D -m 755 %{SOURCE4} \
|
|
$RPM_BUILD_ROOT/%{_unitdir}/%{name}-server.service
|
|
install -p -D -m 644 %{SOURCE2} \
|
|
$RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/%{name}-server
|
|
install -p -D -m 644 %{SOURCE3} \
|
|
$RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/%{name}-server
|
|
|
|
|
|
%clean
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
%post
|
|
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
|
|
touch --no-create %{_datadir}/icons/hicolor || :
|
|
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
|
|
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
|
|
fi
|
|
|
|
%preun
|
|
if [ $1 = 0 ]; then
|
|
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
|
|
fi
|
|
|
|
%postun
|
|
touch --no-create %{_datadir}/icons/hicolor || :
|
|
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
|
|
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
|
|
fi
|
|
|
|
|
|
%pre server
|
|
user_uid=`id -u %{name} 2>/dev/null`
|
|
if [ x"$user_uid" = x ] ; then
|
|
/usr/sbin/useradd -r -s /sbin/nologin -d %{_datadir}/%{name} -M \
|
|
-c 'LiquidWar Server' \
|
|
%{name} >/dev/null || :
|
|
fi
|
|
|
|
%post server
|
|
#/sbin/chkconfig --add %%{name}-server
|
|
if [ $1 -eq 1 ] ; then
|
|
# Initial installation
|
|
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
|
fi
|
|
|
|
|
|
%preun server
|
|
#if [ "$1" -le "0" ]; then
|
|
# /sbin/service %%{name}-server stop > /dev/null 2>&1
|
|
# /sbin/chkconfig --del %%{name}-server
|
|
#fi
|
|
if [ $1 -eq 0 ] ; then
|
|
# Package removal, not upgrade
|
|
/bin/systemctl --no-reload disable liquidwar-server.service > /dev/null 2>&1 || :
|
|
/bin/systemctl stop liquidwar-server.service > /dev/null 2>&1 || :
|
|
fi
|
|
|
|
|
|
%postun server
|
|
#if [ "$1" -ge "1" ]; then
|
|
# /sbin/service %%{name}-server condrestart > /dev/null 2>&1
|
|
#fi
|
|
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
|
if [ $1 -ge 1 ] ; then
|
|
# Package upgrade, not uninstall
|
|
/bin/systemctl try-restart liquidwar-service.service >/dev/null 2>&1 || :
|
|
fi
|
|
|
|
%triggerun -- liquidwar-server < 5.6.4-11
|
|
# Save the current service runlevel info
|
|
# User must manually run systemd-sysv-convert --apply httpd
|
|
# to migrate them to systemd targets
|
|
/usr/bin/systemd-sysv-convert --save liquidwar-server >/dev/null 2>&1 ||:
|
|
|
|
# Run these because the SysV package being removed won't do them
|
|
/sbin/chkconfig --del liquidwar-server >/dev/null 2>&1 || :
|
|
/bin/systemctl try-restart liquidwar-server.service >/dev/null 2>&1 || :
|
|
|
|
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%doc COPYING README
|
|
%{_bindir}/%{name}
|
|
%{_bindir}/%{name}-mapgen
|
|
%{_datadir}/%{name}
|
|
%{_infodir}/%{name}.*
|
|
%{_mandir}/man6/%{name}.6.gz
|
|
%{_mandir}/man6/%{name}-mapgen.6.gz
|
|
%{_datadir}/applications/%{name}.desktop
|
|
%{_datadir}/icons/hicolor/*/apps/%{name}.xpm
|
|
|
|
%files doc
|
|
%defattr(-,root,root,-)
|
|
%doc liquidwardocs/*
|
|
|
|
%files server
|
|
%{_bindir}/%{name}-server
|
|
%{_mandir}/man6/%{name}-server.6.gz
|
|
#%%{_initrddir}/%%{name}-server
|
|
%{_unitdir}/liquidwar-server.service
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-server
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-server
|
|
|
|
|
|
%changelog
|
|
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.6.4-20
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
|
|
|
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.6.4-19
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
|
|
|
* Thu Aug 08 2013 Jon Ciesla <limburgher@gmail.com> - 5.6.4-18
|
|
- Fix reference to docdir, BZ 993858.
|
|
|
|
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.6.4-17
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
|
|
|
* Thu Apr 25 2013 Jon Ciesla <limburgher@gmail.com> - 5.6.4-16
|
|
- Add PIE, BZ 955271.
|
|
|
|
* Mon Feb 11 2013 Jon Ciesla <limburgher@gmail.com> - 5.6.4-15
|
|
- Drop desktop vendor tag.
|
|
|
|
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.6.4-14
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
|
|
|
* Fri Apr 13 2012 Jon Ciesla <limburgher@gmail.com> - 5.6.4-13
|
|
- Add hardened build.
|
|
|
|
* Mon Apr 09 2012 Jon Ciesla <limburgher@gmail.com> - 5.6.4-12
|
|
- Patch for server buffer overflow, BZ 810607.
|
|
- Changed unit file to simple.
|
|
|
|
* Mon Feb 13 2012 Jon Ciesla <limburgher@gmail.com> - 5.6.4-11
|
|
- Migrated to systemd, BZ 789757.
|
|
|
|
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.6.4-10
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
|
|
|
* Fri Jul 15 2011 Jon Ciesla <limb@jcomserv.net> - 5.6.4-9
|
|
- Bump and rebuild for new Allegro.
|
|
|
|
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.6.4-8
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
|
|
|
* Mon Jun 28 2010 Jon Ciesla <limb@jcomserv.net> - 5.6.4-7
|
|
- FTBFS fix, BZ 599842.
|
|
|
|
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.6.4-6
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
|
|
|
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.6.4-5
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
|
|
|
* Tue Apr 1 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 5.6.4-4
|
|
- Add missing BuildRequires: desktop-file-utils
|
|
|
|
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 5.6.4-3
|
|
- Autorebuild for GCC 4.3
|
|
|
|
* Wed Dec 12 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 5.6.4-2
|
|
- Fix generation of debuginfo package (bz 413081)
|
|
- Fix encoding of README.* files
|
|
|
|
* Mon Oct 22 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 5.6.4-1
|
|
- New upstream release 5.6.4
|
|
|
|
* Mon Aug 13 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 5.6.3-4
|
|
- Update License tag for new Licensing Guidelines compliance
|
|
|
|
* Sat Mar 10 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 5.6.3-3
|
|
- Fixup .desktop file categories for games-menus usage
|
|
|
|
* Thu Nov 23 2006 Wart <wart@kobold.org> 5.6.3-2
|
|
- Added init.d startup and logrotate scripts for the game server
|
|
- Put the game server in its own subpackage
|
|
|
|
* Sun Nov 19 2006 Hans de Goede <j.w.r.degoede@hhs.nl> 5.6.3-1
|
|
- Initial Fedora Extras package
|