cirandas.net

ref: master

util/debian-install/install


#!/bin/sh

DISTRO=jessie
REPOSITORY='jessie-test'

if [ -n "$1" ]; then
  REPOSITORY="$1"
fi

set -e
sudo apt-get install -qy netcat-traditional shunit2 curl

# apt-cacher-ng running on the host
# 10.0.2.2 = host ip on virtualbox/qemu
# 192.168.122.1 = host ip on default libvirt bridge
for ip in 10.0.2.2 192.168.122.1; do
  if nc -z -w 1 $ip 3142; then
    echo "Acquire::http::Proxy \"http://$ip:3142\";" | sudo tee /etc/apt/apt.conf.d/01proxy
  fi
done

apt-key add - < /etc/apt/sources.list.d/noosfero.list < /etc/apt/sources.list.d/backports.list

export DEBIAN_FRONTEND=noninteractive

# local debs
if [ -n "$(find /vagrant -name '*.deb')" ]; then
  apt-get install -qy apt-utils bzip2
  (
    rm -rf /opt/noosfero
    mkdir /opt/noosfero
    cp /vagrant/*.deb /opt/noosfero
    cd /opt/noosfero
    apt-ftparchive packages . > Packages
    cat Packages | gzip - > Packages.gz
    cat Packages | bzip2 - > Packages.bz2
    apt-ftparchive release . > Release
    echo 'deb [trusted=yes] file:///opt/noosfero ./' > /etc/apt/sources.list.d/local.list
  )
else
  rm -f /etc/apt/sources.list.d/local.list
fi

apt-get update
apt-get dist-upgrade -qy
apt-get install -qy postgresql postfix

apt-cache policy noosfero
apt-get install -qy noosfero noosfero-apache

a2dissite 000-default
service apache2 reload