0001-Autotoolize-bzip2.patch (12031B)
1 From 46685016e52d29f9997d8639decd2158f3f7a3d7 Mon Sep 17 00:00:00 2001 2 From: Arjan van de Ven <arjan@linux.intel.com> 3 Date: Fri, 6 Sep 2019 10:42:46 -0700 4 Subject: [PATCH 1/2] Autotoolize bzip2. 5 6 --- 7 Makefile | 217 --------------------------------------------- 8 Makefile-libbz2_so | 59 ------------ 9 Makefile.am | 47 ++++++++++ 10 bzip2.pc.in | 11 +++ 11 configure.ac | 35 ++++++++ 12 5 files changed, 93 insertions(+), 276 deletions(-) 13 delete mode 100644 Makefile 14 delete mode 100644 Makefile-libbz2_so 15 create mode 100644 Makefile.am 16 create mode 100644 bzip2.pc.in 17 create mode 100644 configure.ac 18 19 diff --git a/Makefile b/Makefile 20 deleted file mode 100644 21 index f8a1772..0000000 22 --- a/Makefile 23 +++ /dev/null 24 @@ -1,217 +0,0 @@ 25 -# ------------------------------------------------------------------ 26 -# This file is part of bzip2/libbzip2, a program and library for 27 -# lossless, block-sorting data compression. 28 -# 29 -# bzip2/libbzip2 version 1.0.8 of 13 July 2019 30 -# Copyright (C) 1996-2019 Julian Seward <jseward@acm.org> 31 -# 32 -# Please read the WARNING, DISCLAIMER and PATENTS sections in the 33 -# README file. 34 -# 35 -# This program is released under the terms of the license contained 36 -# in the file LICENSE. 37 -# ------------------------------------------------------------------ 38 - 39 -SHELL=/bin/sh 40 - 41 -# To assist in cross-compiling 42 -CC=gcc 43 -AR=ar 44 -RANLIB=ranlib 45 -LDFLAGS= 46 - 47 -BIGFILES=-D_FILE_OFFSET_BITS=64 48 -CFLAGS=-Wall -Winline -O2 -g $(BIGFILES) 49 - 50 -# Where you want it installed when you do 'make install' 51 -PREFIX=/usr/local 52 - 53 - 54 -OBJS= blocksort.o \ 55 - huffman.o \ 56 - crctable.o \ 57 - randtable.o \ 58 - compress.o \ 59 - decompress.o \ 60 - bzlib.o 61 - 62 -all: libbz2.a bzip2 bzip2recover test 63 - 64 -bzip2: libbz2.a bzip2.o 65 - $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2 66 - 67 -bzip2recover: bzip2recover.o 68 - $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o 69 - 70 -libbz2.a: $(OBJS) 71 - rm -f libbz2.a 72 - $(AR) cq libbz2.a $(OBJS) 73 - @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \ 74 - -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \ 75 - echo $(RANLIB) libbz2.a ; \ 76 - $(RANLIB) libbz2.a ; \ 77 - fi 78 - 79 -check: test 80 -test: bzip2 81 - @cat words1 82 - ./bzip2 -1 < sample1.ref > sample1.rb2 83 - ./bzip2 -2 < sample2.ref > sample2.rb2 84 - ./bzip2 -3 < sample3.ref > sample3.rb2 85 - ./bzip2 -d < sample1.bz2 > sample1.tst 86 - ./bzip2 -d < sample2.bz2 > sample2.tst 87 - ./bzip2 -ds < sample3.bz2 > sample3.tst 88 - cmp sample1.bz2 sample1.rb2 89 - cmp sample2.bz2 sample2.rb2 90 - cmp sample3.bz2 sample3.rb2 91 - cmp sample1.tst sample1.ref 92 - cmp sample2.tst sample2.ref 93 - cmp sample3.tst sample3.ref 94 - @cat words3 95 - 96 -install: bzip2 bzip2recover 97 - if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi 98 - if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi 99 - if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi 100 - if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi 101 - if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi 102 - cp -f bzip2 $(PREFIX)/bin/bzip2 103 - cp -f bzip2 $(PREFIX)/bin/bunzip2 104 - cp -f bzip2 $(PREFIX)/bin/bzcat 105 - cp -f bzip2recover $(PREFIX)/bin/bzip2recover 106 - chmod a+x $(PREFIX)/bin/bzip2 107 - chmod a+x $(PREFIX)/bin/bunzip2 108 - chmod a+x $(PREFIX)/bin/bzcat 109 - chmod a+x $(PREFIX)/bin/bzip2recover 110 - cp -f bzip2.1 $(PREFIX)/man/man1 111 - chmod a+r $(PREFIX)/man/man1/bzip2.1 112 - cp -f bzlib.h $(PREFIX)/include 113 - chmod a+r $(PREFIX)/include/bzlib.h 114 - cp -f libbz2.a $(PREFIX)/lib 115 - chmod a+r $(PREFIX)/lib/libbz2.a 116 - cp -f bzgrep $(PREFIX)/bin/bzgrep 117 - ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep 118 - ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep 119 - chmod a+x $(PREFIX)/bin/bzgrep 120 - cp -f bzmore $(PREFIX)/bin/bzmore 121 - ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless 122 - chmod a+x $(PREFIX)/bin/bzmore 123 - cp -f bzdiff $(PREFIX)/bin/bzdiff 124 - ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp 125 - chmod a+x $(PREFIX)/bin/bzdiff 126 - cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1 127 - chmod a+r $(PREFIX)/man/man1/bzgrep.1 128 - chmod a+r $(PREFIX)/man/man1/bzmore.1 129 - chmod a+r $(PREFIX)/man/man1/bzdiff.1 130 - echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1 131 - echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1 132 - echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1 133 - echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1 134 - 135 -clean: 136 - rm -f *.o libbz2.a bzip2 bzip2recover \ 137 - sample1.rb2 sample2.rb2 sample3.rb2 \ 138 - sample1.tst sample2.tst sample3.tst 139 - 140 -blocksort.o: blocksort.c 141 - @cat words0 142 - $(CC) $(CFLAGS) -c blocksort.c 143 -huffman.o: huffman.c 144 - $(CC) $(CFLAGS) -c huffman.c 145 -crctable.o: crctable.c 146 - $(CC) $(CFLAGS) -c crctable.c 147 -randtable.o: randtable.c 148 - $(CC) $(CFLAGS) -c randtable.c 149 -compress.o: compress.c 150 - $(CC) $(CFLAGS) -c compress.c 151 -decompress.o: decompress.c 152 - $(CC) $(CFLAGS) -c decompress.c 153 -bzlib.o: bzlib.c 154 - $(CC) $(CFLAGS) -c bzlib.c 155 -bzip2.o: bzip2.c 156 - $(CC) $(CFLAGS) -c bzip2.c 157 -bzip2recover.o: bzip2recover.c 158 - $(CC) $(CFLAGS) -c bzip2recover.c 159 - 160 - 161 -distclean: clean 162 - rm -f manual.ps manual.html manual.pdf 163 - 164 -DISTNAME=bzip2-1.0.8 165 -dist: check manual 166 - rm -f $(DISTNAME) 167 - ln -s -f . $(DISTNAME) 168 - tar cvf $(DISTNAME).tar \ 169 - $(DISTNAME)/blocksort.c \ 170 - $(DISTNAME)/huffman.c \ 171 - $(DISTNAME)/crctable.c \ 172 - $(DISTNAME)/randtable.c \ 173 - $(DISTNAME)/compress.c \ 174 - $(DISTNAME)/decompress.c \ 175 - $(DISTNAME)/bzlib.c \ 176 - $(DISTNAME)/bzip2.c \ 177 - $(DISTNAME)/bzip2recover.c \ 178 - $(DISTNAME)/bzlib.h \ 179 - $(DISTNAME)/bzlib_private.h \ 180 - $(DISTNAME)/Makefile \ 181 - $(DISTNAME)/LICENSE \ 182 - $(DISTNAME)/bzip2.1 \ 183 - $(DISTNAME)/bzip2.1.preformatted \ 184 - $(DISTNAME)/bzip2.txt \ 185 - $(DISTNAME)/words0 \ 186 - $(DISTNAME)/words1 \ 187 - $(DISTNAME)/words2 \ 188 - $(DISTNAME)/words3 \ 189 - $(DISTNAME)/sample1.ref \ 190 - $(DISTNAME)/sample2.ref \ 191 - $(DISTNAME)/sample3.ref \ 192 - $(DISTNAME)/sample1.bz2 \ 193 - $(DISTNAME)/sample2.bz2 \ 194 - $(DISTNAME)/sample3.bz2 \ 195 - $(DISTNAME)/dlltest.c \ 196 - $(DISTNAME)/manual.html \ 197 - $(DISTNAME)/manual.pdf \ 198 - $(DISTNAME)/manual.ps \ 199 - $(DISTNAME)/README \ 200 - $(DISTNAME)/README.COMPILATION.PROBLEMS \ 201 - $(DISTNAME)/README.XML.STUFF \ 202 - $(DISTNAME)/CHANGES \ 203 - $(DISTNAME)/libbz2.def \ 204 - $(DISTNAME)/libbz2.dsp \ 205 - $(DISTNAME)/dlltest.dsp \ 206 - $(DISTNAME)/makefile.msc \ 207 - $(DISTNAME)/unzcrash.c \ 208 - $(DISTNAME)/spewG.c \ 209 - $(DISTNAME)/mk251.c \ 210 - $(DISTNAME)/bzdiff \ 211 - $(DISTNAME)/bzdiff.1 \ 212 - $(DISTNAME)/bzmore \ 213 - $(DISTNAME)/bzmore.1 \ 214 - $(DISTNAME)/bzgrep \ 215 - $(DISTNAME)/bzgrep.1 \ 216 - $(DISTNAME)/Makefile-libbz2_so \ 217 - $(DISTNAME)/bz-common.xsl \ 218 - $(DISTNAME)/bz-fo.xsl \ 219 - $(DISTNAME)/bz-html.xsl \ 220 - $(DISTNAME)/bzip.css \ 221 - $(DISTNAME)/entities.xml \ 222 - $(DISTNAME)/manual.xml \ 223 - $(DISTNAME)/format.pl \ 224 - $(DISTNAME)/xmlproc.sh 225 - gzip -v $(DISTNAME).tar 226 - 227 -# For rebuilding the manual from sources on my SuSE 9.1 box 228 - 229 -MANUAL_SRCS= bz-common.xsl bz-fo.xsl bz-html.xsl bzip.css \ 230 - entities.xml manual.xml 231 - 232 -manual: manual.html manual.ps manual.pdf 233 - 234 -manual.ps: $(MANUAL_SRCS) 235 - ./xmlproc.sh -ps manual.xml 236 - 237 -manual.pdf: $(MANUAL_SRCS) 238 - ./xmlproc.sh -pdf manual.xml 239 - 240 -manual.html: $(MANUAL_SRCS) 241 - ./xmlproc.sh -html manual.xml 242 diff --git a/Makefile-libbz2_so b/Makefile-libbz2_so 243 deleted file mode 100644 244 index fb0f230..0000000 245 --- a/Makefile-libbz2_so 246 +++ /dev/null 247 @@ -1,59 +0,0 @@ 248 - 249 -# This Makefile builds a shared version of the library, 250 -# libbz2.so.1.0.8, with soname libbz2.so.1.0, 251 -# at least on x86-Linux (RedHat 7.2), 252 -# with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98). 253 -# Please see the README file for some important info 254 -# about building the library like this. 255 - 256 -# ------------------------------------------------------------------ 257 -# This file is part of bzip2/libbzip2, a program and library for 258 -# lossless, block-sorting data compression. 259 -# 260 -# bzip2/libbzip2 version 1.0.8 of 13 July 2019 261 -# Copyright (C) 1996-2019 Julian Seward <jseward@acm.org> 262 -# 263 -# Please read the WARNING, DISCLAIMER and PATENTS sections in the 264 -# README file. 265 -# 266 -# This program is released under the terms of the license contained 267 -# in the file LICENSE. 268 -# ------------------------------------------------------------------ 269 - 270 - 271 -SHELL=/bin/sh 272 -CC=gcc 273 -BIGFILES=-D_FILE_OFFSET_BITS=64 274 -CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES) 275 - 276 -OBJS= blocksort.o \ 277 - huffman.o \ 278 - crctable.o \ 279 - randtable.o \ 280 - compress.o \ 281 - decompress.o \ 282 - bzlib.o 283 - 284 -all: $(OBJS) 285 - $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS) 286 - $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8 287 - rm -f libbz2.so.1.0 288 - ln -s libbz2.so.1.0.8 libbz2.so.1.0 289 - 290 -clean: 291 - rm -f $(OBJS) bzip2.o libbz2.so.1.0.8 libbz2.so.1.0 bzip2-shared 292 - 293 -blocksort.o: blocksort.c 294 - $(CC) $(CFLAGS) -c blocksort.c 295 -huffman.o: huffman.c 296 - $(CC) $(CFLAGS) -c huffman.c 297 -crctable.o: crctable.c 298 - $(CC) $(CFLAGS) -c crctable.c 299 -randtable.o: randtable.c 300 - $(CC) $(CFLAGS) -c randtable.c 301 -compress.o: compress.c 302 - $(CC) $(CFLAGS) -c compress.c 303 -decompress.o: decompress.c 304 - $(CC) $(CFLAGS) -c decompress.c 305 -bzlib.o: bzlib.c 306 - $(CC) $(CFLAGS) -c bzlib.c 307 diff --git a/Makefile.am b/Makefile.am 308 new file mode 100644 309 index 0000000..636f6b8 310 --- /dev/null 311 +++ b/Makefile.am 312 @@ -0,0 +1,47 @@ 313 +lib_LTLIBRARIES = libbz2.la 314 + 315 +libbz2_la_LDFLAGS = -version-info 1:0:0 -Wl,-soname,libbz2.so.1.0 316 + 317 +libbz2_la_SOURCES = blocksort.c \ 318 + huffman.c \ 319 + crctable.c \ 320 + randtable.c \ 321 + compress.c \ 322 + decompress.c \ 323 + bzlib.c 324 + 325 +bin_PROGRAMS = bzip2 bzip2recover 326 + 327 +bzip2_SOURCES = bzip2.c 328 +bzip2_LDADD = libbz2.la 329 +bzip2_DEPENDENCIES = libbz2.la 330 + 331 +include_HEADERS = bzlib.h 332 + 333 +bzip2recover_SOURCES = bzip2recover.c 334 +bzip2recover_LDADD = libbz2.la 335 +bzip2recover_DEPENDENCIES = libbz2.la 336 + 337 +bin_SCRIPTS = bzgrep bzmore bzdiff 338 + 339 +man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1 340 +EXTRA_DIST = $(man_MANS) 341 + 342 +pkgconfigdir = $(libdir)/pkgconfig 343 +pkgconfig_DATA = bzip2.pc 344 + 345 +if BUILD64 346 +install-exec-hook: 347 + ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT) 348 + ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT) 349 + ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT) 350 + ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT) 351 + ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT) 352 + ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT) 353 +endif 354 + 355 +install-data-hook: 356 + echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1 357 + echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1 358 + echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1 359 + echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1 360 diff --git a/bzip2.pc.in b/bzip2.pc.in 361 new file mode 100644 362 index 0000000..78ce806 363 --- /dev/null 364 +++ b/bzip2.pc.in 365 @@ -0,0 +1,11 @@ 366 +prefix=@prefix@ 367 +exec_prefix=@exec_prefix@ 368 +bindir=@bindir@ 369 +libdir=@libdir@ 370 +includedir=@includedir@ 371 + 372 +Name: @PACKAGE_NAME@ 373 +Description: A file compression library 374 +Version: @PACKAGE_VERSION@ 375 +Libs: -L${libdir} -lbz2 376 +Cflags: -I${includedir} 377 diff --git a/configure.ac b/configure.ac 378 new file mode 100644 379 index 0000000..5269f56 380 --- /dev/null 381 +++ b/configure.ac 382 @@ -0,0 +1,35 @@ 383 +AC_PREREQ([2.57]) 384 + 385 +AC_INIT(bzip2, 1.0.8, bzip2) 386 +AM_INIT_AUTOMAKE([foreign]) 387 +AM_MAINTAINER_MODE 388 + 389 +#AM_CONFIG_HEADER(config.h) 390 + 391 +# Check for progs 392 +AC_PROG_CC 393 +AC_PROG_LIBTOOL 394 + 395 +AC_CHECK_FUNCS([strerror]) 396 +AC_CHECK_FUNCS([strrchr]) 397 +AC_CHECK_FUNCS([strstr]) 398 +AC_CHECK_FUNCS([utime]) 399 + 400 +AC_CHECK_HEADERS([fcntl.h]) 401 +AC_CHECK_HEADERS([stdlib.h]) 402 +AC_CHECK_HEADERS([string.h]) 403 +AC_CHECK_HEADERS([unistd.h]) 404 +AC_CHECK_HEADERS([utime.h]) 405 + 406 +AC_FUNC_MALLOC 407 + 408 +AC_PROG_LN_S 409 +AC_PROG_RANLIB 410 + 411 +AC_TYPE_SIZE_T 412 + 413 +AM_CONDITIONAL([BUILD64], [test x"$build" = xx86_64-generic-linux-gnu]) 414 + 415 +AC_CONFIG_FILES([Makefile bzip2.pc]) 416 + 417 +AC_OUTPUT 418 -- 419 2.23.0 420