Mandrake rpm-howto
Artur Frysiak
wiget at t17.ds.pwr.wroc.pl
Mon May 31 21:16:02 CEST 1999
Witam
Oto jak w Mandrake widzą pakowanie programów.
Wiget
--
__ __ _ _
/ / /\ \ (_) __ _ ___| |_ @__mail: Artur Frysiak
\ \/ \/ / |/ _` |/ _ \ __| Rudlice 10
\ /\ /| | (_| | __/ |_ 98-311 Ostrowek
\/ \/ |_|\__, |\___|\__|
|___/ email: Wiget at t17.ds.pwr.wroc.pl
PGP key: http://www.t17.ds.pwr.wroc.pl/~wiget/pgp.key
Fingerprint16 = 70 DB E0 2D 12 AB C7 31 B6 58 B5 61 B3 98 B6 E6
-------------- next part --------------
Mandrake RPM HOWTO
Bernhard Rosenkraenzer <bero at linux-mandrake.com>
v0.1.1, 31 March 1999
______________________________________________________________________
1. Introduction
This HOWTO describes how to build an RPM package for the Mandrake
Linux distribution (http://www.linux-mandrake.com/).
It is intended for people already familiar with building RPMs; if you
don't know how to build an RPM, have a look at the RPM HOWTO (most
distributions have this in /usr/doc/HOWTO/RPM-HOWTO).
The instructions here are for Mandrake 6.0 or higher.
2. Adapting a RPM from a different distribution to Mandrake
If you already have a Source RPM from a different distribution, such as
Red Hat, you can build a Mandrake RPM with a few minor modifications:
2.1. BuildRoot
Some old RPMs are not using a "BuildRoot:" field in the .spec file; in
this case, the package will be installed in your root filesystem during
installation.
This is a bad thing, because it makes it almost impossible to verify the
functionality of the RPM, and it messes up the system the RPM is being
built on.
If your RPM doesn't have a BuildRoot, add it.
2.2. Release number
To let users know the RPM has been designed for use with Mandrake, add
"mdk" to the Release number ("Release: " field in the .spec file)
The "mdk" should go after the release number (i.e. Release: 1mdk).
2.3. bzip2 man/info pages
To save both diskspace and download time, Mandrake uses bzip2 to compress
man- and info-pages.
The easiest way to achieve this is to add
find $RPM_BUILD_ROOT/usr/man -type f -exec bzip2 -9f {} \;
find $RPM_BUILD_ROOT/usr/info -type f -exec bzip2 -9f {} \;
at the end of the %install section of the .spec file.
If the RPM you're trying to convert is using gzip'ed man- and info-pages,
you might have to add
find $RPM_BUILD_ROOT/usr/man -name "*.gz" -exec gunzip {} \;
find $RPM_BUILD_ROOT/usr/info -name "*.gz" -exec gunzip {} \;
prior to the other find commands.
You might need to adapt the %files section, and the %post and %postun
sections.
2.4. Optimization
Since Mandrake comes in several different versions with optimizations for
different CPUs, it is important that your RPM handles the RPM_OPT_FLAGS
variable by passing it to the C compiler. (Many RPMs from other
distributions already do this, some RPMs ignore the variable, though).
For autoconf'ed packages, the best way to do this is to replace
./configure --something
with
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure --something
For packages using xmkmf, replace
make
with
make CDEBUGFLAGS="$RPM_OPT_FLAGS" CXXDEBUGFLAGS="$RPM_OPT_FLAGS"
For other packages, you should have a look at the Makefile to see how
you can do it - in many (but not all) cases,
make CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"
is a solution.
If you want to provide a binary package along with your source RPM, please
use pgcc 1.1.2 as compiler, with the following RPM_OPT_FLAGS settings:
For the generic (386+) version:
-O2 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s -mcpu=i486
For the Pentium version:
-O2 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s
-mcpu=pentium -march=pentium -ffast-math -mieee-fp
-fexpensive-optimizations -malign-loops=2 -malign-jumps=2
-malign-functions=2
For the Pentium Pro/Pentium 2/Pentium 3 version:
-O2 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s
-mcpu=pentiumpro -march=pentiumpro -ffast-math -mieee-fp
-fexpensive-optimizations
For the K6 version:
-O2 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s
-mcpu=amdk6 -march=amdk6 -ffast-math -mieee-fp
-fexpensive-optimizations
For the Cyrix 6x86MX version:
-O2 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s
-mcpu=cyrix6x86 -march=pentiumpro -ffast-math -mieee-fp
-fexpensive-optimizations
We are providing a build script that automatically takes care of compiling
with these optimizations (it will automatically generate RPMs for every
version we're supporting).
It can be downloaded at
ftp://ftp.mandrakesoft.com/pub/bero/build
2.5. Recompress the sources (optional)
We prefer having the source files and patches bzip2'ed - this doesn't
affect the generated binary RPMs, but makes the SRPM shorter, saving
download time.
2.6. Paths
Textmode applications should go to /usr, textmode games to /usr/games.
X11 stuff should go to /usr/X11R6, with the exception being KDE and GNOME
stuff, which goes to /usr. (We are aware of the fact that this violates
all standards and is a stupid idea, but we want to be 100% backwards
compatible with Red Hat, so we have to take over their directory
structure.)
Configuration files should go to /etc - for some autoconf'ed applications,
./configure --sysconfdir=/etc
takes care of this - other applications might require Makefile changes
and/or source hacking.
2.7. Upload it!
You can upload your RPMs to ftp.linux-mandrake.com/incoming when you've
finished them.
3. Location of this HOWTO / Comments / Feedback
The most current version of this HOWTO can be found at
ftp://ftp.mandrakesoft.com/pub/bero/Mandrake-RPM-HOWTO.bz2
You can read it in your favorite editor after decompressing it using
bunzip2 Mandrake-RPM-HOWTO.bz2
If you have any comments/suggestions for this HOWTO, you can contact me
at bero at linux-mandrake.com.
More information about the pld-devel-pl
mailing list