File: build_rpm.in

package info (click to toggle)
nexus 4.3.2-svn1921-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 45,052 kB
  • sloc: java: 70,724; cpp: 34,810; ansic: 19,434; xml: 4,191; python: 4,123; f90: 2,326; fortran: 1,529; makefile: 1,105; sh: 809; tcl: 173; lisp: 169; pascal: 93; haskell: 27
file content (47 lines) | stat: -rwxr-xr-x 1,703 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
#
# $Id$
#
# Script to build RPMs from current nexus*.tar.gz file
# Copyright (C) 2004 Freddie Akeroyd
#
# $1 is set to any options you want to pass to ./configure
#
# get topdir - must find a better way ...
topdir=`rpm --showrc|grep  " _topdir"| awk '{print $3}' | tail -1`
if test ! -e "$topdir"; then
    echo "Unable to determine RPM topdir from rpmrc; assuming $HOME/rpmbuild"
    topdir="$HOME/rpmbuild"
fi
if test ! -w "$topdir"; then
    echo "ERROR: RPM build directory not writable - check README.rpm"
    exit
fi
#
nxtop=`pwd`
rm -fr $nxtop/installroot
mkdir $nxtop/installroot
# 
make dist
ln -sf $nxtop/@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.gz $topdir/SOURCES
cp $nxtop/nexus.spec $topdir/SPECS
#
if test -z "$1"; then
    build_args='@CONFIGURE_ARGS@'
else
    build_args="$1"
fi
if ! test -z "$2"; then
    RESULTS=/tmp/nexus-mock-results
    mkdir -p $RESULTS
    mock_args="-r $2 --resultdir=$RESULTS"
    rm -f $RESULTS/*.src.rpm # clean up so do not pick up wrong .src.rpm later
    mock ${mock_args} --init
    mock ${mock_args} --buildsrpm --spec nexus.spec --sources . --define "nexus_config_options $build_args" --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" 
    srpm=`ls $RESULTS/*.src.rpm`
    mock ${mock_args} --rebuild $srpm --define "nexus_config_options $build_args" --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5"
else
# buildroot is actually where we install to
    cd $topdir/SPECS
    rpmbuild -ba --buildroot $nxtop/installroot --define "nexus_config_options $build_args" --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" nexus.spec
fi