File: build-on-linux.sh

package info (click to toggle)
condor 23.9.6%2Bdfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 60,012 kB
  • sloc: cpp: 528,272; perl: 87,066; python: 42,650; ansic: 29,558; sh: 11,271; javascript: 3,479; ada: 2,319; java: 619; makefile: 615; xml: 613; awk: 268; yacc: 78; fortran: 54; csh: 24
file content (43 lines) | stat: -rwxr-xr-x 1,368 bytes parent folder | download
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
#!/bin/bash

# Build RPMs and debs for Linux in the current directory using the
# source in the named directory
. /etc/os-release
if [ $ID = 'almalinux' ] || [ $ID = 'amzn' ] || [ $ID = 'centos' ] ||
   [ $ID = 'debian' ] || [ $ID = 'fedora' ] || [ $ID = 'opensuse-leap' ] ||
   [ $ID = 'ubuntu' ]; then

    # Locate the source directory
    if [ $# -eq 1 -a -d $1 ]; then
        src_dir=$1
    else
        echo "Usage: $0 <source-directory>"
        exit 1
    fi

    # Determine the HTCondor version number
    condor_version=$(awk -F\" '/^set\(VERSION / {print $2}' ${src_dir}/CMakeLists.txt)
    echo "Building HTCondor version ${condor_version}"

    # Fake a BUILD-ID if one not provided
    if [ ! -f BUILD-ID ]; then
        date +'%Y%m%d%H%M' > BUILD-ID
    fi

    # Create the source tarball from the source directory
    mkdir -p condor-${condor_version}
    cp -p ${src_dir}/.??* condor-${condor_version} > /dev/null 2>&1
    cp -pr ${src_dir}/* condor-${condor_version} > /dev/null 2>&1
    tar cfz condor-${condor_version}.tgz condor-${condor_version}
    rm -rf condor-${condor_version}

    # Call the official build scripts
    if [ -f /etc/debian_version ]; then
        exec ${src_dir}/nmi_tools/glue/build/build_uw_deb.sh
    else
        exec ${src_dir}/nmi_tools/glue/build/build_uw_rpm.sh
    fi
fi

echo 'Unsupported Linux Release'
exit 1