[packages/lgeneral-data-pg] - convert data on build (Xvfb required for converter splash/"please wait" screen...)
qboosh
qboosh at pld-linux.org
Sat Sep 17 07:24:20 CEST 2016
commit e0e028a6bc1308f8fc754bc3bccc0cccf15d2e21
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Sep 17 07:25:41 2016 +0200
- convert data on build (Xvfb required for converter splash/"please wait" screen...)
lgeneral-data-pg.spec | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
---
diff --git a/lgeneral-data-pg.spec b/lgeneral-data-pg.spec
index 9e71c11..d321df8 100644
--- a/lgeneral-data-pg.spec
+++ b/lgeneral-data-pg.spec
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_without convert # Convert data to LGeneral format
+#
Summary: Panzer General game data files for LGeneral game
Summary(pl.UTF-8): Pliki danych gry Panzer General dla gry LGeneral
Name: lgeneral-data-pg
@@ -10,6 +14,12 @@ Group: Applications/Games
Source0: http://downloads.sourceforge.net/lgeneral/pg-data.tar.gz
# Source0-md5: 40c4be23f60d1dc732aabe13b58fc5e3
URL: http://lgames.sourceforge.net/LGeneral
+%if %{with convert}
+BuildRequires: lgeneral-tools
+BuildRequires: xorg-xserver-Xvfb
+%endif
+Requires: lgeneral >= 1.3
+Obsoletes: lgeneral-data < 1.2
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -20,9 +30,33 @@ General. This package contains Panzer General data files for the game.
LGeneral jest turową grą strategiczną zainspirowaną o Panzer General.
Ten pakiet zawiera pliki z danymi Panzer General dla tej gry.
+%package source
+Summary: Panzer General game data in original form
+Summary(pl.UTF-8): Dane gry Panzer General w oryginalnej postaci
+Group: Applications/Games
+Suggests: lgeneral-tools
+
+%description source
+Panzer General game data in original form.
+
+%description source -l pl.UTF-8
+Dane gry Panzer General w oryginalnej postaci.
+
%prep
%setup -q -c
+%build
+%if %{with convert}
+install -d lgeneral/{gfx/{flags,terrain,units},maps,nations,scenarios,sounds,units}
+
+DISP=$(( (RANDOM % 87) + 31 ))
+/usr/bin/Xvfb :$DISP &
+XVFB_PID=$!
+[ -n "$XVFB_PID" ] || exit 1
+DISPLAY=:$DISP lgc-pg -s pg-data -d lgeneral
+kill $XVFB_PID
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_datadir}/lgeneral
@@ -30,10 +64,29 @@ install -d $RPM_BUILD_ROOT%{_datadir}/lgeneral
cp -r pg-data $RPM_BUILD_ROOT%{_datadir}/lgeneral
%{__rm} $RPM_BUILD_ROOT%{_datadir}/lgeneral/pg-data/README
+%if %{with convert}
+cp -pr lgeneral/* $RPM_BUILD_ROOT%{_datadir}/lgeneral
+%endif
+
%clean
rm -rf $RPM_BUILD_ROOT
+%if %{with convert}
%files
%defattr(644,root,root,755)
%doc pg-data/README
+%{_datadir}/lgeneral/gfx/flags/pg.bmp
+%{_datadir}/lgeneral/gfx/terrain/pg
+%{_datadir}/lgeneral/gfx/units/pg*.bmp
+%{_datadir}/lgeneral/maps/pg
+%{_datadir}/lgeneral/maps/pg.tdb
+%{_datadir}/lgeneral/nations/pg.ndb
+%{_datadir}/lgeneral/scenarios/pg
+%{_datadir}/lgeneral/sounds/pg
+%{_datadir}/lgeneral/units/pg.udb
+%endif
+
+%files source
+%defattr(644,root,root,755)
+%doc pg-data/README
%{_datadir}/lgeneral/pg-data
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/lgeneral-data-pg.git/commitdiff/e0e028a6bc1308f8fc754bc3bccc0cccf15d2e21
More information about the pld-cvs-commit
mailing list