1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
|
---
Makefile.am | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
README.autotools | 41 ++++++++++++++++
autogen.sh | 8 +++
bzip2.pc.in | 11 ++++
bzlib.h | 4 +
configure.ac | 62 ++++++++++++++++++++++++
m4/visibility.m4 | 78 +++++++++++++++++++++++++++++++
7 files changed, 340 insertions(+), 1 deletion(-)
Index: bzip2-1.0.8/Makefile.am
===================================================================
--- /dev/null
+++ bzip2-1.0.8/Makefile.am
@@ -0,0 +1,137 @@
+ACLOCAL_AMFLAGS = -I m4
+lib_LTLIBRARIES = libbz2.la
+AM_CFLAGS = $(CFLAG_VISIBILITY)
+libbz2_la_SOURCES = \
+ blocksort.c \
+ huffman.c \
+ crctable.c \
+ randtable.c \
+ compress.c \
+ decompress.c \
+ bzlib.c
+
+libbz2_la_LDFLAGS = \
+ -version-info $(BZIP2_LT_CURRENT):$(BZIP2_LT_REVISION):$(BZIP2_LT_AGE) \
+ -no-undefined
+
+include_HEADERS = bzlib.h
+
+noinst_HEADERS = bzlib_private.h
+
+bin_PROGRAMS = bzip2 bzip2recover
+
+bzip2_SOURCES = bzip2.c
+bzip2_LDADD = libbz2.la
+
+bzip2recover_SOURCES = bzip2recover.c
+bzip2recover_LDADD = libbz2.la
+
+bin_SCRIPTS = bzgrep bzmore bzdiff
+
+man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = bzip2.pc
+
+$(pkgconfig_DATA): $(srcdir)/bzip2.pc.in config.status
+
+install-exec-hook:
+ rm -f $(DESTDIR)$(bindir)/`echo "bunzip2" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`
+ rm -f $(DESTDIR)$(bindir)/`echo "bzcat" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`
+ rm -f $(DESTDIR)$(bindir)/`echo "bzegrep" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`
+ rm -f $(DESTDIR)$(bindir)/`echo "bzfgrep" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`
+ rm -f $(DESTDIR)$(bindir)/`echo "bzless" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`
+ rm -f $(DESTDIR)$(bindir)/`echo "bzcmp" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`
+ $(LN_S) `echo "bzip2" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(bindir)/`echo "bunzip2" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`
+ $(LN_S) `echo "bzip2" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(bindir)/`echo "bzcat" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`
+ $(LN_S) `echo "bzgrep" | sed 's,^.*/,,;$(transform)'` $(DESTDIR)$(bindir)/`echo "bzegrep" | sed 's,^.*/,,;$(transform)'`
+ $(LN_S) `echo "bzgrep" | sed 's,^.*/,,;$(transform)'` $(DESTDIR)$(bindir)/`echo "bzfgrep" | sed 's,^.*/,,;$(transform)'`
+ $(LN_S) `echo "bzmore" | sed 's,^.*/,,;$(transform)'` $(DESTDIR)$(bindir)/`echo "bzless" | sed 's,^.*/,,;$(transform)'`
+ $(LN_S) `echo "bzdiff" | sed 's,^.*/,,;$(transform)'` $(DESTDIR)$(bindir)/`echo "bzcmp" | sed 's,^.*/,,;$(transform)'`
+
+install-data-hook:
+ echo ".so man1/`echo "bzip2" | sed 's,^.*/,,;$(transform)'`.1" >$(DESTDIR)$(mandir)/man1/`echo "bunzip2" | sed 's,^.*/,,;$(transform)'`.1
+ echo ".so man1/`echo "bzip2" | sed 's,^.*/,,;$(transform)'`.1" >$(DESTDIR)$(mandir)/man1/`echo "bzcat" | sed 's,^.*/,,;$(transform)'`.1
+ echo ".so man1/`echo "bzgrep" | sed 's,^.*/,,;$(transform)'`.1" >$(DESTDIR)$(mandir)/man1/`echo "bzegrep" | sed 's,^.*/,,;$(transform)'`.1
+ echo ".so man1/`echo "bzgrep" | sed 's,^.*/,,;$(transform)'`.1" >$(DESTDIR)$(mandir)/man1/`echo "bzfgrep" | sed 's,^.*/,,;$(transform)'`.1
+ echo ".so man1/`echo "bzmore" | sed 's,^.*/,,;$(transform)'`.1" >$(DESTDIR)$(mandir)/man1/`echo "bzless" | sed 's,^.*/,,;$(transform)'`.1
+ echo ".so man1/`echo "bzdiff" | sed 's,^.*/,,;$(transform)'`.1" >$(DESTDIR)$(mandir)/man1/`echo "bzcmp" | sed 's,^.*/,,;$(transform)'`.1
+
+uninstall-hook:
+ rm -f $(DESTDIR)$(bindir)/`echo "bunzip2" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`
+ rm -f $(DESTDIR)$(bindir)/`echo "bzcat" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`
+ rm -f $(DESTDIR)$(bindir)/`echo "bzegrep" | sed 's,^.*/,,;$(transform)'`
+ rm -f $(DESTDIR)$(bindir)/`echo "bzfgrep" | sed 's,^.*/,,;$(transform)'`
+ rm -f $(DESTDIR)$(bindir)/`echo "bzless" | sed 's,^.*/,,;$(transform)'`
+ rm -f $(DESTDIR)$(bindir)/`echo "bzcmp" | sed 's,^.*/,,;$(transform)'`
+ rm -f $(DESTDIR)$(mandir)/man1/`echo "bunzip2" | sed 's,^.*/,,;$(transform)'`.1
+ rm -f $(DESTDIR)$(mandir)/man1/`echo "bzcat" | sed 's,^.*/,,;$(transform)'`.1
+ rm -f $(DESTDIR)$(mandir)/man1/`echo "bzegrep" | sed 's,^.*/,,;$(transform)'`.1
+ rm -f $(DESTDIR)$(mandir)/man1/`echo "bzfgrep" | sed 's,^.*/,,;$(transform)'`.1
+ rm -f $(DESTDIR)$(mandir)/man1/`echo "bzless" | sed 's,^.*/,,;$(transform)'`.1
+ rm -f $(DESTDIR)$(mandir)/man1/`echo "bzcmp" | sed 's,^.*/,,;$(transform)'`.1
+
+test: bzip2
+ @cat $(srcdir)/words1
+ ./bzip2 -1 <$(srcdir)/sample1.ref >sample1.rb2
+ ./bzip2 -2 <$(srcdir)/sample2.ref >sample2.rb2
+ ./bzip2 -3 <$(srcdir)/sample3.ref >sample3.rb2
+ ./bzip2 -d <$(srcdir)/sample1.bz2 >sample1.tst
+ ./bzip2 -d <$(srcdir)/sample2.bz2 >sample2.tst
+ ./bzip2 -ds <$(srcdir)/sample3.bz2 >sample3.tst
+ cmp $(srcdir)/sample1.bz2 sample1.rb2
+ cmp $(srcdir)/sample2.bz2 sample2.rb2
+ cmp $(srcdir)/sample3.bz2 sample3.rb2
+ cmp sample1.tst $(srcdir)/sample1.ref
+ cmp sample2.tst $(srcdir)/sample2.ref
+ cmp sample3.tst $(srcdir)/sample3.ref
+ @cat $(srcdir)/words3
+
+manual: $(srcdir)/manual.html $(srcdir)/manual.ps $(srcdir)/manual.pdf
+
+manual.ps: $(MANUAL_SRCS)
+ cd $(srcdir); ./xmlproc.sh -ps manual.xml
+
+manual.pdf: $(MANUAL_SRCS)
+ cd $(srcdir); ./xmlproc.sh -pdf manual.xml
+
+manual.html: $(MANUAL_SRCS)
+ cd $(srcdir); ./xmlproc.sh -html manual.xml
+
+EXTRA_DIST = \
+ $(bin_SCRIPTS) \
+ $(man_MANS) \
+ README.autotools \
+ README.XML.STUFF \
+ bz-common.xsl \
+ bz-fo.xsl \
+ bz-html.xsl \
+ bzip.css \
+ bzip2.1.preformatted \
+ bzip2.pc.in \
+ bzip2.txt \
+ dlltest.c \
+ dlltest.dsp \
+ entities.xml \
+ format.pl \
+ libbz2.def \
+ libbz2.dsp \
+ makefile.msc \
+ manual.html \
+ manual.pdf \
+ manual.ps \
+ manual.xml \
+ mk251.c \
+ sample1.bz2 \
+ sample1.ref \
+ sample2.bz2 \
+ sample2.ref \
+ sample3.bz2 \
+ sample3.ref \
+ spewG.c \
+ unzcrash.c \
+ words0 \
+ words1 \
+ words2 \
+ words3 \
+ xmlproc.sh
Index: bzip2-1.0.8/README.autotools
===================================================================
--- /dev/null
+++ bzip2-1.0.8/README.autotools
@@ -0,0 +1,41 @@
+bzip2 autoconfiscated
+=====================
+
+Temporarily at http://ftp.suse.com/pub/people/sbrabec/bzip2/ expecting
+that it will become a new upstream version to prevent per-distribution
+shared library patching done by nearly each Linux vendor separately.
+
+Autoconfiscation brings standard ./configure ; make ; make install
+installation, seamless support of DESTDIR, automatic check for supported
+CFLAGS, standard shared library support, automatic large files CFLAGS
+check and all things that are supported by automake.
+
+It makes obsolete Makefile-libbz2_so and README.COMPILATION.PROBLEMS.
+Now configure should automatically detect correct build flags.
+
+In case of any problem or question with autotools support feel free to
+contact me: Stanislav Brabec <sbrabec@suse.cz>
+
+Autoconfiscated version binaries are exactly equal to
+bzip2-1.0.6.tar.gz. There are only few changes. See below.
+
+
+New features:
+
+Trivial link man pages for bzcat and bunzip2 added.
+
+bzip2.pc file for pkg-config. Packages can use it for checks.
+
+
+Incompatible changes:
+
+soname change. Libtool has no support for two parts soname suffix (e. g.
+libbz2.so.1.0). It must be a single number (e. g. libbz2.so.1). That is
+why soname must change. But I see not a big problem with it. Several
+distributions already use the new number instead of the non-standard
+number from Makefile-libbz2_so.
+
+Shared library exports only public symbols.
+
+To be super-safe, I incremented minor number of the library file, so
+both instances of the shared library can live together.
Index: bzip2-1.0.8/autogen.sh
===================================================================
--- /dev/null
+++ bzip2-1.0.8/autogen.sh
@@ -0,0 +1,8 @@
+mv LICENSE COPYING
+mv CHANGES NEWS
+touch AUTHORS
+touch ChangeLog
+libtoolize --force
+aclocal
+automake --add-missing --gnu
+autoconf
Index: bzip2-1.0.8/bzip2.pc.in
===================================================================
--- /dev/null
+++ bzip2-1.0.8/bzip2.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: bzip2
+Description: Lossless, block-sorting data compression
+Version: @VERSION@
+Libs: -L${libdir} -lbz2
+Cflags: -I${includedir}
Index: bzip2-1.0.8/bzlib.h
===================================================================
--- bzip2-1.0.8.orig/bzlib.h
+++ bzip2-1.0.8/bzlib.h
@@ -91,9 +91,11 @@ typedef
# endif
#else
# define BZ_API(func) func
-# define BZ_EXTERN extern
#endif
+#ifndef BZ_EXTERN
+#define BZ_EXTERN extern
+#endif
/*-- Core (low-level) library functions --*/
Index: bzip2-1.0.8/configure.ac
===================================================================
--- /dev/null
+++ bzip2-1.0.8/configure.ac
@@ -0,0 +1,62 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.57])
+AC_INIT([bzip2], [1.0.8], [Julian Seward <jseward@bzip.org>])
+BZIP2_LT_CURRENT=1
+BZIP2_LT_REVISION=6
+BZIP2_LT_AGE=0
+AC_CONFIG_SRCDIR([bzlib.h])
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE([foreign subdir-objects])
+AM_MAINTAINER_MODE
+
+# Checks for programs.
+AC_PROG_AWK
+AC_PROG_CC_STDC
+AC_PROG_CC_C_O
+AC_USE_SYSTEM_EXTENSIONS
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+LT_INIT([disable-static pic-only])
+PKG_PROG_PKG_CONFIG
+gl_VISIBILITY
+# Checks for libraries.
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+
+# Check for system features.
+AC_SYS_LARGEFILE
+
+AC_MSG_CHECKING([whether compiler understands -Wall])
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wall"
+AC_TRY_COMPILE([], [], [
+ AC_MSG_RESULT([yes])
+], [
+ AC_MSG_RESULT([no])
+ CFLAGS="$save_CFLAGS"
+])
+
+AC_MSG_CHECKING([whether compiler understands -Winline])
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Winline"
+AC_TRY_COMPILE([], [], [
+ AC_MSG_RESULT([yes])
+], [
+ AC_MSG_RESULT([no])
+ CFLAGS="$save_CFLAGS"
+])
+
+# Checks for library functions.
+
+# Write the output.
+AC_SUBST([BZIP2_LT_CURRENT])
+AC_SUBST([BZIP2_LT_REVISION])
+AC_SUBST([BZIP2_LT_AGE])
+AC_CONFIG_FILES([Makefile bzip2.pc])
+AC_OUTPUT
Index: bzip2-1.0.8/m4/visibility.m4
===================================================================
--- /dev/null
+++ bzip2-1.0.8/m4/visibility.m4
@@ -0,0 +1,78 @@
+# visibility.m4 serial 4 (gettext-0.18.2)
+dnl Copyright (C) 2005, 2008, 2010-2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl MacOS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ CFLAG_VISIBILITY=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ dnl First, check whether -Werror can be added to the command line, or
+ dnl whether it leads to an error because of some other option that the
+ dnl user has put into $CC $CFLAGS $CPPFLAGS.
+ AC_MSG_CHECKING([whether the -Werror option is usable])
+ AC_CACHE_VAL([gl_cv_cc_vis_werror], [
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_vis_werror=yes],
+ [gl_cv_cc_vis_werror=no])
+ CFLAGS="$gl_save_CFLAGS"])
+ AC_MSG_RESULT([$gl_cv_cc_vis_werror])
+ dnl Now check whether visibility declarations are supported.
+ AC_MSG_CHECKING([for simple visibility declarations])
+ AC_CACHE_VAL([gl_cv_cc_visibility], [
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ dnl We use the option -Werror and a function dummyfunc, because on some
+ dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+ dnl "visibility attribute not supported in this configuration; ignored"
+ dnl at the first function definition in every compilation unit, and we
+ dnl don't want to use the option in this case.
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void) {}
+ ]],
+ [[]])],
+ [gl_cv_cc_visibility=yes],
+ [gl_cv_cc_visibility=no])
+ CFLAGS="$gl_save_CFLAGS"])
+ AC_MSG_RESULT([$gl_cv_cc_visibility])
+ if test $gl_cv_cc_visibility = yes; then
+ CFLAG_VISIBILITY="-fvisibility=hidden"
+ HAVE_VISIBILITY=1
+ AC_DEFINE([BZ_EXTERN], [__attribute__((__visibility__("default")))], [To make symbol visible])
+ fi
+ fi
+ AC_SUBST([CFLAG_VISIBILITY])
+ AC_SUBST([HAVE_VISIBILITY])
+ AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+ [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
|