wiki:RpmHowToDevelopers

Version 5 (modified by Andib, 11 years ago) (diff)

--

RPM How-To for developers

Information's for developers: will explain the basic development cycle, from getting the source code, get it running under OS/2, create a diff file suitable for packaging.

Setup compiler

Once your local environment is working ok, to install the current gcc compilers, please install the following packages:

yum install libc-devel
yum install gcc

You should also install watcom linker and resource compiler. Note - Paul's build environment uses /moztools/ilink.exe per default.

yum install gcc-wlink
yum install gcc-wrc

Your CONFIG.SYS will be updated to allow gcc parser to use the new tools.

The following environment settings are needed to use the rpm version of the watcom linker wl.exe and ressource compiler wrc.exe. I've to make these setting in config.sys

set emxomfld_RC=wrc.exe
set emxomfld_RC_TYPE=WRC
set EMXOMFOPT=-q
set emxomfld_type=WLINK
set emxomfld_linker=wl.exe

In addition at least the WATCOM environment variable must point to your installed watcom tree. Otherwise the linker dose not find wlsystem.lnk. Something like

SET WATCOM=P:\watcom

The OpenWatcom? installer makes all required settings for you in the config.sys if you gave permission.

Make utility

Although I've installed all development related rpm packets I missed the gnu make utility. You can download gmake3.81 from ??fill in a proper address?? or use the version from Paul's environment.

Setup configure script

To setup your test tree with same variable configuration used by rpmbuild, you can use the following configure script wrapper:

CONFIG_SHELL=/bin/sh
export CONFIG_SHELL
LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
export LDFLAGS
LIBS="-lurpo -lmmap -lpthread"
export LIBS
CFLAGS="-O2 -g -march=i386 -mtune=i686 -Wall -W -Wmissing-prototypes -Wmissing-declarations"
export CFLAGS
BASECFLAGS="-O2 -g -march=i386 -mtune=i686"
export BASECFLAGS
CXXFLAGS="-O2 -g -march=i386 -mtune=i686"
export CXXFLAGS
FFLAGS="-O2 -g -march=i386 -mtune=i686"
export FFLAGS
./configure --host=i386-pc-os2-emx --build=i386-pc-os2-emx --program-prefix= --prefix=/@unixroot/usr \
        --exec-prefix=/@unixroot/usr --bindir=/@unixroot/usr/bin --sbindir=/@unixroot/usr/sbin \
        --sysconfdir=/@unixroot/etc --datadir=/@unixroot/usr/share --includedir=/@unixroot/usr/include \
        --libdir=/@unixroot/usr/lib --libexecdir=/@unixroot/usr/libexec --localstatedir=/@unixroot/var \
        --sharedstatedir=/@unixroot/usr/com --mandir=/@unixroot/usr/share/man --infodir=/@unixroot/usr/share/info \
   --enable-shared --disable-static \
   --disable-milter \
   --disable-rpath \
   --with-dbdir=/@unixroot/var/lib/clamav \
   --enable-languages=c --disable-ltdl-install --disable-fdpassing \
   --enable-check --disable-clamav \
   --disable-check \
   --disable-llvm \
   "--cache-file=F:/rpmbuild/cache/clamav.cache"

name it 'configure.rpm' and place in same directory of configure script. The first part of the configure line holds all system variables and must not be changed, the other lines have application specific parameters. This example is taken from ClamAV project.