Difference between revisions of "Building gLExec from src rpm"

From PDP/Grid Wiki
Jump to navigationJump to search
(Building gLExec from src rpm moved to Building gLExec from src rpm gLite era)
 
Line 1: Line 1:
#REDIRECT [[Building gLExec from src rpm gLite era]]
+
== How to build gLExec from a .src.rpm ==
  
 +
This wiki used to describe instructions for the gLite era RPMs, the old page can be found [[Building gLExec from src rpm gLite era|here]].
 +
 +
The now advised method of rebuilding gLExec from source RPM is using the [http://software.nikhef.nl/dist/redhat/el5/mwsec/ Nikhef RPMs].
 +
 +
You can use the following shell script, which can be downloaded [http://www.nikhef.nl/grid/lcaslcmaps/glexec_from_src_rpm.sh here].
 +
Adapt the variables at the top to point to right directories and run it in a temporary directory as ordinary user.
 +
The resulting binary RPM will be found in the RPMS/*/ subdirectory.
 +
 +
<pre>
 +
#!/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-1
 +
 +
# 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
 +
</pre>

Revision as of 12:18, 21 July 2011

How to build gLExec from a .src.rpm

This wiki used to describe instructions for the gLite era RPMs, the old page can be found here.

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 and 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-1

# 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