xqf/tools/travis_update_packages
Thomas Debesse 0dcc9b3fa7 update scripts
- script file extension considered harmful
- adding missing license on scripts
  they are brand new and not covered by GPL
2018-03-17 23:16:48 +01:00

49 lines
1.4 KiB
Bash
Executable File

#! /bin/sh
# Author: Thomas Debesse
# License: ISC
# please run this script as root user
# please use tabs for indentation (heredocs starting with <<-EOF need tabs)
echo 'Updating package list'
apt-get update -qq
# ubuntu trusty dependencies
echo 'Installing qstat, intltool, cmake, libgtk2.0-dev, libgeoip-dev dependencies'
apt-get install -q -y qstat intltool cmake libgtk2.0-dev libgeoip-dev
# libminizip-dev is not in trusty
# building xqf requires gettext 0.19 or later for 'msgfmt --desktop'
# if release is older than xenial (16.04)
if [ "$(lsb_release -sr | cut -c1-2)" -lt '16' ]
then
echo 'Adding xenial respository'
<<-EOF cat >> '/etc/apt/sources.list.d/ubuntu-xenial-main.list'
deb http://archive.ubuntu.com/ubuntu xenial main universe
EOF
echo 'Pin xenial repository to disable package installation from this repository by default'
<<-EOF cat > '/etc/apt/preferences.d/xenial-pinning'
Package: *
Pin: release n=xenial
Pin-Priority: -100
EOF
echo 'Adding the xenial repository key'
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32
echo 'Updating package list'
apt-get update -qq
echo 'Installing libminizip-dev gettext dependencies from xenial repository'
# updated gettext requires libgomp1 gcc-5-base
apt-get install -y -q -t xenial libminizip-dev gettext libgomp1 gcc-5-base
else
echo 'Installing libminizip-dev dependency'
apt-get install -q -y libminizip-dev
fi
#EOF