forked from jfut/ganeti-rpm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
executable file
·40 lines (32 loc) · 1.13 KB
/
setup
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
#!/bin/bash
#
# Setup environment to build RPM
set -euo pipefail
export LC_ALL=C
PACKAGER_DIR="$(cd "$(dirname "${0}")" && echo "${PWD}")"
# RPM macros
RPM_DIST=$(egrep "\%dist" /etc/rpm/macros.dist | awk '{ print $2 }' | sed -E 's|^(\..*)\..*|\1|')
# Setup build tools
echo
echo "# Setup build tools"
PACKAGE_MANAGER=""
if [[ "${RPM_DIST}" = ".el8" ]]; then
echo "# - Install build tools for el8"
dnf -y groupinstall "Development Tools"
dnf -y install sudo wget git-core rpm-build rpmdevtools spectool yum-utils createrepo epel-release
dnf -y install pinentry
dnf config-manager --enable powertools
elif [[ "${RPM_DIST}" = ".el7" ]]; then
echo "# - Remove centos vault repository"
if [[ -f /etc/yum.repos.d/CentOS-Vault.repo ]]; then
rm -f /etc/yum.repos.d/CentOS-Vault.repo /etc/yum.repos.d/CentOS-Sources.repo
fi
echo "# - Install build tools for el7"
yum -y groupinstall "Development Tools"
yum -y install sudo wget git-core rpm-build rpmdevtools spectool yum-utils createrepo epel-release
yum clean all
fi
# Setup GHC environment
echo
echo "# Setup GHC environment"
${PACKAGER_DIR}/setup-ghc