Typo
[linux_from_scratch_hints.git] / OLD / rpm.txt
blobfc72288b58da5de6c32574004871921cdbf560d1
1 TITLE:          Installation of RedHat Package Manager 4.0
2 LFS VERSION:    2.3.6
3 AUTHOR:         Jason Gurtz <jason(at)tommyk(dot)com>
5 SYNOPSIS:
6         The RPM package is used for installing, building, and maintaining '.rpm' packages.
8 HINT:
9 Background:
10 RPM is a package manager of dubious value to the average LFS'er. However, 
11 certain closed-source commercial applications require it for installation. 
12 Additionally, playing with it may be of educational value, and it may 
13 ease administration of a large and diverse network of UNIX and UNIX-like 
14 computers. Maybe it can do more than simply "Ruining a Perfectly 
15 good Machine."  ;)
17 *NOTE*
18 The INSTALL file mentions that both the Berkeley db1 and db3 packages are
19 needed.  I did not need to use or install the db1 package for a successfully
20 installed build of RPM-4.0.  Needless to say, I am not an experienced user
21 of RPM, so there may be some functionality that requires this somehow (maybe
22 conversion of old RPM packages to new?).  In any instance, please post any
23 needed changes to the lfs-apps ML and or mail me direct at the above addy
27 Source:
28 RedHat is the maintainer and active developer of the RPM package.  It's
29 home page is http://www.rpm.org/
31 Package Name:   rpm-4.0.tar.gz          (RPM 4.0)
32 Download here:  ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/
33 USE:                    This is the main package
35 Package Name:   zlib-1.1.3.tar.gz               (zlib compression lib.)
36 Download here:  ftp://ftp.freesoftware.com/pub/infozip/zlib/
37 USE:                    For compression support
39 Package name:   db-3.1.17.tar.gz                (Berkeley db3)
40 HTTP Download:
41 http://www.sleepycat.com/update/3.1.17/db-3.1.17.tar.gz
42 USE:                    RPM-4.0 uses this as it's database
44 Package Name:   gnupg-1.0.4.tar.gz      (GNU Privacy Guard)
45 Download here:  ftp://ftp.gnupg.org/pub/gcrypt/gnupg/
46 USE:                    For Cryptographically signing your packages
48 These other packages are needed/recommended, but you should have these all
49 ready installed as part of the base LFS system.
51 Among other things:
52 -bzip2
53 -gzip
54 -gettext
55 -perl
56 -GNU tar
58 Installation:
60 First we'll install zlib.  (should be easy)
62     ./configure && make test && make install
64 Next lets install our crypto (gnupg)...  The use of this software
65 requires a source of random numbers.  There are a few ways, but the 
66 easiest is to use /dev/random and /dev/urandom.  If you don't have these 
67 in your /dev directory create them with:
69     mknod /dev/random c 1 8
70     mknod /dev/urandom c 1 9
72 Now we build.  As root do:
74     ./configure --disable-nls && make && make install
76 Installation defaults to /usr/local/bin, make sure this is in your path.
77 When install finishes you should create your key pair.  As root:
79     gpg --gen-key
81 This will start a script that creates a dir or few and some
82 files. It will tell you to re run it so just type the same thing again 
83 (gpg --gen-key). This starts a scrip asking for real name, etc to be 
84 associated with your key. Because your system is prolly not to busy it 
85 may complain that it needs more Bytes from the /dev/random.  You can 
86 simply start typing (a lot) what ever you feel like and it will finish, 
87 but the easiest way to generate more randomness is to log into another 
88 virtual terminal and start compiling our next package.  :)
90 So, let's do the Berkeley db-3.17 package.  Two things are special:  the
91 configure script is located in the dist sub-directory 
92 (/usr/src/db-3.1.17/dist/), and you run configure like this:
94     ./configure --enable-compat185
96 This is because the original RPM versions used the db1 database from
97 sleepycat.  Next, do your:
99     make && make install
101 While this is going (takes a little bit) monitor your gnupg key creation.
102 When that finishes make a symlink in /usr/local/bin for backwards
103 compatibility:
105     ln -s /usr/local/bin/gpg /usr/local/bin/gpgm
107 That was the last part to installing gnupg.  Now when the db3 finishes
108 installing note that it is installed to /usr/local/BerkeleyDB.3.1/...  That
109 will be important for our last step, installing the rpm-4.0 package.
111 First run the preliminary script like this:
113     ./autogen.sh --noconfigure
115 Somewhat irritatingly a source file seems to want to find something where
116 it's not, so:
118     cd /usr/src/rpm-4.0/lib/ && vim db3.c
120 type ':12' <enter> to goto line 12 and change it to read:
122     #include </usr/local/BerkeleyDB.3.1/include/db.h>
124 Now we're ready to go.  Pay careful attention to the stuff
125 prepended to the
126 ../configure invocation:
128     LIBS='-L/usr/local/BerkeleyDB.3.1/lib' \
129 > CPPFLAGS='-I/usr/local/BerkeleyDB.3.1/include' \
130 > ./configure
132 When ./configure finishes just run (as root):
134     make && make install
136 You can disregard all the pointer warnings that fly by. When it's done, you
137 should be able to type:
139     rpm --version
141 and see the version come up.  One last thing to do is initialize and 
142 rebuild the database. As root, type:
144     rpm --initdb
145     rpm --rebuilddb
147 A good final test of basic functionality is to download an SRPM package.
148 This will be  someDumbProg-0.0.1.src.rpm  All it is is a tarball in 
149 disguise. To get at it simply:
151     rpm -i -vv someDumbProg-0.0.1.src.rpm
153 note from the -vv (extra verbose) output that the .tar.gz gets dumped in
154 /usr/local/src/redhat/SOURCES  along with maybe a patch file or other nice
155 extras.  Also note that the database itself is at /var/local/lib/rpm/Packages  
156 There are 3 levels of "rc" config files. global is /usr/local/lib/rpm/rpmrc  
157 Machine specific is /etc/rpmrc user level is ~/.rpmrc