Skip to content

Building XMLSec

aborkar-ibm edited this page Dec 28, 2022 · 49 revisions

Building XMLSec

Below versions of XMLSec are available in respective distributions:

  • RHEL (7.8, 7.9) has 1.2.20
  • RHEL (8.4, 8.5, 8.7) has 1.2.25
  • RHEL (9.0, 9.1) has 1.2.29
  • SLES (12 SP5, 15 SP3) has 1.2.28
  • Ubuntu 18.04 has 1.2.25
  • Ubuntu 20.04 has 1.2.28
  • Ubuntu 21.10 has 1.2.32
  • Ubuntu 22.04 has 1.2.33
  • Ubuntu 22.10 has 1.2.34

The instructions provided below specify the steps to build XMLSec 1.2.36 on Linux on IBM Z for following distributions:

  • RHEL (7.8, 7.9, 8.4, 8.6, 8.7, 9.0, 9.1)
  • SLES (12 SP5,15 SP3)
  • Ubuntu (18.04, 20.04, 22.04, 22.10)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.
  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it

Step 1: Build and Install XMLSec

1) Install dependencies

  • RHEL (7.8, 7.9)

    sudo yum install git make libtool libxslt-devel libtool-ltdl-devel diffutils devtoolset-7 
  • RHEL (8.4, 8.5, 8.7)

    sudo yum install git make libtool libxslt-devel libtool-ltdl-devel diffutils 
  • RHEL (9.0, 9.1)

    sudo yum install git make libtool libxslt-devel libtool-ltdl-devel diffutils libgcrypt-devel
  • SLES 12 SP5

    sudo zypper install -y git-core make libtool libxslt-devel libopenssl-devel gawk gcc7 gcc7-c++
    sudo ln -sf /usr/bin/gcc-7 /usr/bin/gcc
    sudo ln -sf /usr/bin/g++-7 /usr/bin/g++
    sudo ln -sf /usr/bin/gcc /usr/bin/cc
  • SLES 15 SP3

    sudo zypper install git-core gcc make libtool libxslt-devel libopenssl-devel gawk
  • Ubuntu (18.04, 20.04, 21.10, 22.04)

    sudo apt-get update
    sudo apt-get install git make libtool libxslt1-dev autoconf libssl-dev libtool-bin pkg-config

2) Enable Software Collections: (Only for RHEL 7.x)

Xmlsec requires GCC 7. It is available on RHEL 7.x via the 'Software Collections' packaging system. You can find out more about Software Collections here: https://www.softwarecollections.org/en/.

Following command will enable GCC 7. The changes are not persistent and these commands will need to be re-run every time a new terminal session is started.

scl enable devtoolset-7 bash

3) Build and install OpenSSL from source(Only for Ubuntu 22.04)

Openssl 3.0 is available in repository for ubuntu 22.04 which is not supported by libtools

  cd $SOURCE_ROOT
  wget https://www.openssl.org/source/openssl-1.1.1h.tar.gz
  tar -xzvf openssl-1.1.1h.tar.gz
  cd openssl-1.1.1h
  ./config --prefix=/usr/local --openssldir=/usr/local
  make
  sudo make install

  export LDFLAGS="-L/usr/local/lib/ -L/usr/local/lib64/"
  export LD_LIBRARY_PATH=/usr/local/lib/:/usr/local/lib64/:/usr/lib/:/usr/lib64/${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  export CPPFLAGS="-I/usr/local/include/ -I/usr/local/include/openssl"

4) Get the source code

  export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  cd $SOURCE_ROOT
  git clone https://github.com/lsh123/xmlsec.git
  cd xmlsec
  git checkout xmlsec-1_2_36

5) Generate and then run the configuration

  ./autogen.sh

6) Build and (optionally) test

  make
  make check

7) Install XMLSec and verify the installation

  sudo make install
  xmlsec1 --version

References:

Clone this wiki locally