Typo
[linux_from_scratch_hints.git] / OLD / rpm_glibc22.txt
blobc3b2c07b9d9b511bcc2ac710a0fcfce8669a4784
1 TITLE:          RPM-4.0 for glibc-2.2 installation howto
2 LFS VERSION:    2.4.3
3 AUTHOR:         Sergey Ostrovsky <sergey@linuxfromscratch.org>
5 SYNOPSIS:
6         How to install RPM 4.0 on a glibc-2.2-based LFS system.
8 HINT:
9 ver 1.6
10 02/03/2001
12 Contents
13 --------
15 1. How things will be done and why
16 2. Packages to download
17 3. Install all the auxiliary packages as Jason Gurtz hint says
18 4. Installation db-1.85
19 5. Installation db-3.1.17
20 6. Installation rpm-4.0
21 7. Possible ( not mandatory ) re-install of db-1.85
24 1. How things will be done and why
25    -------------------------------
27 There is already rpm-hint by  Jason Gurtz which documents the
28 installation not only db-3.x.x, RPM-4.0, but also other useful
29 corresponding packages, like gnupg.
30 These things won't be covered here to save space and eliminate duplication.
31 Where appropriate the token ^OPT^ used to designate the possible
32 place for custom compiler's optimization and architecture flags.
34 For the proper installation of RPM-4.0 two versions of
35 Berkeley DB shall be installed first :
36 db-1.85 and db-3.x.x. This means that the latest available
37 release can be used just for the later package.
38 This need for two versions of Berkeley DB to be present in the
39 system introduces some mild complications which must be understood.
40 These complications make impact not only on the installation of RPM-4.0
41 but also on many other packages which depend on Berkeley DB
42 functionality.
44 First, the both db-1.85 and db-3.x.x install the file db.h
45 as the main header file. Contents of these db.h are not equal.
46 Additionally it is usually assumed that the header files
47 that belong to a particular package are installed in the one
48 separate directory but not spread among several directories.
49 This means each full set of headers for db-1.85 and db-3.x.x
50 should occupy a separate directory. Also, it would be inconvenient
51 to have one of the sets installed in a default directory
52 ( say, /usr/local/include ), because it is really tricky
53 to filter these files out while allowing others being included
54 for a particular build. So, in this case headers will be installed
55 in directories
56 /usr/local/include/db1    for db-1.85   and
57 /usr/local/include/db3    for-db-3.x.x
59 Second, the choice shall be made about names of libraries installed.
60 Obviously, it is necessary to assign different names to each
61 library file. This is because it is unusual and possibly
62 violates FHS to create directory structures like /usr/local/lib/db1
63 to keep library files there.
64 Author has seen existing configurations with directories under
65 ..../lib, but these directories have been populated architecture -
66 depended data files, never libraries. When assigning names
67 to libraries it makes sense to think also about ease of
68 future installations. So less hacking required, so better.
69 These future packages will check for and try to use libdb.{a,so}.
70 db-3.x.x is much more powerful and has much less bugs and constraints.
71 Thus, it makes sense to install the library files from
72 db-3.x.x as libdb.{a,so} and to name these belong to db-1.85
73 somehow differently.
75 Third, needless to say that the header files and the corresponding
76 library files shall be used in pair. The following general notes aimed
77 to ease installations of packages using Berkeley DB functionality.
79 A) At configure phase the construction
81    CPPFLAGS=-I/usr/local/include/db3 \
82    CFLAGS=-I/usr/local/include/db3 \
83    ./configure
85    shall be used, because /usr/local/include/db3
86    is not amongst default directories for CPP.
87    This allows for locating of the proper db.h and other
88    headers on ./configure phase as well
89    as make phase.
90 B) There are several autoconf macros that perform checking for
91    the presence of the particular name in a library.
92    No much problem expected because of library name -
93    it was decided to set it libdb.{a,so}, which is exactly what
94    autoconf macros will use.
95    However, the exported names being checked usually are
96    dbopen(), dbclose(), and such.
97    These are the names exported from db-1.85 libraries.
98    The corresponding names in db-3.x.x libraries
99    are __db_dbopen(), __db_dbclose(), etc.
100    Thus, when configuring a package, ./configure output should
101    be examined for lines like "checking for dbopen in libdb ... no"
102    or similar. If this is the case, configure.in shall be edited,
103    and parameters in macros that check for presence of say,
104    dbopen in libdb shall be changed to __db_dbopen.
105    As the last step before ./configure, autoconf must be run.
107 The notes above is an author's attempt to explain decisions made by
108 RPM-4.0 creators.
109 He doesn't take any credits for configuration decisions made,
110 because they originate directly from db-1.85, db-3.xx, RPM-4.0 SRPMs
111 ( to the best of his knowledge ).
112 However, he does take blames for any errors, omissions, etc.
114 2. Packages to download
115    -------------------
117 db-1.85.tar.gz
118 db-3.1.17.tar.gz
119         www.sleepycat.com
121 rpm-4.0.tar.gz
122         www.rpm.org
124 3. Install all the auxiliary packages as Jason Gurtz hint says,
125    -----------------------------------------------------------
127    except db-1.85, db-3.1.17, rpm-4.0
128    At least, make sure you have zlib installed.
131 4. Installation db-1.85
132    --------------------
134    You might want to download and apply the corresponding patches also.
136 4.1 Before the build, the necessary fix should be made :
138    In the file ./hash/hash.h change
139         errno
140    on the line 106 to
141         m_errno
143    After that, replace occurrences
144         ->errno
145    with
146         ->m_errno
147    for following lines of files :
149    ./hash/hash.c
150    lines 508 539 556 560 577 581 732
152    ./hash/ndbm.c
153    lines 183 193
155 4.2 Build and install the package
157         cd PORT/linux
159         make
160 or, if custom optimization desired,
161         OORG="^OPT^" make -e
163         install -m644 libdb.a /usr/local/lib/libdb1.a
165         mkdir /usr/local/include/db1
167         install -m644 ../include/ndbm.h /usr/local/include/db1
169         install -m644 ../../include/db.h /usr/local/include/db1
171         install -m644 ../../include/mpool.h /usr/local/include/db1
173 5. Installation db-3.1.17
174    ----------------------
176 5.1 Run
178         cd build_unix
180         CFLAGS="^OPT^" \
181         CXXFLAGS="^OPT^" \
182         ../dist/configure \
183         --disable-nls \
184         --enable-rpc \
185         --enable-diagnostic \
186         --enable-compat185 \
187         --enable-cxx \
188         --prefix=/usr/local \
189         --includedir=/usr/local/include/db3
191         make
193         docdir=/usr/local/share/doc/BerkeleyDB.3.1.17 make -e install
195 5.2 Run
196         cd /usr/local/lib
198         mv -v libdb.a libdb-3.1.a
200         ln -sv libdb-3.1.a libdb.a
202         mv -v libdb_cxx.a libdb_cxx-3.1.a
204         ln -sv libdb_cxx-3.1.a libdb_cxx.a
206 5.3 Repeat step 5.1 from scratch, this time configure
207    additionally
209         --enable-shared
211 5.4 Run
213         chown root.root /usr/local/include/db3/db_cxx.h
215 6. Installation rpm-4.0
216    --------------------
218 6.1 Run
220         CPPFLAGS=-I/usr/local/include/db3 \
221         CFLAGS="^OPT^" \
222         ./configure \
223         --disable-nls \
224         --with-gnu-ld \
225         --prefix=/usr/local \
226         --mandir=/usr/local/share/man
228         make
230         make install
232         cd /usr/local/lib
234 # This is the broken link fix
236         rm -v rpmpopt
238         ln -sv rpm/rpmpopt-4.0 rpmpopt
240 # Do not run these commands if you're fluent in Polish, Russian, etc.
242         cd /usr/local/share/man
244         rm -r ja pl ru sk
246 7. Possible ( not mandatory ) re-install of db-1.85
247    -----------------------------------------------
248   At this point you should be able to open RPMs.
249   The patch which comes with db-1.85.srpm from Red Hat
250   is much better and fixes more problems with db-1.85
251   than these from sleepycat.com.
253 7.1 Apply the patch found in Red Hat SRPM to the source tree
254     of the original db-1.85.
256 7.2 Repeat step 4.2
258 7.3 Run
260         install -m755 libdb.so.2 /usr/local/lib/libdb1.so.2
262         ln -sf libdb1.so.2 /usr/local/lib/libdb1.so
264         ln -sf libdb1.so.2 /usr/local/lib/libdb.so.2
266         install -s -m755 db_dump185 /usr/local/bin/db1_dump185
268 7.4 Re-install RPM4.0 ( step 6 ).