wiki:RpmHowToDevelopers

Version 7 (modified by Silvan Scherrer, 10 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.

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.

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

Ports usually only need make. But it doesn't hurt to install kbuild also, as it's used more and more.

yum install kbuild-make
yum install kbuild

some useful addons

yum install python-devel (python 2.7.6)
yum install perl (perl 5.16.1)
yum install os2-base-unixtools-path (adds x:\usr\bin before x:\OS2 in the PATH setting of config.sys)

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.