[packages/lgeneral] - explicit autotools usage, verbose files
qboosh
qboosh at pld-linux.org
Sat Sep 10 09:57:31 CEST 2016
commit 232b0ac95e72a0fc774908eb961c41de535705b1
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Sep 10 09:53:27 2016 +0200
- explicit autotools usage, verbose files
lgeneral-format.patch | 40 +++++++++++++++++++++++++++++++
lgeneral-hash.patch | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++
lgeneral.spec | 56 +++++++++++++++++++++++++++++++++-----------
3 files changed, 148 insertions(+), 13 deletions(-)
---
diff --git a/lgeneral.spec b/lgeneral.spec
index e35909d..f753a35 100644
--- a/lgeneral.spec
+++ b/lgeneral.spec
@@ -10,12 +10,16 @@ Source0: http://downloads.sourceforge.net/lgeneral/%{name}-%{version}.tar.gz
Source1: http://downloads.sourceforge.net/lgeneral/pg-data.tar.gz
# Source1-md5: 40c4be23f60d1dc732aabe13b58fc5e3
Source2: %{name}.desktop
-URL: http://lgames.sourceforge.net/index.php?project=LGeneral
-BuildRequires: SDL_mixer-devel >= 1.1.4
+Patch0: %{name}-hash.patch
+Patch1: %{name}-format.patch
+URL: http://lgames.sourceforge.net/LGeneral
+BuildRequires: SDL-devel >= 1.1.4
+BuildRequires: SDL_mixer-devel
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-tools
BuildRequires: sed >= 4.0
+Requires: SDL >= 1.1.4
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -33,17 +37,22 @@ drugiemu graczowi lub komputerowi. Gra posiada dużo zaawansowanych
opcji jak na przykład wpływ pogody na warunki walki.
%prep
-%setup -q -a 1
+%setup -q -a1
+#patch0 -p1 # if using updated intl/
+%patch1 -p1
+
%{__sed} -i 's at games/@@' configure.in
-#Maybe somebody know better way?
-cp %{_datadir}/gettext/config.rpath .
%build
+# cannot use gettextize (po/ is hacked), so just
+cp -f %{_datadir}/gettext/config.rpath .
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
%configure
-%{__make} -j1 \
- ACLOCAL="%{__aclocal}" \
- AUTOMAKE="%{__automake}"
+%{__make} -j1
%install
rm -rf $RPM_BUILD_ROOT
@@ -54,8 +63,9 @@ install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
install %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
cp -r pg-data $RPM_BUILD_ROOT%{_datadir}/%{name}
-mv $RPM_BUILD_ROOT%{_iconsdir}/{lgeneral48.png,lgeneral.png}
+%{__mv} $RPM_BUILD_ROOT%{_iconsdir}/{lgeneral48.png,lgeneral.png}
+# lgeneral,pg domains
%find_lang %{name} --all-name
%clean
@@ -81,9 +91,29 @@ fi
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc AUTHORS ChangeLog README.lg* TODO
-%attr(755,root,root) %{_bindir}/*
-%{_datadir}/%{name}
+%doc AUTHORS ChangeLog PanzerGeneral-Guru.txt README.{lgc-pg,lgeneral} TODO
+%attr(755,root,root) %{_bindir}/lgc-pg
+%attr(755,root,root) %{_bindir}/lged
+%attr(755,root,root) %{_bindir}/lgeneral
+%attr(755,root,root) %{_bindir}/ltrextract
+%attr(755,root,root) %{_bindir}/shptool
+%dir %{_datadir}/lgeneral
+%dir %{_datadir}/lgeneral/ai_modules
+%dir %{_datadir}/lgeneral/campaigns
+%{_datadir}/lgeneral/campaigns/PG
+%{_datadir}/lgeneral/convdata
+%{_datadir}/lgeneral/gfx
+%dir %{_datadir}/lgeneral/maps
+%dir %{_datadir}/lgeneral/music
+%dir %{_datadir}/lgeneral/nations
+%{_datadir}/lgeneral/pg-data
+%dir %{_datadir}/lgeneral/scenarios
+%dir %{_datadir}/lgeneral/sounds
+%dir %{_datadir}/lgeneral/terrain
+%dir %{_datadir}/lgeneral/themes
+%{_datadir}/lgeneral/themes/default
+%dir %{_datadir}/lgeneral/units
%{_desktopdir}/%{name}.desktop
-%{_mandir}/man[16]/*.*
+%{_mandir}/man1/lgc-pg.1*
+%{_mandir}/man6/lgeneral.6*
%{_iconsdir}/%{name}.png
diff --git a/lgeneral-format.patch b/lgeneral-format.patch
new file mode 100644
index 0000000..bb7ba9d
--- /dev/null
+++ b/lgeneral-format.patch
@@ -0,0 +1,40 @@
+--- lgeneral-1.2.2/lgc-pg/units.c.orig 2011-08-10 20:07:59.000000000 +0200
++++ lgeneral-1.2.2/lgc-pg/units.c 2016-09-09 21:24:21.508368910 +0200
+@@ -550,7 +550,7 @@
+ }
+ }
+ /* get flags */
+- sprintf( flags, unit_classes[entry.class * 3 + 2] );
++ strcpy( flags, unit_classes[entry.class * 3 + 2] );
+ if ( apply_unit_mods ) {
+ i = 0;
+ while ( add_flags[i*2][0] != 'X' ) {
+--- lgeneral-1.2.2/src/engine.c.orig 2011-08-05 11:37:44.000000000 +0200
++++ lgeneral-1.2.2/src/engine.c 2016-09-09 21:25:55.975034497 +0200
+@@ -2311,7 +2311,7 @@
+ if ( gui->module_dlg->subdir[0] != 0 )
+ sprintf( path, "%s/%s", gui->module_dlg->subdir, (char*)gui->module_dlg->lbox->cur_item );
+ else
+- sprintf( path, (char*)gui->module_dlg->lbox->cur_item );
++ strcpy( path, (char*)gui->module_dlg->lbox->cur_item );
+ free( setup.modules[gui->setup->sel_id] );
+ setup.modules[gui->setup->sel_id] = strdup( path );
+ gui_handle_player_select( gui->setup->list->cur_item );
+@@ -2756,7 +2756,7 @@
+ result = gui_get_message_pane_selection(camp_pane);
+ if (result && strcmp(result, "nextscen") == 0) {
+ /* start scenario */
+- sprintf( setup.fname, camp_cur_scen->scen );
++ strcpy( setup.fname, camp_cur_scen->scen );
+ setup.type = SETUP_DEFAULT_SCEN;
+ end_scen = 1;
+ *reinit = 1;
+@@ -4243,7 +4243,7 @@
+ }
+ else {
+ /* next scenario */
+- sprintf( setup.fname, camp_cur_scen->scen );
++ strcpy( setup.fname, camp_cur_scen->scen );
+ setup.type = SETUP_CAMP_BRIEFING;
+ reinit = 1;
+ }
diff --git a/lgeneral-hash.patch b/lgeneral-hash.patch
new file mode 100644
index 0000000..c6dde32
--- /dev/null
+++ b/lgeneral-hash.patch
@@ -0,0 +1,65 @@
+--- lgeneral-1.3.1/tools/ltrextract/util.c.orig 2013-05-03 19:17:34.000000000 +0200
++++ lgeneral-1.3.1/tools/ltrextract/util.c 2016-09-09 22:22:56.191662113 +0200
+@@ -26,7 +26,7 @@
+
+ #include "util.h"
+
+-#include "intl/hash-string.h"
++#include "util/localize.h"
+ #include "util/hashtable.h"
+ #include "util/hashtable_itr.h"
+
+--- lgeneral-1.3.1/util/localize.c.orig 2013-05-03 19:17:37.000000000 +0200
++++ lgeneral-1.3.1/util/localize.c 2016-09-09 22:22:38.928328978 +0200
+@@ -28,8 +28,6 @@
+ #include "hashtable.h"
+ #include "paths.h"
+
+-#include "intl/hash-string.h"
+-
+ #include <assert.h>
+ #include <locale.h>
+ #include <stdlib.h>
+@@ -231,4 +229,30 @@ void locale_init(const char *lang) {
+ #endif
+ }
+
++/* Defines the so called `hashpjw' function by P.J. Weinberger
++ [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
++ 1986, 1987 Bell Telephone Laboratories, Inc.] */
++#define HASHWORDBITS 32
++unsigned long int
++hash_string (const char *str_param)
++{
++ unsigned long int hval, g;
++ const char *str = str_param;
++
++ /* Compute the hash value for the given string. */
++ hval = 0;
++ while (*str != '\0')
++ {
++ hval <<= 4;
++ hval += (unsigned char) *str++;
++ g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
++ if (g != 0)
++ {
++ hval ^= g >> (HASHWORDBITS - 8);
++ hval ^= g;
++ }
++ }
++ return hval;
++}
++
+ /* kate: tab-indents on; space-indent on; replace-tabs off; indent-width 2; dynamic-word-wrap off; inden(t)-mode cstyle */
+--- lgeneral-1.3.1/util/localize.h.orig 2013-05-03 19:17:37.000000000 +0200
++++ lgeneral-1.3.1/util/localize.h 2016-09-09 22:21:47.598329561 +0200
+@@ -72,6 +72,9 @@ void locale_write_ordinal_number(char *b
+ */
+ void locale_init(const char *lang);
+
++unsigned long int
++hash_string (const char *str_param);
++
+ #endif /*UTIL_LOCALIZE_H*/
+
+ /* kate: tab-indents on; space-indent on; replace-tabs off; indent-width 2; dynamic-word-wrap off; inden(t)-mode cstyle */
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/lgeneral.git/commitdiff/232b0ac95e72a0fc774908eb961c41de535705b1
More information about the pld-cvs-commit
mailing list