Skip to content

Building XMLSec

linuxonz edited this page Jan 9, 2025 · 47 revisions

Building XMLSec

Below versions of XMLSec are available in respective distributions:

  • RHEL (8.8, 8.10) have 1.2.25
  • RHEL (9.2, 9.4, 9.5) have 1.2.29
  • SLES (15 SP6) have 1.2.37
  • Ubuntu 20.04 has 1.2.28
  • Ubuntu 22.04 has 1.2.33
  • Ubuntu 24.04 has 1.2.39
  • Ubuntu 24.10 has 1.2.41

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

  • RHEL (8.8, 8.10, 9.2, 9.4, 9.5)
  • SLES (15 SP6)
  • Ubuntu (20.04, 22.04, 24.04, 24.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

Build XMLSec

Step 1: Build using script

If you want to build XMLSec using manual steps, go to Step 2. Use the following commands to build XMLSec using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/XMLSec/1.3.6/build_xmlsec.sh
# Build XMLSec
bash build_xmlsec.sh   [Provide -t option for executing build with tests]

In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

Step 2: Build and Install XMLSec

2.1. Install dependencies

  • RHEL (8.8, 8.10)

    sudo yum install -y git make libtool libxslt-devel libtool-ltdl-devel diffutils openssl-devel wget tar texinfo gettext python2-devel 
  • RHEL (9.2, 9.4, 9.5)

    sudo yum install -y git make libtool libxslt-devel libtool-ltdl-devel diffutils tar wget perl-CPAN
  • SLES (15 SP6)

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

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

2.2. Set the ACLOCAL_PATH and PKG_CONFIG_PATH(Only for RHEL 8.x)

export ACLOCAL_PATH=/usr/share/aclocal
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig

2.3. Build and install automake and libxml2 from source(Only for RHEL 8.x)

cd $SOURCE_ROOT
git clone https://github.com/autotools-mirror/automake.git
cd automake
git checkout v1.16.5
./bootstrap
./configure
make
sudo make install
automake --version

cd $SOURCE_ROOT
git clone https://github.com/GNOME/libxml2.git
cd libxml2/
git checkout v2.10.4
./autogen.sh
make
sudo make install 
xml2-config --version

2.4. Build and install OpenSSL from source(Only for RHEL 9.X and 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"
openssl version

2.5. Get the source code

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

2.6. Generate and then run the configuration

./autogen.sh # Only for ubuntu 
./autogen.sh --without-gcrypt --with-openssl # Only for RHEL and SLES

2.7. Build and (optionally) test

make
make check

2.8. Install XMLSec and verify the installation

sudo make install
xmlsec1 --version
xmlsec1-config --version

References:

Clone this wiki locally