Last active
April 2, 2020 14:49
-
-
Save zrhoffman/db16bceee6b7820e6ffbaceb78aee6aa to your computer and use it in GitHub Desktop.
Traffic Ops in CentOS 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
( trap 'echo "Error on line ${LINENO} of '"$0"'"; exit 1' ERR; | |
set -o errexit -o nounset; | |
dnf -y update; | |
dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm; | |
dnf -y module disable postgresql; | |
dnf -y install epel-release patch; | |
dnf -y --enablerepo=PowerTools install cpanminus expat-devel gcc-c++ golang libpcap-devel mkisofs openssl-devel perl perl-core perl-DBD-Pg perl-DBI perl-Digest-SHA1 libidn-devel libcurl-devel postgresql96 postgresql96-devel perl-JSON perl-libwww-perl perl-Test-CPAN-Meta perl-WWW-Curl perl-TermReadKey perl-Crypt-ScryptKDF; | |
dnf -y install traffic_ops.rpm; | |
cd /opt/traffic_ops/app; | |
cpanm -i Carton inc::Module::Install; | |
export POSTGRES_HOME=/usr/pgsql-9.6 PERL5LIB=$(pwd)/local/lib/perl5; | |
modules=(WWW::Curl::Easy Net::Pcap); | |
patches=(http://cpan.cpantesters.org/authors/id/S/SR/SREZIC/patches/WWW-Curl-4.17-RT117793.patch https://src.fedoraproject.org/rpms/perl-Net-Pcap/raw/master/f/Net-Pcap-0.18-Fix-build-with-libpcap-1.9.0.patch); | |
for index in ${!modules[@]}; do | |
<<BASH_COMMANDS SHELL=/bin/bash cpanm --local-lib=./local --look ${modules[$index]}; | |
trap 'echo "Error on line \${LINENO} of '"\$0"'"; exit 1' ERR; | |
set -o errexit -o pipefail; | |
curl -v '${patches[$index]}' | | |
patch; | |
perl Makefile.PL; | |
make; | |
make install; | |
BASH_COMMANDS | |
done; | |
carton; | |
perl ../install/bin/postinstall -defaults; | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment