RPM Packaging Informix IDS 11.70 for CentOS 7

This is a rough version of my documentation for installing informix inside a container and then package it as RPM, I put it here in case it benefits anything else.

Stand Alone Install

  • Make sure you have the `rpm-build` package installed
  • Log in to the computer as root user if you want to perform a root installation that will run as privileged user informix.
  • Ensure that user informix and group informix exist on your system if you want to perform a root installation that will run with root-level privileges.

I started a clean CentOS 7 docker container, and run the installer inside it, and I also record the installation with `-r`

mkdir /tmp/informix-installer
tar -C /tmp/informix-installer/ -xvf ~builder/rpmbuild/SOURCES/iif.11.70.FC8DE.linux-x86_64.tar

cd /tmp/informix-installer
./ids_install -r /tmp/ids_install.answerfile -i console -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=/opt/informix

===============================================================================
Installation Goals
------------------

What do you want to accomplish?

    1- Install products and features
    2- Extract the product files (-DLEGACY option)
   *3- Create an RPM image pakcage

ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS ENTER TO ACCEPT THE DEFAULT:: 3

===============================================================================
Installation Location
---------------------

Choose location _for software installation

  Default Install Folder: /opt/informix

ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT
      : /opt/informix

===============================================================================
Choose Product Features
-----------------------

ENTER A COMMA_SEPARATED LIST OF NUMBERS REPRESENTING THE FEATURES YOU WOULD 
LIKE TO SELECT, OR DESELECT. TO VIEW A FEATURES DESCRIPTION, ENTER 
'?&lt;NUMBER&gt;'.  PRESS &lt;RETURN&gt; WHEN YOU ARE DONE:

    1- [X] IBM Informix database server
    2-  |-[X] Base Server
    3-  |-[X] Extensions and tools
    4-     |-[X] J/Foundation
    5-     |-[X] Database extensions
    6-     |-[X] Conversion and reversion support
    7-     |-[X] XML publishing
    8-  |-[X] Demonstration database scripts
    9-  |-[X] Enterprise Replication
   10-  |-[X] Data loading utilities
   11-     |-[X] onunload and onload utilities
   12-     |-[X] dbload utility
   13-     |-[X] High-Performance Loader
   14-  |-[X] Backup and Restore
   15-     |-[X] archecker utility
   16-     |-[X] ON-Bar utility
   17-     |-[X] Informix Storage Manager
   18-     |-[X] Informix interface to Tivoli Storage Manager
   19-  |-[X] Administrative utilities
   20-     |-[X] Performance monitoring utilities
   21-     |-[X] Miscellaneous monitoring utilities
   22-     |-[X] Auditing utilities
   23-     |-[X] Database import and export utilities
   24- [X] IBM Informix Client SDK
   25-  |-[X] IBM Informix Object Interface for C++
   26-     |-[X] IBM Informix Object Interface for C++ demos
   27-  |-[X] IBM Informix ESQL/C
   28-     |-[X] IBM Informix ESQL/C demos
   29-     |-[X] 7.2 application compatibility module
   30-  |-[X] IBM Informix LIBDMI for client applications
   31-  |-[X] IBM Informix ODBC Driver
   32-     |-[X] IBM Informix ODBC Driver demos
   33- [ ] IBM Informix Connect
   34-  |-[ ] IBM Informix Object Interface for C++
   35-  |-[ ] IBM Informix ESQL/C
   36-     |-[ ] 7.2 application compatibility module
   37-  |-[ ] IBM Informix LIBDMI for client applications
   38-  |-[ ] IBM Informix ODBC Driver
   39- [X] IBM Informix JDBC
   40- [X] Global Language Support (GLS)
   41-  |-[X] West European and Americas
   42-  |-[X] East European and Slavic
   43-  |-[X] Chinese
   44-  |-[X] Japanese
   45-  |-[X] Korean
   46-  |-[X] Thai
   47- [ ] IBM Informix OpenAdmin Tool
   48-  |-[ ] IBM Informix Replication Plug-in for OpenAdmin Tool
   49-  |-[ ] IBM Informix Schema Manager Plug-in for OpenAdmin Tool
   50-  |-[ ] IBM Informix TimeSeries Plug-in for OpenAdmin Tool
   51-  |-[ ] IBM Informix Health Advisor Plug-in for OpenAdmin Tool

Installation Summary

===============================================================================

Product Name:
    IBM Informix Software Bundle

Install Folder:
    /opt/informix

Product Features:
    IBM Informix database server,
    Base Server,
    Extensions and tools,
    J/Foundation,
    Database extensions,
    Conversion and reversion support,
    XML publishing,
    Demonstration database scripts,
    Enterprise Replication,
    Data loading utilities,
    onunload and onload utilities,
    dbload utility,
    High-Performance Loader,
    Backup and Restore,
    archecker utility,
    ON-Bar utility,
    Informix Storage Manager,
    Informix interface to Tivoli Storage Manager,
    Administrative utilities,
    Performance monitoring utilities,
    Miscellaneous monitoring utilities,
    Auditing utilities,
    Database import and export utilities,
    IBM Informix Client SDK,
    IBM Informix Object Interface for C++,
    IBM Informix Object Interface for C++ demos,
    IBM Informix ESQL/C,
    7.2 application compatibility module,
    IBM Informix ESQL/C demos,
    IBM Informix LIBDMI for client applications,
    IBM Informix ODBC Driver,
    IBM Informix ODBC Driver demos,
    Global Language Support (GLS),
    West European and Americas,
    East European and Slavic,
    Japanese,
    Korean,
    Chinese,
    Thai,
    IBM Informix JDBC

RPM image location:
    /opt/informix/RPMS/x86_64/informix-11.70.FC8-0.x86_64.rpm

Disk Space Information (for Installation Target): 
    Required:  587,782,910 Bytes
    Available: 8,693,800,960 Bytes

PRESS &lt;ENTER&gt; TO CONTINUE: 



===============================================================================
Ready To Install
----------------

InstallAnywhere is now ready to install IBM Informix Software Bundle onto your 
system at the following location:

   /opt/informix

PRESS &lt;ENTER&gt; TO INSTALL: 

===============================================================================
Installing...
-------------

 [==================|==================|==================|==================]
 [------------------|------------------|------------------|------------------]



===============================================================================
Installation Complete
---------------------

Congratulations! IBM Informix Software Bundle installation is complete.

Product install status:
IBM Informix 11.70: Successful
IBM Informix Client-SDK: Successful
IBM Informix JDBC Driver: Successful

RPM Generation: Failed

Look at
/opt/informix/rpmbuild.log
/opt/informix/IBM_Informix_Software_Bundle_InstallLog.log

For more information about using Informix products, see the IBM Informix 11.70 
Information Center at 
http://publib.boulder.ibm.com/infocenter/idshelp/v117/index.jsp.

As you can see the the RPM build failed, looking into the log file `/opt/informix/rpmbuild`, show this lines

+ umask 022
+ cd /opt/informix/BUILD
+ echo rpm prefix=/opt/informix
rpm prefix=/opt/informix
+ rm -rf /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64/opt
+ rm -rf /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64/tmp
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.Evs55O
+ umask 022
+ cd /opt/informix/BUILD
+ mkdir -p /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64/opt/informix
+ cd /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64/opt/informix
+ tar -xpjf /opt/informix/SOURCES/iif-1170.bz2
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.BQCSuL
+ umask 022
+ cd /opt/informix/BUILD
+ '[' /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64 '!=' / ']'
+ rm -rf /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64
++ dirname /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64
+ mkdir -p /opt/informix/BUILDROOT
+ mkdir /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64
+ export DONT_STRIP=1
+ DONT_STRIP=1
+ '[' '%{buildarch}' = noarch ']'
+ QA_CHECK_RPATHS=0
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
Processing files: informix-11.70.FC8-0.x86_64
error: File not found: /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64/opt/informix/rpm_postinstall.sh
error: File not found by glob: /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64/opt/informix/extend/krakatoa/jre/*
error: File not found by glob: /opt/informix/BUILDROOT/informix-11.70.FC8-0.x86_64/opt/informix/license/*
...

So I took the spec file from `/opt/informix/SPECS/iif.spec`,  And did some changes to it, (you can find up-2-date version of it on TODO: add link to github gist)

%define informixdir /opt/informix
%define _prefix %{informixdir}
%define __os_post_install %{nil}
%define __jar_repack %{nil}
%define __check_files %{nil}

Summary: IBM Informix Dynamic Server + J/Foundation
Vendor: IBM Corporation
Group: Applications/Databases
Name: informix
Version: 11.70.FC8
Release: 1
License: IBM Software License Agreement
Source0: iif-1170.tar.bz2
Packager: IBM Corporation
URL: http://www.ibm.com/software/data/informix/
AutoReqProv: no
ExclusiveArch: x86_64
ExclusiveOS: Linux

Conflicts:   informix-csdk
Requires:    shadow-utils file ksh

Provides: %{informixdir}/lib/cli/libifcli.so
Provides: %{informixdir}/lib/cli/libifdmr.so
Provides: %{informixdir}/lib/esql/libifgen.so
Provides: %{informixdir}/lib/esql/libifgls.so
Provides: %{informixdir}/lib/esql/libifglx.so
Provides: %{informixdir}/lib/esql/libifos.so
Provides: %{informixdir}/lib/esql/libifsql.so
Provides: %{informixdir}/lib/libifasf.so

#BuildRoot: %{_topdir}/BUILD/
#Prefix: /opt/informix

%description
IBM Informix Dynamic Server + J/Foundation

%prep
echo rpm prefix=%{_prefix}
rm -rf ${RPM_BUILD_ROOT}/opt
rm -rf ${RPM_BUILD_ROOT}/tmp

%build

%pre

getent group  informix >/dev/null || \
  groupadd -r informix
getent passwd informix >/dev/null || \
  useradd -r -g informix -d %{informixdir} -s /sbin/nologin informix
exit 0

%install
#export DONT_STRIP=1
mkdir -p  ${RPM_BUILD_ROOT}%{informixdir} && cd ${RPM_BUILD_ROOT}%{informixdir}
tar -C ${RPM_BUILD_ROOT}%{informixdir} -xvjf %{SOURCE0}

%{__rm} -rf ${RPM_BUILD_ROOT}%{informixdir}/IBM_Informix_Client_SDK_Install_*.log
%{__rm} -rf ${RPM_BUILD_ROOT}%{informixdir}/IBM_Informix_GLS_Install_*.log
%{__rm} -rf ${RPM_BUILD_ROOT}%{informixdir}/uninstall/uninstall_clientsdk
%{__rm} -rf ${RPM_BUILD_ROOT}%{informixdir}/uninstall_csdk
%{__rm} -f  ${RPM_BUILD_ROOT}%{informixdir}/tmp/*
%{__rm} -rf ${RPM_BUILD_ROOT}%{informixdir}/extend/krakatoa/jre
%{__rm} -rf ${RPM_BUILD_ROOT}%{informixdir}/extend/krakatoa/docs/launchpad/splash/{hpuxparisc,linuxs390,sunsparc,hpuxia64,linuxppc}/AZY_Splash

%post
licensefile=`rpm -ql informix | grep 'license/English.txt$'`
licensedir=`dirname $licensefile`
INFORMIXDIR=`dirname $licensedir`
cd $INFORMIXDIR
chmod 755 rpm_postinstall.sh
[ -f ./rpm_postinstall.sh ] &amp;&amp; nohup ./rpm_postinstall.sh &gt; /dev/null 2&gt;&amp;1
#run installgskit script
[ -f ./gskit/installgskit ] &amp;&amp; nohup ./gskit/installgskit &gt; /dev/null 2&gt;&amp;1

%clean
#rm -rf ${RPM_BUILD_ROOT}
#rm -rf %{_topdir}/SOURCES
#rm -rf %{_topdir}/SRPMS

%preun
licensefile=`rpm -ql informix | grep 'license/English.txt$'`
licensedir=`dirname $licensefile`
INFORMIXDIR=`dirname $licensedir`
[ -f /tmp/.informix-install-rpm-location ] &amp;amp;&amp;amp; rm -f /tmp/.informix-install-rpm-location
echo $INFORMIXDIR &gt;&gt; /tmp/.informix-install-rpm-location

%postun
if [ -f /tmp/.informix-install-rpm-location -a $1 -eq 0 ]
then
    INFORMIXDIR=`cat /tmp/.informix-install-rpm-location`
    cd $INFORMIXDIR
    for dir in SDK release properties jdbc incl help gls extend doc demo snmp msg license lib ism isa gskit forms etc dbssodir aaodir bin
    do
        if [ -d $dir ]
        then
            find $INFORMIXDIR/$dir -depth -empty -type d -exec rmdir '{}' \;
        fi
    done
    rm -f /tmp/.informix-install-rpm-location
fi

%files
# removed ..
  • Also had to set QA_CHECK_RPATHS=0 in ~/.rpmmacros to pass the rpath checks.
  • Also removed the jre/ folder to reduce some space.
  • And build with: rpmbuild -bb ~builder/rpmbuild/SPECS/iif.spec

Extra – Create a RPM repo

  • Copy the file to a Webserver and rebuild the repodata
rsync --delete -Prci RPMS/ my-repo.example.com:/www/repo/RPMS/
ssh my-repo.example.repo -- "createrepo /www/repo/RPMS"

this allow me to set a repo url for yum and install informix from it

Resources

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *