Mailinglist Archive: opensuse-commit (1078 mails)

< Previous Next >
commit bzip2
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Fri, 25 May 2007 23:56:04 +0200
  • Message-id: <20070525215605.12731678183@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package bzip2
checked in at Fri May 25 23:56:04 CEST 2007.

--------
--- bzip2/bzip2.changes 2007-03-30 10:15:15.000000000 +0200
+++ /mounts/work_src_done/STABLE/bzip2/bzip2.changes    2007-05-25 23:28:24.000000000 +0200
@@ -1,0 +2,5 @@
+Fri May 25 23:28:01 CEST 2007 - dmueller@xxxxxxx
+
+- build with profile feedback enabled (7-15% speedup)
+
+-------------------------------------------------------------------

Old:
----
  bzip2-1.0.4-makefile.patch

New:
----
  rpmlintrc
  shared-lib.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ bzip2.spec ++++++
--- /var/tmp/diff_new_pack.j17467/_old  2007-05-25 23:55:52.000000000 +0200
+++ /var/tmp/diff_new_pack.j17467/_new  2007-05-25 23:55:52.000000000 +0200
@@ -12,7 +12,7 @@
 
 Name:           bzip2
 Version:        1.0.4
-Release:        9
+Release:        19
 Provides:       bzip 
 Obsoletes:      bzip
 # The following is a kludge to get updating bzip2 to after the split work
@@ -25,7 +25,8 @@
 Source:         bzip2-%{version}.tar.gz
 Source1:        bznew.gz
 Source2:        bznew.1.gz
-Patch1:         bzip2-%{version}-makefile.patch
+Source100:      rpmlintrc
+Patch1:         shared-lib.diff
 Patch2:         bzip2-maxlen20.patch
 Patch3:         bzip2-faster.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -86,20 +87,36 @@
 %patch3
 
 %build
-# -O3 really makes a difference
-RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-O2/-O3}
-make CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -Wall -Winline" libdir=%{_libdir}
+profile_bzip2()
+{
+    tmpfile=$(mktemp)
+    trap "rm -f $tmpfile $tmpfile.gz" EXIT
+    tar -cjf $tmpfile.bz2 /usr/src || true
+   # time ./bzip2 $tmpfile
+    export LD_PRELOAD=$PWD/libbz2.so
+    time ./bzip2 -d < $tmpfile.bz2 > /dev/null
+    unset LD_PRELOAD
+}
+export CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -Wall -Winline -fpic"
+%if %{do_profiling}
+make CFLAGS="$CFLAGS %{cflags_profile_generate}" LIBDIR=%{_libdir} %{?jobs:-j %jobs} bzip2
+profile_bzip2
+make clean
+make CFLAGS="$CFLAGS %{cflags_profile_feedback}" LIBDIR=%{_libdir} %{?jobs:-j %jobs} bzip2
+%endif
+make CFLAGS="$CFLAGS" LIBDIR=%{_libdir} %{?jobs:-j %jobs}
 
 %install
-make PREFIX=$RPM_BUILD_ROOT install libdir=%{_libdir}
+make PREFIX=$RPM_BUILD_ROOT%{_prefix} MANDIR=$RPM_BUILD_ROOT%{_mandir} \
+     LIBDIR=$RPM_BUILD_ROOT%{_libdir} install
 gzip -9 manual.ps
 gzip -dc %{SOURCE1} > bznew
-install -m 755 bznew      $RPM_BUILD_ROOT%{_bindir}/
-install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man1/
+install -D -m 755 bznew      $RPM_BUILD_ROOT%{_bindir}/bznew
+install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man1
 install -m 755 -d $RPM_BUILD_ROOT/%{_lib}/
-rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
-mv $RPM_BUILD_ROOT%{_libdir}/libbz2.so.* $RPM_BUILD_ROOT/%{_lib}/
-ln -sf ../../%{_lib}/libbz2.so.1.0.0 $RPM_BUILD_ROOT%{_libdir}/libbz2.so
+mv $RPM_BUILD_ROOT%{_libdir}/libbz2.so $RPM_BUILD_ROOT/%{_lib}/libbz2.so.%{version}
+ln -sf libbz2.so.%{version} $RPM_BUILD_ROOT/%{_lib}/libbz2.so.1
+ln -sf ../../%{_lib}/libbz2.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libbz2.so
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -130,6 +147,8 @@
 %{_libdir}/libbz2.so
 
 %changelog
+* Fri May 25 2007 - dmueller@xxxxxxx
+- build with profile feedback enabled (7-15%% speedup)
 * Fri Mar 30 2007 - rguenther@xxxxxxx
 - Add PreReq to libbz2 from bzip2 to work around update problems
 * Fri Mar 23 2007 - rguenther@xxxxxxx

++++++ bzip2-faster.patch ++++++
--- /var/tmp/diff_new_pack.j17467/_old  2007-05-25 23:55:53.000000000 +0200
+++ /var/tmp/diff_new_pack.j17467/_new  2007-05-25 23:55:53.000000000 +0200
@@ -1,6 +1,6 @@
---- ./bzlib_private.h.orig     2005-08-12 10:40:07.000000000 +0000
-+++ ./bzlib_private.h  2005-08-12 10:50:02.000000000 +0000
-@@ -374,6 +374,7 @@ BZ2_hbMakeCodeLengths ( UChar*, Int32*, 
+--- bzlib_private.h
++++ bzlib_private.h
+@@ -340,6 +340,7 @@
  #define MTFA_SIZE 4096
  #define MTFL_SIZE 16
  
@@ -8,7 +8,7 @@
  
  
  /*-- Structure holding all the decompression-side stuff. --*/
-@@ -441,6 +442,7 @@ typedef
+@@ -407,6 +408,7 @@
        Int32    base   [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
        Int32    perm   [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
        Int32    minLens[BZ_N_GROUPS];
@@ -16,7 +16,7 @@
  
        /* save area for scalars in the main decompress code */
        Int32    save_i;
-@@ -467,6 +469,7 @@ typedef
+@@ -433,6 +435,7 @@
        Int32*   save_gLimit;
        Int32*   save_gBase;
        Int32*   save_gPerm;
@@ -24,7 +24,7 @@
  
     }
     DState;
-@@ -516,8 +519,8 @@ extern Int32 
+@@ -482,8 +485,8 @@
  BZ2_decompress ( DState* );
  
  extern void 
@@ -35,9 +35,9 @@
  
  
  #endif
---- ./decompress.c.orig        2005-08-12 10:27:55.000000000 +0000
-+++ ./decompress.c     2005-08-12 12:08:14.188288783 +0000
-@@ -104,6 +104,9 @@ void makeMaps_d ( DState* s )
+--- decompress.c
++++ decompress.c
+@@ -64,6 +64,9 @@
           s->strm->total_in_hi32++;                \
     }
  
@@ -47,7 +47,7 @@
  #define GET_UCHAR(lll,uuu)                        \
     GET_BITS(lll,uuu,8)
  
-@@ -123,23 +126,29 @@ void makeMaps_d ( DState* s )
+@@ -83,23 +86,29 @@
        gLimit = &(s->limit[gSel][0]);              \
        gPerm = &(s->perm[gSel][0]);                \
        gBase = &(s->base[gSel][0]);                \
@@ -90,7 +90,7 @@
  
  
  /*---------------------------------------------------*/
-@@ -175,6 +184,7 @@ Int32 BZ2_decompress ( DState* s )
+@@ -135,6 +144,7 @@
     Int32* gLimit;
     Int32* gBase;
     Int32* gPerm;
@@ -98,7 +98,7 @@
  
     if (s->state == BZ_X_MAGIC_1) {
        /*initialise the save area*/
-@@ -202,6 +212,7 @@ Int32 BZ2_decompress ( DState* s )
+@@ -162,6 +172,7 @@
        s->save_gLimit      = NULL;
        s->save_gBase       = NULL;
        s->save_gPerm       = NULL;
@@ -106,7 +106,7 @@
     }
  
     /*restore from the save area*/
-@@ -229,6 +240,7 @@ Int32 BZ2_decompress ( DState* s )
+@@ -189,6 +200,7 @@
     gLimit      = s->save_gLimit;
     gBase       = s->save_gBase;
     gPerm       = s->save_gPerm;
@@ -114,7 +114,7 @@
  
     retVal = BZ_OK;
  
-@@ -380,6 +392,7 @@ Int32 BZ2_decompress ( DState* s )
+@@ -340,6 +352,7 @@
              &(s->limit[t][0]), 
              &(s->base[t][0]), 
              &(s->perm[t][0]), 
@@ -122,7 +122,7 @@
              &(s->len[t][0]),
              minLen, maxLen, alphaSize
           );
-@@ -454,6 +467,62 @@ Int32 BZ2_decompress ( DState* s )
+@@ -414,6 +427,62 @@
              if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
  
              /*-- uc = MTF ( nextSym-1 ) --*/
@@ -185,7 +185,7 @@
              {
                 Int32 ii, jj, kk, pp, lno, off;
                 UInt32 nn;
-@@ -505,6 +574,7 @@ Int32 BZ2_decompress ( DState* s )
+@@ -465,6 +534,7 @@
                    }
                 }
              }
@@ -193,7 +193,7 @@
              /*-- end uc = MTF ( nextSym-1 ) --*/
  
              s->unzftab[s->seqToUnseq[uc]]++;
-@@ -656,6 +726,7 @@ Int32 BZ2_decompress ( DState* s )
+@@ -616,6 +686,7 @@
     s->save_gLimit      = gLimit;
     s->save_gBase       = gBase;
     s->save_gPerm       = gPerm;
@@ -201,9 +201,9 @@
  
     return retVal;   
  }
---- ./huffman.c.orig   2005-08-12 10:45:28.000000000 +0000
-+++ ./huffman.c        2005-08-12 12:04:19.000000000 +0000
-@@ -210,13 +213,16 @@ void BZ2_hbAssignCodes ( Int32 *code,
+--- huffman.c
++++ huffman.c
+@@ -173,13 +173,16 @@
  void BZ2_hbCreateDecodeTables ( Int32 *limit,
                                  Int32 *base,
                                  Int32 *perm,
@@ -221,7 +221,7 @@
     pp = 0;
     for (i = minLen; i <= maxLen; i++)
        for (j = 0; j < alphaSize; j++)
-@@ -227,16 +233,25 @@ void BZ2_hbCreateDecodeTables ( Int32 *l
+@@ -190,16 +193,25 @@
  
     for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1];
  

++++++ bzip2-maxlen20.patch ++++++
--- /var/tmp/diff_new_pack.j17467/_old  2007-05-25 23:55:53.000000000 +0200
+++ /var/tmp/diff_new_pack.j17467/_new  2007-05-25 23:55:53.000000000 +0200
@@ -1,6 +1,6 @@
---- ./compress.c.orig  2005-08-12 12:02:26.000000000 +0000
-+++ ./compress.c       2005-08-12 12:03:16.000000000 +0000
-@@ -488,11 +488,9 @@ void sendMTFValues ( EState* s )
+--- compress.c
++++ compress.c
+@@ -444,11 +444,9 @@
        /*--
          Recompute the tables based on the accumulated frequencies.
        --*/
@@ -13,7 +13,7 @@
     }
  
  
-@@ -529,7 +527,7 @@ void sendMTFValues ( EState* s )
+@@ -485,7 +483,7 @@
           if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
           if (s->len[t][i] < minLen) minLen = s->len[t][i];
        }
@@ -22,9 +22,9 @@
        AssertH ( !(minLen < 1),  3005 );
        BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), 
                            minLen, maxLen, alphaSize );
---- ./huffman.c.orig   2005-08-12 10:45:28.000000000 +0000
-+++ ./huffman.c        2005-08-12 12:04:19.000000000 +0000
-@@ -177,7 +177,10 @@ void BZ2_hbMakeCodeLengths ( UChar *len,
+--- huffman.c
++++ huffman.c
+@@ -137,7 +137,10 @@
           Huffman codes with a maximum length of 17 bits.  However, in
           order to preserve backwards compatibility with bitstreams
           produced by versions pre-1.0.3, the decompressor must still



++++++ shared-lib.diff ++++++
--- Makefile
+++ Makefile
@@ -24,8 +24,9 @@
 CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
 
 # Where you want it installed when you do 'make install'
-PREFIX=/usr/local
-
+PREFIX=/usr
+MANDIR=$(PREFIX)/man
+LIBDIR=$(PREFIX)/lib
 
 OBJS= blocksort.o  \
       huffman.o    \
@@ -35,10 +36,10 @@
       decompress.o \
       bzlib.o
 
-all: libbz2.a bzip2 bzip2recover test
+all: libbz2.a libbz2.so bzip2 bzip2recover test
 
-bzip2: libbz2.a bzip2.o
-       $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
+bzip2: libbz2.a libbz2.so bzip2.o
+       $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o libbz2.so
 
 bzip2recover: bzip2recover.o
        $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
@@ -52,6 +53,10 @@
                $(RANLIB) libbz2.a ; \
        fi
 
+libbz2.so: $(OBJS)
+       rm -f libbz2.so*
+       $(CC) $(CFLAGS) $(LDFLAGS) -shared -o libbz2.so -Wl,-soname,libbz2.so.1 $(OBJS)
+
 check: test
 test: bzip2
        @cat words1
@@ -71,45 +76,29 @@
 
 install: bzip2 bzip2recover
        if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
-       if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
+       if ( test ! -d $(LIBDIR) ) ; then mkdir -p $(LIBDIR) ; 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
+       if ( test ! -d $(MANDIR)/man1 ) ; then mkdir -p $(MANDIR)/man1 ; fi
        if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
        cp -f bzip2 $(PREFIX)/bin/bzip2
-       cp -f bzip2 $(PREFIX)/bin/bunzip2
-       cp -f bzip2 $(PREFIX)/bin/bzcat
+       ln -sf bzip2 $(PREFIX)/bin/bunzip2
+       ln -sf bzip2 $(PREFIX)/bin/bzcat
        cp -f bzip2recover $(PREFIX)/bin/bzip2recover
        chmod a+x $(PREFIX)/bin/bzip2
-       chmod a+x $(PREFIX)/bin/bunzip2
-       chmod a+x $(PREFIX)/bin/bzcat
        chmod a+x $(PREFIX)/bin/bzip2recover
-       cp -f bzip2.1 $(PREFIX)/man/man1
-       chmod a+r $(PREFIX)/man/man1/bzip2.1
+       cp -f bzip2.1 $(MANDIR)/man1
+       chmod a+r $(MANDIR)/man1/bzip2.1
        cp -f bzlib.h $(PREFIX)/include
        chmod a+r $(PREFIX)/include/bzlib.h
-       cp -f libbz2.a $(PREFIX)/lib
-       chmod a+r $(PREFIX)/lib/libbz2.a
-       cp -f bzgrep $(PREFIX)/bin/bzgrep
-       ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
-       ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
-       chmod a+x $(PREFIX)/bin/bzgrep
-       cp -f bzmore $(PREFIX)/bin/bzmore
-       ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
-       chmod a+x $(PREFIX)/bin/bzmore
-       cp -f bzdiff $(PREFIX)/bin/bzdiff
-       ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
-       chmod a+x $(PREFIX)/bin/bzdiff
-       cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
-       chmod a+r $(PREFIX)/man/man1/bzgrep.1
-       chmod a+r $(PREFIX)/man/man1/bzmore.1
-       chmod a+r $(PREFIX)/man/man1/bzdiff.1
-       echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
-       echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
-       echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
-       echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
+       cp -f libbz2.a $(LIBDIR)
+       chmod a+r $(LIBDIR)/libbz2.a
+       cp -f libbz2.so $(LIBDIR)
+       chmod a+r $(LIBDIR)/libbz2.so
+       echo ".so man1/bzip2.1" > $(MANDIR)/man1/bunzip2.1
+       echo ".so man1/bzip2.1" > $(MANDIR)/man1/bzcat.1
 
 clean: 
-       rm -f *.o libbz2.a bzip2 bzip2recover \
+       rm -f *.o libbz2.a libbz2.so bzip2 bzip2recover \
        sample1.rb2 sample2.rb2 sample3.rb2 \
        sample1.tst sample2.tst sample3.tst
 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages