[Freeciv-Dev] Re: (PR#12048) RFC: make zlib manditory
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12048 >
Vasco Alexandre da Silva Costa wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12048 >
>
> On Sun, 30 Jan 2005, Per I. Mathisen wrote:
>
>
>><URL: http://bugs.freeciv.org/Ticket/Display.html?id=12048 >
>>
>>On Sat, 29 Jan 2005, Jason Short wrote:
>>
>>>So, can we compress the scenario files?
>>
>>Well, I'm not opposed, but I suspect the reason they are not also has
>>something to do with cvs handling text files better. You know, you can get
>>diffs of past changes and such.
>
> Agreed, but this doesn't mean they can't be compressed in the distributed
> tarballs.
How about this patch?
It does compression at compile time. This means the gzip program is a
requirement for compilation. We could do compression at precompile time
(like packets_gen) but then we'd have to distribute both versions of the
scenario files.
-jason
Index: configure.ac
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.ac,v
retrieving revision 1.92
diff -u -r1.92 configure.ac
--- configure.ac 27 Jan 2005 02:14:40 -0000 1.92
+++ configure.ac 30 Jan 2005 17:12:28 -0000
@@ -332,6 +332,10 @@
AC_CHECK_HEADER(zlib.h, ,
AC_MSG_ERROR([zlib found but not zlib.h.
You may need to install a zlib \"development\" package.]))
+AC_PATH_PROG(GZIP, gzip, "no")
+if test "$GZIP" = "no"; then
+ AC_MSG_ERROR([You need the gzip program for compilation.])
+fi
dnl Check and compile ftwl
if test "$ftwl" = x11 ; then
Index: data/scenario/.cvsignore
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/scenario/.cvsignore,v
retrieving revision 1.2
diff -u -r1.2 .cvsignore
--- data/scenario/.cvsignore 13 Apr 2002 13:59:31 -0000 1.2
+++ data/scenario/.cvsignore 30 Jan 2005 17:12:29 -0000
@@ -1,2 +1,3 @@
Makefile
Makefile.in
+*.sav.gz
Index: data/scenario/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/scenario/Makefile.am,v
retrieving revision 1.5
diff -u -r1.5 Makefile.am
--- data/scenario/Makefile.am 24 Jun 2002 14:15:27 -0000 1.5
+++ data/scenario/Makefile.am 30 Jan 2005 17:12:29 -0000
@@ -1,14 +1,31 @@
## Process this file with automake to produce Makefile.in
+zipped_files = \
+ british-isles-85x80-v2.80.sav.gz \
+ earth-160x90-v2.sav.gz \
+ earth-80x50-v2.sav.gz \
+ europe-200x100-v2.sav.gz \
+ hagworld-120x60-v1.2.sav.gz \
+ iberian-peninsula-136x100-v1.0.sav.gz
+
+unzipped_files = \
+ british-isles-85x80-v2.80.sav \
+ earth-160x90-v2.sav \
+ earth-80x50-v2.sav \
+ europe-200x100-v2.sav \
+ hagworld-120x60-v1.2.sav \
+ iberian-peninsula-136x100-v1.0.sav
+
+
## Override automake so that "make install" puts these in proper place:
pkgdatadir = $(datadir)/@PACKAGE@/scenario
+pkgdata_DATA = $(zipped_files)
-pkgdata_DATA = \
- british-isles-85x80-v2.80.sav \
- earth-160x90-v2.sav \
- earth-80x50-v2.sav \
- europe-200x100-v2.sav \
- hagworld-120x60-v1.2.sav \
- iberian-peninsula-136x100-v1.0.sav
+$(zipped_files): %.sav.gz: %.sav
+ $(GZIP) --best -c $< > $@
+
+.PHONY: clean
+clean:
+ rm $(zipped_files)
-EXTRA_DIST = $(pkgdata_DATA)
+EXTRA_DIST = $(unzipped_files)
|
|