recreate-configure.sh 953 Bytes
Newer Older
1
2
#!/bin/bash

3
4
set -e -E -u -o pipefail

5
# recreates 'configure' from 'configure.ac'
6
# this script should run on Ubuntu 22.04
7
8
AUTOCONF_VERSION=$(cat R-package/AUTOCONF_UBUNTU_VERSION)

9
10
11
12
13
14
15
16
# R packages cannot have versions like 3.0.0rc1, but
# 3.0.0-1 is acceptable
LGB_VERSION=$(cat VERSION.txt | sed "s/rc/-/g")

# this script changes configure.ac. Copying to a temporary file
# so changes to configure.ac don't get committed in git
TMP_CONFIGURE_AC=".configure.ac"

17
18
19
20
21
22
23
24
25
echo "Creating 'configure' script with Autoconf ${AUTOCONF_VERSION}"

apt update
apt-get install \
    --no-install-recommends \
    -y \
        autoconf=${AUTOCONF_VERSION}

cd R-package
26
27
28
29

cp configure.ac ${TMP_CONFIGURE_AC}
sed -i.bak -e "s/~~VERSION~~/${LGB_VERSION}/" ${TMP_CONFIGURE_AC}

30
31
autoconf \
    --output configure \
32
    ${TMP_CONFIGURE_AC} \
33
    || exit 1
34

35
36
rm ${TMP_CONFIGURE_AC}

37
38
39
rm -r autom4te.cache || echo "no autoconf cache found"

echo "done creating 'configure' script"