2 # basic build script example
6 update_cmake_repo_trusty() {
7 sudo apt-get install -y --allow-unauthenticated software-properties-common
8 sudo add-apt-repository --yes ppa:george-edison55/cmake-3.x
11 update_cmake_repo_centos() {
12 sudo cat << EOF > cmake.repo
15 baseurl=http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64/
19 sudo cat << EOF > jsoncpp.repo
22 baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64/
26 sudo mv cmake.repo /etc/yum.repos.d/cmake.repo
27 sudo mv jsoncpp.repo /etc/yum.repos.d/jsoncpp.repo
35 if ! [ -z ${REPO_NAME} ]; then
36 REPO_URL="${NEXUSPROXY}/content/repositories/fd.io.${REPO_NAME}"
37 echo "REPO_URL: ${REPO_URL}"
42 if [ $DISTRIB_ID == "Ubuntu" ]; then
43 if [ "$DISTRIB_CODENAME" == "trusty" ]; then
44 update_cmake_repo_trusty
47 echo "deb ${REPO_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.list
50 elif [ "$DISTRIB_ID" == "CentOS" ]; then
51 update_cmake_repo_centos
52 sudo cat << EOF > fdio-master.repo
54 name=fd.io master branch latest merge
59 sudo mv fdio-master.repo /etc/yum.repos.d/fdio-master.repo
65 ARCHITECTURE=`uname -m`
67 # Figure out what system we are running on
68 if [ -f /etc/lsb-release ];then
70 source ./ubuntu-dependencies
74 if [ "$ARCHITECTURE" == "x86_64" ]; then
78 elif [ -f /etc/redhat-release ];then
79 source ./centos-dependencies
80 sudo yum install -y redhat-lsb
81 DISTRIB_ID=`lsb_release -si`
82 DISTRIB_RELEASE=`lsb_release -sr`
83 DISTRIB_CODENAME=`lsb_release -sc`
84 DISTRIB_DESCRIPTION=`lsb_release -sd`
89 echo "ERROR: System configuration not recognized. Build failed"
93 echo ARCHITECTURE: $ARCHITECTURE
94 echo DISTRIB_ID: $DISTRIB_ID
95 echo DISTRIB_RELEASE: $DISTRIB_RELEASE
96 echo DISTRIB_CODENAME: $DISTRIB_CODENAME
97 echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION
99 setup $DISTRIB_ID $DISTRIB_CODENAME
101 if [ $DISTRIB_ID == "Ubuntu" ]; then
102 echo $BUILD_TOOLS ${!PACKAGE_DEPS} | xargs sudo apt-get install -y --allow-unauthenticated
103 elif [ $DISTRIB_ID == "CentOS" ]; then
104 echo $BUILD_TOOLS_GROUP | xargs sudo yum groupinstall -y --nogpgcheck || true
105 echo $BUILD_TOOLS_SINGLE | xargs sudo yum install -y --nogpgcheck || true
106 echo ${!PACKAGE_DEPS} | xargs sudo yum install -y --nogpgcheck || true
109 # do nothing but print the current slave hostname
112 # Install package dependencies
114 export CCACHE_DIR=/tmp/ccache
115 if [ -d $CCACHE_DIR ];then
116 echo $CCACHE_DIR exists
119 echo $CCACHE_DIR does not exist. This must be a new slave.
122 echo "cat /etc/bootstrap.sha"
123 if [ -f /etc/bootstrap.sha ];then
124 cat /etc/bootstrap.sha
126 echo "Cannot find cat /etc/bootstrap.sha"
129 echo "cat /etc/bootstrap-functions.sha"
130 if [ -f /etc/bootstrap-functions.sha ];then
131 cat /etc/bootstrap-functions.sha
133 echo "Cannot find cat /etc/bootstrap-functions.sha"
136 echo "sha1sum of this script: ${0}"
140 mkdir -p build && pushd build
143 cmake -DCMAKE_INSTALL_PREFIX=/usr -DRPM_PACKAGE=$RPM -DDEB_PACKAGE=$DEB -DDISTRIBUTION=$DISTRIB_CODENAME -DARCHITECTURE=$ARCHITECTURE ..
146 echo "*******************************************************************"
147 echo "* $PACKAGE_NAME BUILD SUCCESSFULLY COMPLETED"
148 echo "*******************************************************************"