source: trunk/build_rpm.in @ 1822

Revision 1820, 1.7 KB checked in by Freddie Akeroyd, 3 months ago (diff)

Pass configure arguments properly to mock. Also update dependencies
to build NXvalidate. Refs #328

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/bin/sh
2#
3# $Id$
4#
5# Script to build RPMs from current nexus*.tar.gz file
6# Copyright (C) 2004 Freddie Akeroyd
7#
8# $1 is set to any options you want to pass to ./configure
9#
10# get topdir - must find a better way ...
11topdir=`rpm --showrc|grep topdir| awk '{print $3}' | tail -1`
12if test ! -e "$topdir"; then
13    echo "Unable to determine RPM topdir from rpmrc; assuming $HOME/rpmbuild"
14    topdir="$HOME/rpmbuild"
15fi
16if test ! -w "$topdir"; then
17    echo "ERROR: RPM build directory not writable - check README.rpm"
18    exit
19fi
20#
21nxtop=`pwd`
22rm -fr $nxtop/installroot
23mkdir $nxtop/installroot
24#
25make dist
26ln -sf $nxtop/@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.gz $topdir/SOURCES
27cp $nxtop/nexus.spec $topdir/SPECS
28#
29if test -z "$1"; then
30    build_args='@CONFIGURE_ARGS@'
31else
32    build_args="$1"
33fi
34if ! test -z "$2"; then
35    RESULTS=/tmp/nexus-mock-results
36    mkdir -p $RESULTS
37    mock_args="-r $2 --resultdir=$RESULTS"
38    rm -f $RESULTS/*.src.rpm # clean up so do not pick up wrong .src.rpm later
39    mock ${mock_args} --init
40    mock ${mock_args} --buildsrpm --spec nexus.spec --sources . --define "nexus_config_options $build_args" --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" 
41    srpm=`ls $RESULTS/*.src.rpm`
42    mock ${mock_args} --rebuild $srpm --define "nexus_config_options $build_args" --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5"
43else
44# buildroot is actually where we install to
45    cd $topdir/SPECS
46    rpmbuild -ba --buildroot $nxtop/installroot --define "nexus_config_options $build_args" --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" nexus.spec
47fi
Note: See TracBrowser for help on using the repository browser.