Browse Source

1. remove the librpmmisc.a library because its contents RPM includes in librpmio.a. This especially fixes the "multiple definitions of symbol" under Solaris when building APT. 2. Berkeley-DB fixes for fcntl(2) usage and Linux O_DIRECT issue. This especially gets rid of the "Resource temporarily unavailable" under (non-RedHat) Linux. The same problem under Solaris is still under further investigation. 3. Display double-logging of verbose messages on the terminal.

Ralf S. Engelschall 22 years ago
parent
commit
b21d765085
6 changed files with 608 additions and 69 deletions
  1. 2 0
      openpkg/HISTORY
  2. 24 26
      openpkg/openpkg.spec
  3. 57 3
      openpkg/rpm.patch.bugfix
  4. 31 13
      openpkg/rpm.patch.feature
  5. 57 12
      openpkg/rpm.patch.porting
  6. 437 15
      openpkg/rpm.patch.regen

+ 2 - 0
openpkg/HISTORY

@@ -2,6 +2,8 @@
 2003
 2003
 ====
 ====
 
 
+20030915 remove the librpmmisc.a library because its contents RPM includes in librpmio.a
+20030915 Berkeley-DB fixes for fcntl(2) usage and Linux O_DIRECT issue
 20030913 update to latest OSSP platform for even more accurate Linux product recognition
 20030913 update to latest OSSP platform for even more accurate Linux product recognition
 20030913 fix ordering of libraries in "rpm-config --libs"
 20030913 fix ordering of libraries in "rpm-config --libs"
 20030912 add -pipe to %{l_cflags} only if %{l_cc} is GCC and as(1) is GNU as
 20030912 add -pipe to %{l_cflags} only if %{l_cc} is GCC and as(1) is GNU as

+ 24 - 26
openpkg/openpkg.spec

@@ -39,7 +39,7 @@
 #   o any cc(1)
 #   o any cc(1)
 
 
 #   the package version/release
 #   the package version/release
-%define       V_openpkg  20030913
+%define       V_openpkg  20030915
 
 
 #   the used software versions
 #   the used software versions
 %define       V_rpm      4.2.1
 %define       V_rpm      4.2.1
@@ -182,7 +182,7 @@ Provides:     OpenPKG
     . ./.buildenv
     . ./.buildenv
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "PREPARATION: Determine Build Tool Paths"
+    set +x; VERBOSE "PREPARATION: Determine Build Tool Paths"
 
 
     #   determine path to shtool
     #   determine path to shtool
     shtool=`SOURCE shtool`
     shtool=`SOURCE shtool`
@@ -231,7 +231,7 @@ Provides:     OpenPKG
     echo "usrgrp=$usrgrp" >>./.buildenv
     echo "usrgrp=$usrgrp" >>./.buildenv
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "PREPARATION: Determine OpenPKG User/Group Name/Id Pairs"
+    set +x; VERBOSE "PREPARATION: Determine OpenPKG User/Group Name/Id Pairs"
 
 
     #   determine user/group name/id pairs
     #   determine user/group name/id pairs
     #   - bootstrapping: %{l_[smrn]{usr,grp}} is set via sed(1)
     #   - bootstrapping: %{l_[smrn]{usr,grp}} is set via sed(1)
@@ -285,7 +285,7 @@ Provides:     OpenPKG
     echo "ngid=\"$ngid\"; export ngid" >>.buildenv
     echo "ngid=\"$ngid\"; export ngid" >>.buildenv
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "PREPARATION: Determine OpenPKG Instance Environment"
+    set +x; VERBOSE "PREPARATION: Determine OpenPKG Instance Environment"
 
 
     #   determine installation location id
     #   determine installation location id
     if [ ".%{?l_location:set}" = .set ]; then
     if [ ".%{?l_location:set}" = .set ]; then
@@ -331,7 +331,7 @@ Provides:     OpenPKG
     echo "l_build_ulim=\"$l_build_ulim\"; export l_build_ulim" >>.buildenv
     echo "l_build_ulim=\"$l_build_ulim\"; export l_build_ulim" >>.buildenv
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "PREPARATION: Build GNU gzip (Compression Tool)"
+    set +x; VERBOSE "PREPARATION: Build GNU gzip (Compression Tool)"
 
 
     #   bootstrap GNU zip tool
     #   bootstrap GNU zip tool
     ${l_tar} xf `SOURCE gzip-%{V_gzip}.tar` 2>/dev/null || true
     ${l_tar} xf `SOURCE gzip-%{V_gzip}.tar` 2>/dev/null || true
@@ -346,7 +346,7 @@ Provides:     OpenPKG
     echo "l_gzip=\"$l_gzip\"; export l_gzip" >>.buildenv
     echo "l_gzip=\"$l_gzip\"; export l_gzip" >>.buildenv
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "PREPARATION: Unpack Distribution Tarballs"
+    set +x; VERBOSE "PREPARATION: Unpack Distribution Tarballs"
 
 
     #   unpack distribution tarballs
     #   unpack distribution tarballs
     ${l_gzip} -dc `SOURCE rpm-%{V_rpm}.tar.gz`           | ${l_tar} xf - 2>/dev/null || true
     ${l_gzip} -dc `SOURCE rpm-%{V_rpm}.tar.gz`           | ${l_tar} xf - 2>/dev/null || true
@@ -369,7 +369,7 @@ Provides:     OpenPKG
     done
     done
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "PREPARATION: Build GNU patch (Source Patching Tool)"
+    set +x; VERBOSE "PREPARATION: Build GNU patch (Source Patching Tool)"
 
 
     #   bootstrap GNU patch tool
     #   bootstrap GNU patch tool
     ( cd patch-%{V_patch}
     ( cd patch-%{V_patch}
@@ -387,7 +387,7 @@ Provides:     OpenPKG
     echo "l_patch=\"$l_patch\"; export l_patch" >>.buildenv
     echo "l_patch=\"$l_patch\"; export l_patch" >>.buildenv
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "PREPARATION: Apply OpenPKG Patches to Distibutions"
+    set +x; VERBOSE "PREPARATION: Apply OpenPKG Patches to Distibutions"
 
 
     #   apply OpenPKG patches to distribution trees
     #   apply OpenPKG patches to distribution trees
     ( cd rpm-%{V_rpm}
     ( cd rpm-%{V_rpm}
@@ -408,7 +408,7 @@ Provides:     OpenPKG
     ) || exit $?
     ) || exit $?
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "PREPARATION: Build GNU make (Build Tool)"
+    set +x; VERBOSE "PREPARATION: Build GNU make (Build Tool)"
 
 
     #   bootstrap GNU make tool
     #   bootstrap GNU make tool
     ( cd make-%{V_make}
     ( cd make-%{V_make}
@@ -431,7 +431,7 @@ Provides:     OpenPKG
     . ./.buildenv
     . ./.buildenv
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "BUILD: Build GNU bash (Bourne-Again Shell)"
+    set +x; VERBOSE "BUILD: Build GNU bash (Bourne-Again Shell)"
 
 
     #   build GNU bash tool
     #   build GNU bash tool
     ( cd bash-%{V_bash}
     ( cd bash-%{V_bash}
@@ -460,7 +460,7 @@ Provides:     OpenPKG
     ) || exit $?
     ) || exit $?
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "BUILD: Build GNU tar (Archiving Tool)"
+    set +x; VERBOSE "BUILD: Build GNU tar (Archiving Tool)"
 
 
     #   build GNU tar tool
     #   build GNU tar tool
     ( cd tar-%{V_tar}
     ( cd tar-%{V_tar}
@@ -480,7 +480,7 @@ Provides:     OpenPKG
     ) || exit $?
     ) || exit $?
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "BUILD: Build GNU bzip2 (Compression Library)"
+    set +x; VERBOSE "BUILD: Build GNU bzip2 (Compression Library)"
 
 
     #   build BZIP2 library
     #   build BZIP2 library
     ( cd bzip2-%{V_bzip2}
     ( cd bzip2-%{V_bzip2}
@@ -488,7 +488,7 @@ Provides:     OpenPKG
     ) || exit $?
     ) || exit $?
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "BUILD: Build Zlib (Compression Library)"
+    set +x; VERBOSE "BUILD: Build Zlib (Compression Library)"
 
 
     #   build ZLIB library
     #   build ZLIB library
     ( cd zlib-%{V_zlib}
     ( cd zlib-%{V_zlib}
@@ -509,7 +509,7 @@ Provides:     OpenPKG
     ) || exit $?
     ) || exit $?
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "BUILD: Build cURL (URL Fetching Tool)"
+    set +x; VERBOSE "BUILD: Build cURL (URL Fetching Tool)"
 
 
     #   build cURL tool
     #   build cURL tool
     ( cd curl-%{V_curl}
     ( cd curl-%{V_curl}
@@ -533,7 +533,7 @@ Provides:     OpenPKG
     ) || exit $?
     ) || exit $?
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "BUILD: Build RPM (RedHat Package Manager)"
+    set +x; VERBOSE "BUILD: Build RPM (RedHat Package Manager)"
 
 
     #   build RPM
     #   build RPM
     ( br=`pwd`
     ( br=`pwd`
@@ -604,7 +604,7 @@ Provides:     OpenPKG
     . ./.buildenv
     . ./.buildenv
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "INSTALL: Create Installation Filesystem Hierarchy"
+    set +x; VERBOSE "INSTALL: Create Installation Filesystem Hierarchy"
 
 
     #   create installation hierarchy
     #   create installation hierarchy
     rm -rf $RPM_BUILD_ROOT
     rm -rf $RPM_BUILD_ROOT
@@ -637,7 +637,7 @@ Provides:     OpenPKG
     done
     done
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "INSTALL: Installation of RPM"
+    set +x; VERBOSE "INSTALL: Installation of RPM"
 
 
     #   install RPM into installation hierarchy
     #   install RPM into installation hierarchy
     ( cd rpm-%{V_rpm}
     ( cd rpm-%{V_rpm}
@@ -645,7 +645,7 @@ Provides:     OpenPKG
     ) || exit $?
     ) || exit $?
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "INSTALL: Stripping Down Installation"
+    set +x; VERBOSE "INSTALL: Stripping Down Installation"
 
 
     #   strip RPM installation
     #   strip RPM installation
     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* \
     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* \
@@ -676,11 +676,10 @@ Provides:     OpenPKG
     done
     done
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "INSTALL: Install Additional Files"
+    set +x; VERBOSE "INSTALL: Install Additional Files"
 
 
     #   add additional development files
     #   add additional development files
     cp rpm-%{V_rpm}/misc/glob.h $RPM_BUILD_ROOT%{l_prefix}/include/rpm/
     cp rpm-%{V_rpm}/misc/glob.h $RPM_BUILD_ROOT%{l_prefix}/include/rpm/
-    cp rpm-%{V_rpm}/misc/libmisc.a $RPM_BUILD_ROOT%{l_prefix}/lib/librpmmisc.a
     cp zlib-%{V_zlib}/zlib.h $RPM_BUILD_ROOT%{l_prefix}/include/rpm/
     cp zlib-%{V_zlib}/zlib.h $RPM_BUILD_ROOT%{l_prefix}/include/rpm/
     cp zlib-%{V_zlib}/libz.a $RPM_BUILD_ROOT%{l_prefix}/lib/librpmz.a
     cp zlib-%{V_zlib}/libz.a $RPM_BUILD_ROOT%{l_prefix}/lib/librpmz.a
     cp bzip2-%{V_bzip2}/bzlib.h $RPM_BUILD_ROOT%{l_prefix}/include/rpm/
     cp bzip2-%{V_bzip2}/bzlib.h $RPM_BUILD_ROOT%{l_prefix}/include/rpm/
@@ -689,7 +688,7 @@ Provides:     OpenPKG
     cp beecrypt-%{V_beecrypt}/libbeecrypt.a $RPM_BUILD_ROOT%{l_prefix}/lib/librpmbeecrypt.a
     cp beecrypt-%{V_beecrypt}/libbeecrypt.a $RPM_BUILD_ROOT%{l_prefix}/lib/librpmbeecrypt.a
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "INSTALL: Post-Adjust Installation"
+    set +x; VERBOSE "INSTALL: Post-Adjust Installation"
 
 
     #   post-adjust RPM installation (namespace-clean POPT inclusion)
     #   post-adjust RPM installation (namespace-clean POPT inclusion)
     mv $RPM_BUILD_ROOT%{l_prefix}/lib/libpopt.a \
     mv $RPM_BUILD_ROOT%{l_prefix}/lib/libpopt.a \
@@ -709,7 +708,7 @@ Provides:     OpenPKG
        $RPM_BUILD_ROOT%{l_prefix}/bin/rpmbuild
        $RPM_BUILD_ROOT%{l_prefix}/bin/rpmbuild
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "INSTALL: Install Additional Tools"
+    set +x; VERBOSE "INSTALL: Install Additional Tools"
 
 
     #   install lsync tool
     #   install lsync tool
     sed -e "s:@l_prefix@:%{l_prefix}:g" \
     sed -e "s:@l_prefix@:%{l_prefix}:g" \
@@ -729,7 +728,7 @@ Provides:     OpenPKG
       l_cflags=""
       l_cflags=""
       l_cppflags="-DOPENPKG -I${l_prefix}/include/rpm -I${l_prefix}/include"
       l_cppflags="-DOPENPKG -I${l_prefix}/include/rpm -I${l_prefix}/include"
       l_ldflags="-L${l_prefix}/lib"
       l_ldflags="-L${l_prefix}/lib"
-      l_libs="-lrpmbuild -lrpm -lrpmio -lrpmdb -lrpmpopt -lrpmmisc -lrpmbeecrypt -lrpmbz2 -lrpmz"
+      l_libs="-lrpmbuild -lrpm -lrpmio -lrpmdb -lrpmpopt -lrpmbeecrypt -lrpmbz2 -lrpmz"
       sed -e "s:@l_prefix@:%{l_prefix}:g" \
       sed -e "s:@l_prefix@:%{l_prefix}:g" \
           -e "s:@l_cc@:$l_cc:g" \
           -e "s:@l_cc@:$l_cc:g" \
           -e "s:@l_cflags@:$l_cflags:g" \
           -e "s:@l_cflags@:$l_cflags:g" \
@@ -797,7 +796,7 @@ Provides:     OpenPKG
     chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/config.sub
     chmod a+x $RPM_BUILD_ROOT%{l_prefix}/lib/openpkg/config.sub
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "INSTALL: Install Configuration Files"
+    set +x; VERBOSE "INSTALL: Install Configuration Files"
 
 
     #   install a few README files
     #   install a few README files
     sed -e "s:@l_prefix@:%{l_prefix}:g" \
     sed -e "s:@l_prefix@:%{l_prefix}:g" \
@@ -878,7 +877,7 @@ Provides:     OpenPKG
        $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/openpkg.pgp
        $RPM_BUILD_ROOT%{l_prefix}/etc/openpkg/openpkg.pgp
 
 
     #   display verbosity header
     #   display verbosity header
-    VERBOSE "INSTALL: Done. Thank you for flying OpenPKG..."
+    set +x; VERBOSE "INSTALL: Done. Thank you for flying OpenPKG..."
 
 
 %files
 %files
     %defattr(-,%{?l_musr}%{!?l_musr:%{l_fsusr}},%{?l_mgrp}%{!?l_mgrp:%{l_fsgrp}})
     %defattr(-,%{?l_musr}%{!?l_musr:%{l_fsusr}},%{?l_mgrp}%{!?l_mgrp:%{l_fsgrp}})
@@ -987,7 +986,6 @@ Provides:     OpenPKG
     %{l_prefix}/lib/librpmbz2.a
     %{l_prefix}/lib/librpmbz2.a
     %{l_prefix}/lib/librpmdb.a
     %{l_prefix}/lib/librpmdb.a
     %{l_prefix}/lib/librpmio.a
     %{l_prefix}/lib/librpmio.a
-    %{l_prefix}/lib/librpmmisc.a
     %{l_prefix}/lib/librpmpopt.a
     %{l_prefix}/lib/librpmpopt.a
     %{l_prefix}/lib/librpmz.a
     %{l_prefix}/lib/librpmz.a
     %dir %{l_prefix}/libexec
     %dir %{l_prefix}/libexec

+ 57 - 3
openpkg/rpm.patch.bugfix

@@ -10,7 +10,7 @@
 ##  'patch' tool to upgrade those files. Each patch snippet is annotated
 ##  'patch' tool to upgrade those files. Each patch snippet is annotated
 ##  with a short description.
 ##  with a short description.
 ##
 ##
-##  Created on: 12-Sep-2003
+##  Created on: 15-Sep-2003
 ##
 ##
 ##  ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
 ##  ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
 ##             RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
 ##             RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
@@ -49,7 +49,7 @@ Index: build/parsePrep.c
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: configure.ac
 Index: configure.ac
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
-+++ configure.ac	12 Sep 2003 15:10:58 -0000
++++ configure.ac	15 Sep 2003 10:11:52 -0000
 @@ -348,7 +349,7 @@
 @@ -348,7 +349,7 @@
  
  
  	AC_MSG_CHECKING(for $dir/include in INCPATH)
  	AC_MSG_CHECKING(for $dir/include in INCPATH)
@@ -66,7 +66,7 @@ Index: configure.ac
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: configure.ac
 Index: configure.ac
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
-+++ configure.ac	12 Sep 2003 15:10:58 -0000
++++ configure.ac	15 Sep 2003 10:11:52 -0000
 @@ -1274,7 +1298,6 @@
 @@ -1274,7 +1298,6 @@
  	python/rpmdb/Makefile
  	python/rpmdb/Makefile
  	python/test/Makefile
  	python/test/Makefile
@@ -244,3 +244,57 @@ Index: lib/rpmfi.c
  dColors[dirIndexes[i]] |= fColors[i];
  dColors[dirIndexes[i]] |= fColors[i];
  	/*
  	/*
  	 * See if this file path needs relocating.
  	 * See if this file path needs relocating.
+
++---------------------------------------------------------------------------
+| Bugfix: POSIX/SUSv3 clearly expresses that fcntl(2) returns "value
+| other than -1" on success, so check for equality to -1 instead of
+| non-equality to 0. In practice this does not harm on most platforms,
+| because they fortunately (by conincidence and common practice)
+| return 0.
++---------------------------------------------------------------------------
+Index: db/mutex/mut_fcntl.c
+--- db/mutex/mut_fcntl.c	18 Jan 2003 14:05:03 -0000	1.1.1.5
++++ db/mutex/mut_fcntl.c	15 Sep 2003 13:37:58 -0000
+@@ -101,7 +101,7 @@
+ 
+ 		/* Acquire an exclusive kernel lock. */
+ 		k_lock.l_type = F_WRLCK;
+-		if (fcntl(dbenv->lockfhp->fd, F_SETLKW, &k_lock))
++		if (fcntl(dbenv->lockfhp->fd, F_SETLKW, &k_lock) == -1)
+ 			return (__os_get_errno());
+ 
+ 		/* If the resource is still available, it's ours. */
+@@ -112,7 +112,7 @@
+ 
+ 		/* Release the kernel lock. */
+ 		k_lock.l_type = F_UNLCK;
+-		if (fcntl(dbenv->lockfhp->fd, F_SETLK, &k_lock))
++		if (fcntl(dbenv->lockfhp->fd, F_SETLK, &k_lock) == -1)
+ 			return (__os_get_errno());
+ 
+ 		/*
+
++---------------------------------------------------------------------------
+| The O_DIRECT feature is fully broken under at least Linux 2.2 and
+| 2.4. It is sometimes accepted by open(2) without error and later
+| causes a write(2) to fail with EINVAL -- all depending on the
+| underlying filesystem (usually works on tmpfs and fails on ext3).
+| Sometimes it also causes open(2) to fail with EINVAL. In general,
+| it does especially no "graceful degradation" and so is useless for
+| use mostly all platforms except for those where we know it works
+| (currently FreeBSD only). Interestingly, RPM works on RedHat, just
+| because RedHat's "kernel" package contains a patch which masks out
+| O_DIRECT usage... ;-)
++---------------------------------------------------------------------------
+Index: db/os/os_open.c
+--- db/os/os_open.c	18 Jan 2003 14:05:03 -0000	1.1.1.5
++++ db/os/os_open.c	15 Sep 2003 18:12:23 -0000
+@@ -93,7 +93,7 @@
+ 	if (LF_ISSET(DB_OSO_TRUNC))
+ 		oflags |= O_TRUNC;
+ 
+-#ifdef HAVE_O_DIRECT
++#if defined(HAVE_O_DIRECT) && defined(__FreeBSD__)
+ 	if (LF_ISSET(DB_OSO_DIRECT))
+ 		oflags |= O_DIRECT;
+ #endif

+ 31 - 13
openpkg/rpm.patch.feature

@@ -10,7 +10,7 @@
 ##  'patch' tool to upgrade those files. Each patch snippet is annotated
 ##  'patch' tool to upgrade those files. Each patch snippet is annotated
 ##  with a short description.
 ##  with a short description.
 ##
 ##
-##  Created on: 12-Sep-2003
+##  Created on: 15-Sep-2003
 ##
 ##
 ##  ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
 ##  ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
 ##             RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
 ##             RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
@@ -272,7 +272,7 @@ Index: Makefile.in
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: build/build.c
 Index: build/build.c
 --- build/build.c	4 Mar 2003 15:27:33 -0000	1.1.1.20
 --- build/build.c	4 Mar 2003 15:27:33 -0000	1.1.1.20
-+++ build/build.c	12 Sep 2003 12:54:07 -0000
++++ build/build.c	15 Sep 2003 19:02:34 -0000
 @@ -33,7 +33,15 @@
 @@ -33,7 +33,15 @@
  
  
      for (p = spec->sources; p != NULL; p = p->next) {
      for (p = spec->sources; p != NULL; p = p->next) {
@@ -315,7 +315,7 @@ Index: build/build.c
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: build/build.c
 Index: build/build.c
 --- build/build.c	4 Mar 2003 15:27:33 -0000	1.1.1.20
 --- build/build.c	4 Mar 2003 15:27:33 -0000	1.1.1.20
-+++ build/build.c	12 Sep 2003 12:54:07 -0000
++++ build/build.c	15 Sep 2003 19:02:34 -0000
 @@ -242,7 +258,9 @@
 @@ -242,7 +258,9 @@
      
      
  exit:
  exit:
@@ -338,7 +338,7 @@ Index: build/build.c
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: build/build.c
 Index: build/build.c
 --- build/build.c	4 Mar 2003 15:27:33 -0000	1.1.1.20
 --- build/build.c	4 Mar 2003 15:27:33 -0000	1.1.1.20
-+++ build/build.c	12 Sep 2003 12:54:07 -0000
++++ build/build.c	15 Sep 2003 19:02:34 -0000
 @@ -337,6 +355,21 @@
 @@ -337,6 +355,21 @@
  
  
      if (what & RPMBUILD_RMSPEC)
      if (what & RPMBUILD_RMSPEC)
@@ -638,7 +638,7 @@ Index: build/parsePrep.c
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: build/parseScript.c
 Index: build/parseScript.c
 --- build/parseScript.c	23 Jun 2002 19:47:12 -0000	1.1.1.12
 --- build/parseScript.c	23 Jun 2002 19:47:12 -0000	1.1.1.12
-+++ build/parseScript.c	24 Aug 2003 13:10:15 -0000
++++ build/parseScript.c	15 Sep 2003 19:02:33 -0000
 @@ -261,6 +261,7 @@
 @@ -261,6 +261,7 @@
      stripTrailingBlanksStringBuf(sb);
      stripTrailingBlanksStringBuf(sb);
      p = getStringBuf(sb);
      p = getStringBuf(sb);
@@ -655,7 +655,7 @@ Index: build/parseScript.c
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: build/spec.c
 Index: build/spec.c
 --- build/spec.c	4 Mar 2003 15:25:51 -0000	1.1.1.21
 --- build/spec.c	4 Mar 2003 15:25:51 -0000	1.1.1.21
-+++ build/spec.c	24 Aug 2003 13:10:15 -0000
++++ build/spec.c	15 Sep 2003 19:02:34 -0000
 @@ -334,7 +334,15 @@
 @@ -334,7 +334,15 @@
  
  
      if (tag != RPMTAG_ICON) {
      if (tag != RPMTAG_ICON) {
@@ -682,13 +682,13 @@ Index: build/spec.c
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: configure.ac
 Index: configure.ac
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
-+++ configure.ac	1 Sep 2003 09:26:45 -0000
++++ configure.ac	15 Sep 2003 10:11:52 -0000
 @@ -53,7 +53,7 @@
 @@ -53,7 +53,7 @@
  AS=${AS-as}
  AS=${AS-as}
  AC_SUBST(AS)
  AC_SUBST(AS)
  if test "$ac_cv_prog_gcc" = yes; then
  if test "$ac_cv_prog_gcc" = yes; then
 -    CFLAGS="$CFLAGS -D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts"
 -    CFLAGS="$CFLAGS -D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts"
-+    CFLAGS="$CFLAGS -pipe -O2 -D_GNU_SOURCE -D_REENTRANT"
++    CFLAGS="$CFLAGS -O2 -D_GNU_SOURCE -D_REENTRANT"
  fi
  fi
  export CFLAGS
  export CFLAGS
  
  
@@ -710,12 +710,29 @@ Index: configure.ac
  	AC_MSG_RESULT(yes)
  	AC_MSG_RESULT(yes)
  fi
  fi
 
 
++---------------------------------------------------------------------------
+| Disable the use of the internal zlib library, because
+| we build against an external one.
++---------------------------------------------------------------------------
+Index: configure.ac
+--- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
++++ configure.ac	15 Sep 2003 10:11:52 -0000
+@@ -310,7 +311,7 @@
+ WITH_ZLIB_SUBDIR=
+ WITH_ZLIB_INCLUDE=
+ WITH_ZLIB_LIB=
+-if test -d zlib ; then
++if false; then
+   WITH_ZLIB_SUBDIR=zlib
+   addlib \${top_builddir}/zlib
+   WITH_ZLIB_INCLUDE="-I\${top_srcdir}/${WITH_ZLIB_SUBDIR}"
+
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 | Adjust paths for OpenPKG filesystem layout.
 | Adjust paths for OpenPKG filesystem layout.
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: configure.ac
 Index: configure.ac
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
-+++ configure.ac	1 Sep 2003 09:26:45 -0000
++++ configure.ac	15 Sep 2003 10:11:52 -0000
 @@ -1200,12 +1202,12 @@
 @@ -1200,12 +1202,12 @@
  AC_SUBST(LOCALEDIR)
  AC_SUBST(LOCALEDIR)
  LIBDIR="`echo $libdir | sed 's-/lib$-/%{_lib}-'`"
  LIBDIR="`echo $libdir | sed 's-/lib$-/%{_lib}-'`"
@@ -860,7 +877,7 @@ Index: lib/rpmrc.c
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: macros.in
 Index: macros.in
 --- macros.in	2 Jul 2003 19:20:52 -0000	1.1.1.14
 --- macros.in	2 Jul 2003 19:20:52 -0000	1.1.1.14
-+++ macros.in	25 Aug 2003 18:23:11 -0000
++++ macros.in	15 Sep 2003 19:08:46 -0000
 @@ -305,7 +305,7 @@
 @@ -305,7 +305,7 @@
  # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
  # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
  #
  #
@@ -1132,8 +1149,8 @@ Index: rpmio/macro.c
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: rpmpopt.in
 Index: rpmpopt.in
 --- rpmpopt.in	24 Jan 2003 14:56:30 -0000	1.1.1.7
 --- rpmpopt.in	24 Jan 2003 14:56:30 -0000	1.1.1.7
-+++ rpmpopt.in	25 Aug 2003 09:32:31 -0000
-@@ -147,28 +147,27 @@
++++ rpmpopt.in	14 Sep 2003 10:36:19 -0000
+@@ -147,28 +147,28 @@
  # Popt glue to preserve legacy CLI behavior.
  # Popt glue to preserve legacy CLI behavior.
  #
  #
  # XXX popt exec parsing doesn't honor POPT_ARGFLAG_ONEDASH
  # XXX popt exec parsing doesn't honor POPT_ARGFLAG_ONEDASH
@@ -1166,6 +1183,7 @@ Index: rpmpopt.in
 +rpm	exec --ba		rpmb -ba
 +rpm	exec --ba		rpmb -ba
 +rpm	exec --bb		rpmb -bb
 +rpm	exec --bb		rpmb -bb
 +rpm	exec --bs		rpmb -bs
 +rpm	exec --bs		rpmb -bs
++rpm	exec --bt		rpmb -bt
 +rpm	exec --tp		rpmb -tp
 +rpm	exec --tp		rpmb -tp
 +rpm	exec --tc		rpmb -tc
 +rpm	exec --tc		rpmb -tc
 +rpm	exec --ti		rpmb -ti
 +rpm	exec --ti		rpmb -ti
@@ -1191,7 +1209,7 @@ Index: rpmpopt.in
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: rpmqv.c
 Index: rpmqv.c
 --- rpmqv.c	4 Mar 2003 15:32:57 -0000	1.1.1.8
 --- rpmqv.c	4 Mar 2003 15:32:57 -0000	1.1.1.8
-+++ rpmqv.c	12 Sep 2003 11:58:25 -0000
++++ rpmqv.c	15 Sep 2003 19:02:34 -0000
 @@ -682,6 +682,10 @@
 @@ -682,6 +682,10 @@
  	case 'b':
  	case 'b':
  	    ba->buildAmount |= RPMBUILD_PACKAGEBINARY;
  	    ba->buildAmount |= RPMBUILD_PACKAGEBINARY;

+ 57 - 12
openpkg/rpm.patch.porting

@@ -10,18 +10,49 @@
 ##  'patch' tool to upgrade those files. Each patch snippet is annotated
 ##  'patch' tool to upgrade those files. Each patch snippet is annotated
 ##  with a short description.
 ##  with a short description.
 ##
 ##
-##  Created on: 12-Sep-2003
+##  Created on: 15-Sep-2003
 ##
 ##
 ##  ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
 ##  ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
 ##             RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
 ##             RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
 ##
 ##
 
 
++---------------------------------------------------------------------------
+| Disable any POSIX Pthread stuff because in OpenPKG we use
+| non-Pthread mutexes in Berkeley-DB.
++---------------------------------------------------------------------------
+Index: configure.ac
+--- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
++++ configure.ac	15 Sep 2003 10:11:52 -0000
+@@ -446,14 +447,14 @@
+     AC_CHECK_LIB(socket, socket)
+ ])
+ 
+-AC_CHECK_HEADERS(thread.h pthread.h synch.h semaphore.h)
+-
+-AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [
+-  dnl OSF 5.0 has the the symbols prefixed with __ in libpthread.
+-  AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [
+-    AC_CHECK_LIB(thread, mutex_lock)
+-  ])
+-])
++dnl AC_CHECK_HEADERS(thread.h pthread.h synch.h semaphore.h)
++dnl 
++dnl AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [
++dnl   dnl OSF 5.0 has the the symbols prefixed with __ in libpthread.
++dnl   AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [
++dnl     AC_CHECK_LIB(thread, mutex_lock)
++dnl   ])
++dnl ])
+ 
+ AC_CHECK_HEADERS(aio.h)
+ AC_SEARCH_LIBS(aio_read, [c rt aio posix4])
+
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 | Add support for BSD getmntinfo(3).
 | Add support for BSD getmntinfo(3).
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: configure.ac
 Index: configure.ac
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
-+++ configure.ac	12 Sep 2003 15:10:58 -0000
++++ configure.ac	15 Sep 2003 10:11:52 -0000
 @@ -963,12 +964,13 @@
 @@ -963,12 +964,13 @@
  AC_CHECK_FUNCS(getpassphrase)
  AC_CHECK_FUNCS(getpassphrase)
  
  
@@ -43,13 +74,15 @@ Index: configure.ac
 | build/rpmfile.h and not available on all platforms. We do this by
 | build/rpmfile.h and not available on all platforms. We do this by
 | adding the same Autoconf checks file/configure already used for its
 | adding the same Autoconf checks file/configure already used for its
 | original file.h.
 | original file.h.
+| Additionally, do not try to configure in an internal
+| beecrypt subdirectory.
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: configure.ac
 Index: configure.ac
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
 --- configure.ac	2 Jul 2003 19:20:52 -0000	1.1.1.4
-+++ configure.ac	12 Sep 2003 15:10:58 -0000
-@@ -1253,6 +1255,28 @@
- dnl # XXX Propagate -lucb to popt ...
- dnl export LIBS INCPATH CONFIG_SITE
++++ configure.ac	15 Sep 2003 10:11:52 -0000
+@@ -1249,11 +1251,33 @@
+ 
+ AC_SUBST(OBJDUMP)
  
  
 +dnl OpenPKG: rpmfile.h (used in RPM) from file(1) needs additional checks
 +dnl OpenPKG: rpmfile.h (used in RPM) from file(1) needs additional checks
 +dnl for its use of uintXX_t (which are available in file/config.h, but which
 +dnl for its use of uintXX_t (which are available in file/config.h, but which
@@ -73,26 +106,38 @@ Index: configure.ac
 +AC_CHECK_TYPE_STDC(uint16_t, unsigned short)
 +AC_CHECK_TYPE_STDC(uint16_t, unsigned short)
 +AC_CHECK_TYPE_STDC(uint32_t, unsigned int)
 +AC_CHECK_TYPE_STDC(uint32_t, unsigned int)
 +
 +
- AC_CONFIG_SUBDIRS(popt beecrypt zlib elfutils file db3)
+ dnl XXX this causes popt to depend on zlib et al
+ dnl # XXX Propagate -lucb to popt ...
+ dnl export LIBS INCPATH CONFIG_SITE
+ 
+-AC_CONFIG_SUBDIRS(popt beecrypt zlib elfutils file db3)
++AC_CONFIG_SUBDIRS(popt zlib elfutils file db3)
  
  
  AC_OUTPUT([ Doxyfile Makefile rpmrc macros platform rpmpopt rpm.spec
  AC_OUTPUT([ Doxyfile Makefile rpmrc macros platform rpmpopt rpm.spec
+ 	rpmio/Makefile rpmdb/Makefile lib/Makefile build/Makefile
 
 
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 | Not all Bourne-Shells support embedded TAB characters in
 | Not all Bourne-Shells support embedded TAB characters in
 | here-document style constructs. Insert the TAB character indirectly
 | here-document style constructs. Insert the TAB character indirectly
-| to workaround problems. Additionally, there is no need to build a
-| shared library version of Berkeley-DB.
+| to workaround problems.
+| Additionally, there is no need to build a shared library version of
+| Berkeley-DB.
+| Finally, enforce the use of the standard UNIX/fcntl mutex type for
+| full portability and to get rid of Pthread library dependencies
+| (which especially are nasty for the external RPM API users).
 +---------------------------------------------------------------------------
 +---------------------------------------------------------------------------
 Index: db3/configure
 Index: db3/configure
 --- db3/configure	18 Jan 2003 14:04:22 -0000	1.1.1.4
 --- db3/configure	18 Jan 2003 14:04:22 -0000	1.1.1.4
-+++ db3/configure	25 Aug 2003 10:35:39 -0000
-@@ -8,18 +8,18 @@
++++ db3/configure	15 Sep 2003 19:15:42 -0000
+@@ -8,18 +8,19 @@
  ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's%--cache-file=.*$%%'`"
  ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's%--cache-file=.*$%%'`"
  
  
  CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure $ARGS \
  CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure $ARGS \
 -	--enable-shared --enable-static --enable-rpc \
 -	--enable-shared --enable-static --enable-rpc \
+-	--with-uniquename=_rpmdb --srcdir=$db_dist
 +	--disable-shared --enable-static --enable-rpc \
 +	--disable-shared --enable-static --enable-rpc \
- 	--with-uniquename=_rpmdb --srcdir=$db_dist
++	--with-uniquename=_rpmdb --srcdir=$db_dist \
++	--with-mutex="UNIX/fcntl" --disable-largefile
  
  
  mv Makefile Makefile.orig
  mv Makefile Makefile.orig
  cat Makefile.orig | sed -e '/^install[:-]/c\
  cat Makefile.orig | sed -e '/^install[:-]/c\

File diff suppressed because it is too large
+ 437 - 15
openpkg/rpm.patch.regen