cvs commit: hints/PREVIOUS_FORMAT rpm.txt rpm_glibc22.txt

tushar at tushar at
Fri Oct 10 20:48:02 PDT 2003

tushar      03/10/10 21:48:02

  Added:       .        rpm.txt
               OLD      rpm.txt rpm_glibc22.txt
  Removed:     PREVIOUS_FORMAT rpm.txt rpm_glibc22.txt
  Added hint: rpm
  Revision  Changes    Path
  1.4       +83 -110   hints/rpm.txt
  1.27      +0 -2      hints/MAINTAINER/STATUS
  Index: STATUS
  RCS file: /home/cvsroot/hints/MAINTAINER/STATUS,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -u -r1.26 -r1.27
  --- STATUS	9 Oct 2003 01:12:35 -0000	1.26
  +++ STATUS	11 Oct 2003 03:48:02 -0000	1.27
  @@ -62,8 +62,6 @@
      * qmail_cyrus_imap: No response from author.
      * redhat_style_logon: Could not contact author.
      * root-privileges: Could not contact author.
  -   * rpm: Orphaned
  -   * rpm_glibc22: No response from author. Should be merged with rpm.
      * scp-before-relay: Conversion in progress.
      * security: Orphaned.
      * sendmail: No response from author. Sendmail in BLFS book.
  1.1                  hints/OLD/rpm.txt
  Index: rpm.txt
  TITLE:		Installation of RedHat Package Manager 4.0
  LFS VERSION:	2.3.6
  AUTHOR:		Jason Gurtz <jason(at)tommyk(dot)com>
  	The RPM package is used for installing, building, and maintaining '.rpm' packages.
  RPM is a package manager of dubious value to the average LFS'er. However, 
  certain closed-source commercial applications require it for installation. 
  Additionally, playing with it may be of educational value, and it may 
  ease administration of a large and diverse network of UNIX and UNIX-like 
  computers. Maybe it can do more than simply "Ruining a Perfectly 
  good Machine."  ;)
  The INSTALL file mentions that both the Berkeley db1 and db3 packages are
  needed.  I did not need to use or install the db1 package for a successfully
  installed build of RPM-4.0.  Needless to say, I am not an experienced user
  of RPM, so there may be some functionality that requires this somehow (maybe
  conversion of old RPM packages to new?).  In any instance, please post any
  needed changes to the lfs-apps ML and or mail me direct at the above addy
  RedHat is the maintainer and active developer of the RPM package.  It's
  home page is
  Package Name:	rpm-4.0.tar.gz		(RPM 4.0)
  Download here:
  USE:			This is the main package
  Package Name:	zlib-1.1.3.tar.gz		(zlib compression lib.)
  Download here:
  USE:			For compression support
  Package name:	db-3.1.17.tar.gz		(Berkeley db3)
  HTTP Download:
  USE:			RPM-4.0 uses this as it's database
  Package Name:	gnupg-1.0.4.tar.gz	(GNU Privacy Guard)
  Download here:
  USE:			For Cryptographically signing your packages
  These other packages are needed/recommended, but you should have these all
  ready installed as part of the base LFS system.
  Among other things:
  -GNU tar
  First we'll install zlib.  (should be easy)
      ./configure && make test && make install
  Next lets install our crypto (gnupg)...  The use of this software
  requires a source of random numbers.  There are a few ways, but the 
  easiest is to use /dev/random and /dev/urandom.  If you don't have these 
  in your /dev directory create them with:
      mknod /dev/random c 1 8
      mknod /dev/urandom c 1 9
  Now we build.  As root do:
      ./configure --disable-nls && make && make install
  Installation defaults to /usr/local/bin, make sure this is in your path.
  When install finishes you should create your key pair.  As root:
      gpg --gen-key
  This will start a script that creates a dir or few and some
  files. It will tell you to re run it so just type the same thing again 
  (gpg --gen-key). This starts a scrip asking for real name, etc to be 
  associated with your key. Because your system is prolly not to busy it 
  may complain that it needs more Bytes from the /dev/random.  You can 
  simply start typing (a lot) what ever you feel like and it will finish, 
  but the easiest way to generate more randomness is to log into another 
  virtual terminal and start compiling our next package.  :)
  So, let's do the Berkeley db-3.17 package.  Two things are special:  the
  configure script is located in the dist sub-directory 
  (/usr/src/db-3.1.17/dist/), and you run configure like this:
      ./configure --enable-compat185
  This is because the original RPM versions used the db1 database from
  sleepycat.  Next, do your:
      make && make install
  While this is going (takes a little bit) monitor your gnupg key creation.
  When that finishes make a symlink in /usr/local/bin for backwards
      ln -s /usr/local/bin/gpg /usr/local/bin/gpgm
  That was the last part to installing gnupg.  Now when the db3 finishes
  installing note that it is installed to /usr/local/BerkeleyDB.3.1/...  That
  will be important for our last step, installing the rpm-4.0 package.
  First run the preliminary script like this:
      ./ --noconfigure
  Somewhat irritatingly a source file seems to want to find something where
  it's not, so:
      cd /usr/src/rpm-4.0/lib/ && vim db3.c
  type ':12' <enter> to goto line 12 and change it to read:
      #include </usr/local/BerkeleyDB.3.1/include/db.h>
  Now we're ready to go.  Pay careful attention to the stuff
  prepended to the
  ../configure invocation:
      LIBS='-L/usr/local/BerkeleyDB.3.1/lib' \
  > CPPFLAGS='-I/usr/local/BerkeleyDB.3.1/include' \
  > ./configure
  When ./configure finishes just run (as root):
      make && make install
  You can disregard all the pointer warnings that fly by. When it's done, you
  should be able to type:
      rpm --version
  and see the version come up.  One last thing to do is initialize and 
  rebuild the database. As root, type:
      rpm --initdb
      rpm --rebuilddb
  A good final test of basic functionality is to download an SRPM package.
  This will be  someDumbProg-0.0.1.src.rpm  All it is is a tarball in 
  disguise. To get at it simply:
      rpm -i -vv someDumbProg-0.0.1.src.rpm
  note from the -vv (extra verbose) output that the .tar.gz gets dumped in
  /usr/local/src/redhat/SOURCES  along with maybe a patch file or other nice
  extras.  Also note that the database itself is at /var/local/lib/rpm/Packages  
  There are 3 levels of "rc" config files. global is /usr/local/lib/rpm/rpmrc  
  Machine specific is /etc/rpmrc user level is ~/.rpmrc
  1.1                  hints/OLD/rpm_glibc22.txt
  Index: rpm_glibc22.txt
  TITLE:		RPM-4.0 for glibc-2.2 installation howto
  LFS VERSION:	2.4.3
  AUTHOR:		Sergey Ostrovsky <sergey at>
  	How to install RPM 4.0 on a glibc-2.2-based LFS system.
  ver 1.6
  1. How things will be done and why
  2. Packages to download
  3. Install all the auxiliary packages as Jason Gurtz hint says
  4. Installation db-1.85
  5. Installation db-3.1.17
  6. Installation rpm-4.0
  7. Possible ( not mandatory ) re-install of db-1.85
  1. How things will be done and why
  There is already rpm-hint by  Jason Gurtz which documents the
  installation not only db-3.x.x, RPM-4.0, but also other useful
  corresponding packages, like gnupg.
  These things won't be covered here to save space and eliminate duplication.
  Where appropriate the token ^OPT^ used to designate the possible
  place for custom compiler's optimization and architecture flags.
  For the proper installation of RPM-4.0 two versions of
  Berkeley DB shall be installed first :
  db-1.85 and db-3.x.x. This means that the latest available
  release can be used just for the later package.
  This need for two versions of Berkeley DB to be present in the
  system introduces some mild complications which must be understood.
  These complications make impact not only on the installation of RPM-4.0
  but also on many other packages which depend on Berkeley DB
  First, the both db-1.85 and db-3.x.x install the file db.h
  as the main header file. Contents of these db.h are not equal.
  Additionally it is usually assumed that the header files
  that belong to a particular package are installed in the one
  separate directory but not spread among several directories.
  This means each full set of headers for db-1.85 and db-3.x.x
  should occupy a separate directory. Also, it would be inconvenient
  to have one of the sets installed in a default directory
  ( say, /usr/local/include ), because it is really tricky
  to filter these files out while allowing others being included
  for a particular build. So, in this case headers will be installed
  in directories
  /usr/local/include/db1    for db-1.85   and
  /usr/local/include/db3    for-db-3.x.x
  Second, the choice shall be made about names of libraries installed.
  Obviously, it is necessary to assign different names to each
  library file. This is because it is unusual and possibly
  violates FHS to create directory structures like /usr/local/lib/db1
  to keep library files there.
  Author has seen existing configurations with directories under
  ..../lib, but these directories have been populated architecture -
  depended data files, never libraries. When assigning names
  to libraries it makes sense to think also about ease of
  future installations. So less hacking required, so better.
  These future packages will check for and try to use libdb.{a,so}.
  db-3.x.x is much more powerful and has much less bugs and constraints.
  Thus, it makes sense to install the library files from
  db-3.x.x as libdb.{a,so} and to name these belong to db-1.85
  somehow differently.
  Third, needless to say that the header files and the corresponding
  library files shall be used in pair. The following general notes aimed
  to ease installations of packages using Berkeley DB functionality.
  A) At configure phase the construction
     CPPFLAGS=-I/usr/local/include/db3 \
     CFLAGS=-I/usr/local/include/db3 \
     shall be used, because /usr/local/include/db3
     is not amongst default directories for CPP.
     This allows for locating of the proper db.h and other
     headers on ./configure phase as well
     as make phase.
  B) There are several autoconf macros that perform checking for
     the presence of the particular name in a library.
     No much problem expected because of library name -
     it was decided to set it libdb.{a,so}, which is exactly what
     autoconf macros will use.
     However, the exported names being checked usually are
     dbopen(), dbclose(), and such.
     These are the names exported from db-1.85 libraries.
     The corresponding names in db-3.x.x libraries
     are __db_dbopen(), __db_dbclose(), etc.
     Thus, when configuring a package, ./configure output should
     be examined for lines like "checking for dbopen in libdb ... no"
     or similar. If this is the case, shall be edited,
     and parameters in macros that check for presence of say,
     dbopen in libdb shall be changed to __db_dbopen.
     As the last step before ./configure, autoconf must be run.
  The notes above is an author's attempt to explain decisions made by
  RPM-4.0 creators.
  He doesn't take any credits for configuration decisions made,
  because they originate directly from db-1.85, db-3.xx, RPM-4.0 SRPMs
  ( to the best of his knowledge ).
  However, he does take blames for any errors, omissions, etc.
  2. Packages to download


  3. Install all the auxiliary packages as Jason Gurtz hint says,
     except db-1.85, db-3.1.17, rpm-4.0
     At least, make sure you have zlib installed.
  4. Installation db-1.85
     You might want to download and apply the corresponding patches also.
  4.1 Before the build, the necessary fix should be made :
     In the file ./hash/hash.h change
     on the line 106 to
     After that, replace occurrences
     for following lines of files :
     lines 508 539 556 560 577 581 732
     lines 183 193
  4.2 Build and install the package
          cd PORT/linux
  or, if custom optimization desired,
          OORG="^OPT^" make -e
          install -m644 libdb.a /usr/local/lib/libdb1.a
          mkdir /usr/local/include/db1
          install -m644 ../include/ndbm.h /usr/local/include/db1
          install -m644 ../../include/db.h /usr/local/include/db1
          install -m644 ../../include/mpool.h /usr/local/include/db1
  5. Installation db-3.1.17
  5.1 Run
          cd build_unix
          CFLAGS="^OPT^" \
          CXXFLAGS="^OPT^" \
          ../dist/configure \
          --disable-nls \
          --enable-rpc \
          --enable-diagnostic \
          --enable-compat185 \
          --enable-cxx \
          --prefix=/usr/local \
          docdir=/usr/local/share/doc/BerkeleyDB.3.1.17 make -e install
  5.2 Run
          cd /usr/local/lib
          mv -v libdb.a libdb-3.1.a
          ln -sv libdb-3.1.a libdb.a
          mv -v libdb_cxx.a libdb_cxx-3.1.a
          ln -sv libdb_cxx-3.1.a libdb_cxx.a
  5.3 Repeat step 5.1 from scratch, this time configure
  5.4 Run
          chown root.root /usr/local/include/db3/db_cxx.h
  6. Installation rpm-4.0
  6.1 Run
          CPPFLAGS=-I/usr/local/include/db3 \
          CFLAGS="^OPT^" \
          ./configure \
          --disable-nls \
          --with-gnu-ld \
          --prefix=/usr/local \
          make install
          cd /usr/local/lib
  # This is the broken link fix
          rm -v rpmpopt
          ln -sv rpm/rpmpopt-4.0 rpmpopt
  # Do not run these commands if you're fluent in Polish, Russian, etc.
          cd /usr/local/share/man
          rm -r ja pl ru sk
  7. Possible ( not mandatory ) re-install of db-1.85
    At this point you should be able to open RPMs.
    The patch which comes with db-1.85.srpm from Red Hat
    is much better and fixes more problems with db-1.85
    than these from
  7.1 Apply the patch found in Red Hat SRPM to the source tree
      of the original db-1.85.
  7.2 Repeat step 4.2
  7.3 Run
          install -m755 /usr/local/lib/
          ln -sf /usr/local/lib/
          ln -sf /usr/local/lib/
          install -s -m755 db_dump185 /usr/local/bin/db1_dump185
  7.4 Re-install RPM4.0 ( step 6 ).

More information about the hints mailing list