diff --git a/util/debian-install/.gitignore b/util/debian-install/.gitignore new file mode 100644 index 0000000..c00df13 --- /dev/null +++ b/util/debian-install/.gitignore @@ -0,0 +1 @@ +*.deb diff --git a/util/debian-install/README.md b/util/debian-install/README.md new file mode 100644 index 0000000..4149703 --- /dev/null +++ b/util/debian-install/README.md @@ -0,0 +1,3 @@ +This directory contains the basic structure to test the installation of +Noosfero debian packages, using a fresh Vagrant VM and packages built in +${NOOSFEROROOT}/pkg/. diff --git a/util/debian-install/Vagrantfile b/util/debian-install/Vagrantfile new file mode 100644 index 0000000..0e9079e --- /dev/null +++ b/util/debian-install/Vagrantfile @@ -0,0 +1,29 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +require 'fileutils' +debs = `find ../../pkg/ -name '*.deb' | sort -t _ -V | tail -2`.split +if debs.empty? + puts "W: no debs built in ../../pkg/; will install local ones, or none at all" +else + local_debs = Dir.glob('*.deb') + debs.each do |f| + fn = File.basename(f) + if local_debs.include?(fn) + local_debs.delete(fn) + else + FileUtils::Verbose.ln f, '.' + end + end + local_debs.each do |f| + FileUtils::Verbose.rm_f f + end +end + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.box = "debian-wheezy" + config.vm.provision :shell, path: 'install' +end diff --git a/util/debian-install/install b/util/debian-install/install new file mode 100755 index 0000000..8514d20 --- /dev/null +++ b/util/debian-install/install @@ -0,0 +1,74 @@ +#!/bin/sh + +set -e +sudo apt-get install -qy netcat-traditional + +# 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 <