Building gLExec from src rpm

From PDP/Grid Wiki
Jump to navigationJump to search

THIS PAGE NEEDS UPDATING TO EMI-3/UMD-3

It is strongly advised to install, patch and rebuild the gLExec src rpm from https://software.nikhef.nl/dist/mwsec/rpm/ in case adaptations are needed



How to build gLExec from a .src.rpm

The now advised method of rebuilding gLExec from source RPM is using the Nikhef RPMs:

  • You can use the following shell script, which can be downloaded here
  • Adapt the variables at the top to point to right directories
  • Run it in a temporary directory as ordinary user.
  • The resulting binary RPM will be found in the RPMS/*/ subdirectory.
#!/bin/sh

# SET CUSTOM BUILD ARGUMENTS HERE

# gLite-3.2 and EMI-1
lcmaps_moddir_sfx=/modules # LCMAPS moduledir is ${libdir}${lcmaps_moddir_sfx}
lcas_moddir_sfx=/modules   # LCAS moduledir is ${libdir}${lcas_moddir_sfx}

# EMI-2 and EPEL
#lcmaps_moddir_sfx=/lcmaps # LCMAPS moduledir is ${libdir}${lcmaps_moddir_sfx}
#lcas_moddir_sfx=/lcas     # LCAS moduledir is ${libdir}${lcas_moddir_sfx}

# gLite-3.2 directories
glexec_pfx=/opt/glite
glexec_etc=/opt/glite/etc
glexec_doc=/opt/glite/share/doc

# EMI and EPEL directories
#glexec_pfx=/usr
#glexec_etc=/etc
#glexec_doc=/usr/share/doc

lcmaps_version=1.4.30-1
glexec_version=0.8.11-2

# END OF BUILD ARGUMENTS

# Setup build infrastructure
export TOPDIR=`pwd`
mkdir -p $TOPDIR/{SRPMS,SOURCES,SPECS,BUILD,RPMS/x86_64,RPMS/i386}

# Download and install lcmaps-interface and glexec src
rpm2cpio http://software.nikhef.nl/dist/redhat/el5/mwsec/x86_64/lcmaps-interface-${lcmaps_version}.x86_64.rpm | cpio -id
rpm --define "_topdir $TOPDIR" -i http://software.nikhef.nl/dist/redhat/el5/mwsec/SRPMS/glexec-${glexec_version}.src.rpm

# Patch spec file to match module directories for LCAS and LCMAPS
sed -i "s+^\(%configure\).*+\1 --with-lcmaps-moduledir-sfx=$lcmaps_moddir_sfx --with-lcas-moduledir-sfx=$lcas_moddir_sfx+" $TOPDIR/SPECS/glexec.spec

# Build the RPM
CFLAGS=-I$TOPDIR/usr/include rpmbuild \
    --nodeps \
    -ba --define "_topdir $TOPDIR" \
    --define "_prefix $glexec_pfx" \
    --define "_sysconfdir $glexec_etc" \
    --define "_defaultdocdir $glexec_doc" \
    $TOPDIR/SPECS/glexec.spec