aboutsummaryrefslogtreecommitdiffstats
path: root/docker/build/build-vespa-internal.sh
blob: 7e88aa77fdf57b76a511306e5cce2e60054e99e8 (plain) (blame)
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
#!/bin/bash
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
set -e

if [ $# -ne 3 ]; then
  echo "Usage: $0 <vespa version> <caller uid> <caller gid>"
  echo "This script should not be called manually."
  exit 1
fi
VESPA_VERSION=$1
CALLER_UID=$2
CALLER_GID=$3

cd /vespa
./dist.sh ${VESPA_VERSION}

yum -y install epel-release
yum -y install centos-release-scl

# CentOS messed up the source repo. The source repos are marked as enabled=0, but
# the yum-builddep below does not respect this setting. Hack around it for now.
sed -i 's,http://vault.centos.org/centos/7/sclo/Source/rh/,http://vault.centos.org/centos/7/sclo/Source/sclo/,g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo

yum-config-manager --add-repo https://copr.fedorainfracloud.org/coprs/g/vespa/vespa/repo/epel-7/group_vespa-vespa-epel-7.repo

yum-builddep -y ~/rpmbuild/SPECS/vespa-${VESPA_VERSION}.spec
rpmbuild -bb ~/rpmbuild/SPECS/vespa-${VESPA_VERSION}.spec
chown ${CALLER_UID}:${CALLER_GID} ~/rpmbuild/RPMS/x86_64/*.rpm
mv ~/rpmbuild/RPMS/x86_64/*.rpm /vespa/docker