commit pbzip2 for openSUSE:Factory
Hello community, here is the log from the commit of package pbzip2 for openSUSE:Factory checked in at Wed Dec 29 00:27:56 CET 2010. -------- --- pbzip2/pbzip2.changes 2010-04-20 02:03:28.000000000 +0200 +++ /mounts/work_src_done/STABLE/pbzip2/pbzip2.changes 2010-12-20 19:51:46.000000000 +0100 @@ -1,0 +2,23 @@ +Mon Dec 20 18:45:09 UTC 2010 - pascal.bleser@opensuse.org + +- reverting to upstream release, changed version to 1.1.0+0 to be newer than 1.1.0_git... +- add patches: + * pbzip2-makefile.patch: adds support for BINDIR, MANDIR, DESTDIR and OPTFLAGS + * pbzip2-fix_printf_format.patch: fix the many printf format errors in debug and error reporting statements + * pbzip2-fix_unused_result.patch: fix not using the result value of fwrite() +- replace macros.pbzip2 with macros.pbzip2.in and a placeholder to inject the build time value of %{_bindir} +- add symbolic links to the manpage for pbunzip2 and pbzcat too, thanks to darix for pointing this out +- changed compression of upstream tarball from xz to bzip2 in order to build on older openSUSE and SLE releases + +------------------------------------------------------------------- +Thu Dec 9 23:26:46 UTC 2010 - cristian.rodriguez@opensuse.org + +- add an rpm macro file to overload %__bzip2 definition + +------------------------------------------------------------------- +Thu Dec 9 23:07:53 UTC 2010 - cristian.rodriguez@opensuse.org + +- Update to git snapshot, only difference is that Build + is now using autotools. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- pbzip2-1.1.1.tar.gz pbzip2-make-opt.diff New: ---- macros.pbzip2.in pbzip2-1.1.1.tar.bz2 pbzip2-fix_printf_format.patch pbzip2-fix_unused_result.patch pbzip2-makefile.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pbzip2.spec ++++++ --- /var/tmp/diff_new_pack.dOjx0b/_old 2010-12-29 00:22:55.000000000 +0100 +++ /var/tmp/diff_new_pack.dOjx0b/_new 2010-12-29 00:22:55.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package pbzip2 (Version 1.1.1) +# spec file for package pbzip2 (Version 1.1.1+0) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -15,20 +15,28 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild Name: pbzip2 -Version: 1.1.1 +Version: 1.1.1+0 Release: 1 +%define pkg_version 1.1.1 +License: BSD4c Summary: Parallelized Implementation of bzip2 -Source: http://compression.ca/pbzip2/pbzip2-%{version}.tar.gz -Patch1: pbzip2-make-opt.diff Url: http://compression.ca/pbzip2/ Group: Productivity/Archiving/Compression -License: BSD +# http://compression.ca/pbzip2/pbzip2-%{pkg_version}.tar.gz +Source: pbzip2-%{pkg_version}.tar.bz2 +Source1: macros.pbzip2.in +# pbleser: add support for DESTDIR, MANDIR, BINDIR and OPTFLAGS in Makefile +Patch1: pbzip2-makefile.patch +# pbleser: fix printf format specifications for size_t and such +Patch2: pbzip2-fix_printf_format.patch +# pbleser: fix not using the result value of fwrite() +Patch3: pbzip2-fix_unused_result.patch +BuildRequires: gcc-c++ +BuildRequires: libbz2-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: bzip2 gcc-c++ gzip libstdc++ libstdc++-devel make %description PBZIP2 is a parallel implementation of the bzip2 block-sorting file @@ -36,20 +44,38 @@ machines. %prep -%setup -q +%setup -q -n "%{name}-%{pkg_version}" %patch1 +%patch2 +%patch3 %build -%__make CC="%__cxx" OPTFLAGS="%{optflags}" PREFIX="%{_prefix}" +export SUSE_ASNEEDED=0 + +%__make %{?_smp_flags} \ + OPTFLAGS="%{optflags} -Wall" \ + PREFIX="%{_prefix}" \ + BINDIR="%{_bindir}" \ + MANDIR="%{_mandir}" \ + all %install -%__install -D -m 0755 pbzip2 "%{buildroot}%{_bindir}/pbzip2" -%__ln_s pbzip2 "%{buildroot}%{_bindir}/pbunzip2" -%__ln_s pbzip2 "%{buildroot}%{_bindir}/pbzcat" -%__install -D -m 0644 pbzip2.1 "%{buildroot}%{_mandir}/man1/pbzip2.1" +%__make \ + DESTDIR="%{buildroot}" \ + PREFIX="%{_prefix}" \ + BINDIR="%{_bindir}" \ + MANDIR="%{_mandir}" \ + install + +for x in pbunzip2 pbzcat; do + %__ln_s "pbzip2.1%{ext_man}" "%{buildroot}%{_mandir}/man1/${x}.1%{ext_man}" +done + +%__install -D -m 0644 "%{SOURCE1}" "%{buildroot}%{_sysconfdir}/rpm/macros.%{name}" +%__sed -i 's|@@BINDIR@@|%{_bindir}|g' "%{buildroot}%{_sysconfdir}/rpm/macros.%{name}" %clean -%__rm -rf "%{buildroot}" +%{?buildroot:%__rm -rf "%{buildroot}"} %files %defattr(-,root,root) @@ -58,10 +84,7 @@ %{_bindir}/pbunzip2 %{_bindir}/pbzcat %doc %{_mandir}/man1/pbzip2.1%{ext_man} - -# vim: set sw=3 ts=3 noet: -# Local Variables: -# mode: rpm-spec -# tab-width: 3 -# End: +%doc %{_mandir}/man1/pbunzip2.1%{ext_man} +%doc %{_mandir}/man1/pbzcat.1%{ext_man} +%config %{_sysconfdir}/rpm/macros.%{name} %changelog ++++++ macros.pbzip2.in ++++++ %__bzip2 @@BINDIR@@/pbzip2 ++++++ pbzip2-fix_printf_format.patch ++++++ --- BZ2StreamScanner.cpp.orig 2010-12-20 19:28:34.000000000 +0100 +++ BZ2StreamScanner.cpp 2010-12-20 19:33:54.000000000 +0100 @@ -488,16 +488,16 @@ void BZ2StreamScanner::printCurrentState() { - fprintf( stderr, "current=%d, search pos=%d, end pos=%d; s-c=%d" - "; out buf size=%d; out buf capacity=%d; header found=%d; search status=%d", + fprintf( stderr, "current=%ld, search pos=%ld, end pos=%ld; s-c=%ld" + "; out buf size=%u; out buf capacity=%zu; header found=%d; search status=%d", getInBuffCurrent() - getInBuffBegin(), getInBuffSearchPtr() - getInBuffBegin(), getInBuffEnd() - getInBuffBegin(), getInBuffSearchPtr() - getInBuffCurrent(), - (int)_outBuff.bufSize, - (int)_outBuffCapacity, - (int)isBz2HeaderFound(), - (int)getSearchStatus() ); + _outBuff.bufSize, + _outBuffCapacity, + isBz2HeaderFound(), + getSearchStatus() ); } /** --- pbzip2.cpp.orig 2010-12-20 19:25:32.000000000 +0100 +++ pbzip2.cpp 2010-12-20 19:31:28.000000000 +0100 @@ -898,8 +898,8 @@ // give warning to user if block is larger than 250 million bytes if (fileData->bufSize > 250000000) { - fprintf(stderr, "pbzip2: *WARNING: Compressed block size is large [%"PRIu64" bytes].\n", - (unsigned long long) fileData->bufSize); + fprintf(stderr, "pbzip2: *WARNING: Compressed block size is large [%ud bytes].\n", + fileData->bufSize); fprintf(stderr, " If program aborts, use regular BZIP2 to decompress.\n"); } } @@ -1418,7 +1418,7 @@ if (QuietMode != 1) { - fprintf(stderr, " Output Size: %"PRIu64" bytes\n", (unsigned long long)CompressedSize); + fprintf(stderr, " Output Size: %zu bytes\n", CompressedSize); } #ifdef PBZIP_DEBUG @@ -1657,7 +1657,7 @@ close(hOutfile); if (QuietMode != 1) { - fprintf(stderr, " Output Size: %"PRIu64" bytes\n", (unsigned long long)CompressedSize); + fprintf(stderr, " Output Size: %zu bytes\n", CompressedSize); } syncSetProducerDone(1); // Not really needed for direct version @@ -2357,7 +2357,7 @@ // unlikely to get here since more likely exception will be thrown if (OutputBuffer.size() != size) { - fprintf(stderr, "pbzip2: *ERROR: Could not initialize (OutputBuffer); size=%u! Aborting...\n", size); + fprintf(stderr, "pbzip2: *ERROR: Could not initialize (OutputBuffer); size=%zu! Aborting...\n", size); safe_mutex_unlock(OutMutex); exit(1); } @@ -3198,7 +3198,7 @@ #endif if (sizeof(OFF_T) <= 4) { - fprintf(stderr, "\npbzip2: *WARNING: off_t variable size only %u bits!\n", sizeof(OFF_T)*CHAR_BIT); + fprintf(stderr, "\npbzip2: *WARNING: off_t variable size only %zu bits!\n", sizeof(OFF_T)*CHAR_BIT); if (decompress == 1) fprintf(stderr, " You will only able to uncompress files smaller than 2GB in size.\n\n"); else @@ -3547,7 +3547,7 @@ if (decompress == 1) fprintf(stderr, " BWT Block Size: %c00k\n", BWTblockSizeChar); if (strcmp(InFilename, "-") != 0) - fprintf(stderr, " Input Size: %"PRIu64" bytes\n", (unsigned long long)InFileSize); + fprintf(stderr, " Input Size: %zu bytes\n", InFileSize); } if (decompress == 1) @@ -3612,7 +3612,7 @@ } if (QuietMode != 1) { - fprintf(stderr, " Output Size: %"PRIu64" bytes\n", (unsigned long long)sizeof(Bz2HeaderZero)); + fprintf(stderr, " Output Size: %zu bytes\n", sizeof(Bz2HeaderZero)); fprintf(stderr, "-------------------------------------------\n"); } // remove input file unless requested not to by user @@ -3664,7 +3664,7 @@ ret = pthread_create(&fifo->consumers[i], &ChildThreadAttributes, consumer_decompress, fifo); if (ret != 0) { - fprintf(stderr, "pbzip2: *ERROR: Not enough resources to create consumer thread #%u (code = %d) Aborting...\n", i, ret); + fprintf(stderr, "pbzip2: *ERROR: Not enough resources to create consumer thread #%zu (code = %d) Aborting...\n", i, ret); return 1; } } @@ -3726,7 +3726,7 @@ ret = pthread_create(&fifo->consumers[i], &ChildThreadAttributes, consumer, fifo); if (ret != 0) { - fprintf(stderr, "pbzip2: *ERROR: Not enough resources to create consumer thread #%u (code = %d) Aborting...\n", i, ret); + fprintf(stderr, "pbzip2: *ERROR: Not enough resources to create consumer thread #%zu (code = %d) Aborting...\n", i, ret); return 1; } } ++++++ pbzip2-fix_unused_result.patch ++++++ --- pbzip2.cpp.orig 2010-12-20 19:34:24.000000000 +0100 +++ pbzip2.cpp 2010-12-20 19:44:06.000000000 +0100 @@ -1802,7 +1802,17 @@ return ret; } if (nread > 0) - (void) fwrite (obuf, sizeof(unsigned char), nread, stream); + { + if (fwrite (obuf, sizeof(unsigned char), nread, stream) < nread) + { + fprintf(stderr, "pbzip2: *ERROR: Failed to write to output file %s. Aborting!\n", OutFilename); + if (zStream != stdin) + fclose(zStream); + if (stream != stdout) + fclose(stream); + return -1; + } + } if (ferror(stream)) { ret = testBZ2ErrorHandling(bzerr, bzf, streamNo); @@ -1817,7 +1827,17 @@ } } if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0) - (void) fwrite(obuf, sizeof(unsigned char), nread, stream ); + { + if (fwrite(obuf, sizeof(unsigned char), nread, stream ) < nread) + { + fprintf(stderr, "pbzip2: *ERROR: Failed to write to output file %s. Aborting!\n", OutFilename); + if (zStream != stdin) + fclose(zStream); + if (stream != stdout) + fclose(stream); + return -1; + } + } if (ferror(stream)) { ret = testBZ2ErrorHandling(bzerr, bzf, streamNo); ++++++ pbzip2-makefile.patch ++++++ --- Makefile.orig 2010-12-20 19:19:23.000000000 +0100 +++ Makefile 2010-12-20 19:24:30.000000000 +0100 @@ -3,7 +3,7 @@ # Compiler to use CC = g++ -CFLAGS = -O2 +CFLAGS = $(OPTFLAGS) #CFLAGS += -g -Wall #CFLAGS += -ansi #CFLAGS += -pedantic @@ -36,6 +36,9 @@ # Where you want pbzip2 installed when you do 'make install' PREFIX = /usr +DESTDIR= +BINDIR = $(PREFIX)/bin +MANDIR = $(PREFIX)/man all: pbzip2 @@ -49,15 +52,10 @@ # Install the binary pbzip2 program and man page install: pbzip2 - if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi - if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi - if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi - cp -f pbzip2 $(PREFIX)/bin/pbzip2 - chmod a+x $(PREFIX)/bin/pbzip2 - ln -s -f $(PREFIX)/bin/pbzip2 $(PREFIX)/bin/pbunzip2 - ln -s -f $(PREFIX)/bin/pbzip2 $(PREFIX)/bin/pbzcat - cp -f pbzip2.1 $(PREFIX)/man/man1 - chmod a+r $(PREFIX)/man/man1/pbzip2.1 + install -D -m0755 pbzip2 $(DESTDIR)$(BINDIR)/pbzip2 + ln -s -f pbzip2 $(DESTDIR)$(BINDIR)/pbunzip2 + ln -s -f pbzip2 $(DESTDIR)$(BINDIR)/pbzcat + install -D -m0644 pbzip2.1 $(DESTDIR)$(MANDIR)/man1/pbzip2.1 clean: rm -f *.o pbzip2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de