[vagrant] Fix builds and add support for FreeBSD.

+ The sqlite certificates have changed and not trusted by wget, so use
  the http protocol to download the binary.
+ Add support for FreeBSD builds.
+ Move stuff around to support FreeBSD builds.
+ Destroy the vagrant VM after a successful build.
pull/223/head
Suresh Sundriyal 9 years ago
parent 0ad313a342
commit b854940d22

@ -7,17 +7,21 @@ outbox:
clean-outbox: outbox
rm -f outbox/*
linux-vm:
cd vagrant-static-linux && vagrant up
.PHONY: linux freebsd
linux-build: linux-vm
cd vagrant-static-linux && vagrant ssh -c /vagrant/build.sh
%-vm: %
cd vagrant-static-$< && vagrant up
linux-package: clean-outbox linux-build
mkdir -p linux-pkg/lnav-${VERSION}
cp ../README ../NEWS linux-pkg/lnav-${VERSION}
cp vagrant-static-linux/lnav linux-pkg/lnav-${VERSION}
cd linux-pkg && zip -r ../outbox/lnav-${VERSION}-linux-64bit.zip lnav-${VERSION}
%-build: % %-vm
cd vagrant-static-$< && vagrant ssh -c /vagrant/build.sh && vagrant destroy -f
%-package: % clean-outbox %-build
mkdir -p $<-pkg/lnav-${VERSION}
cp ../README ../NEWS $<-pkg/lnav-${VERSION}
mv vagrant-static-$</lnav $<-pkg/lnav-${VERSION}
rm -f vagrant-static-$</build.sh
cd $<-pkg && zip -r ../outbox/lnav-${VERSION}-$<-64bit.zip lnav-${VERSION}
osx-build:
rm -rf osx-build-dir
@ -33,4 +37,4 @@ osx-package: clean-outbox osx-build
cp osx-build-dir/lnav-${VERSION}.tar.bz2 outbox/
cd osx-pkg && zip -r ../outbox/lnav-${VERSION}-os-x.zip lnav-${VERSION}
release: linux-package osx-package
release: linux-package freebsd-package osx-package

@ -1,4 +1,4 @@
#! /bin/bash
#! /usr/bin/env bash
FAKE_ROOT=/home/vagrant/fake.root
@ -24,11 +24,20 @@ mkdir -p ~/github/lbuild
cd ~/github/lbuild
../lnav/configure \
CC="gcc44" \
CXX="g++44" \
LDFLAGS="-L${FAKE_ROOT}/lib" \
PATH="${FAKE_ROOT}/bin:${PATH}" \
CPPFLAGS="-I${FAKE_ROOT}/include"
OS=$(uname -s)
if test x"${OS}" != x"FreeBSD"; then
../lnav/configure \
LDFLAGS="-L${FAKE_ROOT}/lib" \
CC="gcc44" \
CXX="g++44" \
PATH="${FAKE_ROOT}/bin:${PATH}" \
CPPFLAGS="-I${FAKE_ROOT}/include"
else
../lnav/configure \
LDFLAGS="-L${FAKE_ROOT}/lib" \
PATH="${FAKE_ROOT}/bin:${PATH}" \
CPPFLAGS="-I${FAKE_ROOT}/include"
fi
make -j2 && strip -o /vagrant/lnav src/lnav

@ -1,4 +1,4 @@
#! /bin/bash
#! /usr/bin/env bash
FAKE_ROOT=/home/vagrant/fake.root
@ -7,13 +7,6 @@ mkdir -p ~/fake.root ~/packages ~/extract ~/github
export PATH=${FAKE_ROOT}/bin:${PATH}
wget -N http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
sudo rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
sudo rpm -K rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
sudo rpm -U rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
sudo yum install -y m4 git gcc44-c++
cd ~/github
PACKAGE_URLS="\
@ -24,7 +17,7 @@ PACKAGE_URLS="\
ftp://ftp.cwru.edu/pub/bash/readline-6.3.tar.gz \
http://zlib.net/zlib-1.2.8.tar.gz \
http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz \
https://sqlite.org/2015/sqlite-autoconf-3080803.tar.gz"
http://sqlite.org/2015/sqlite-autoconf-3080803.tar.gz"
cd ~/packages
@ -42,26 +35,47 @@ done
(cd automake-1.15 && ./configure --prefix=${FAKE_ROOT} && make && make install)
(cd ncurses-5.9 && \
./configure --prefix=${FAKE_ROOT} \
--enable-ext-mouse \
--enable-sigwinch \
--with-default-terminfo-dir=/usr/share/terminfo \
--enable-ext-colors \
--enable-widec \
CC="gcc44" \
CXX="g++44" \
&& \
make && make install)
(cd pcre-8.36 && \
./configure --prefix=${FAKE_ROOT} \
--enable-jit \
--enable-utf \
CC="gcc44" \
CXX="g++44" \
&& \
make && make install)
OS=$(uname -s)
if test x"${OS}" != x"FreeBSD"; then
(cd ncurses-5.9 && \
./configure --prefix=${FAKE_ROOT} \
--enable-ext-mouse \
--enable-sigwinch \
--with-default-terminfo-dir=/usr/share/terminfo \
--enable-ext-colors \
--enable-widec \
CC="gcc44" \
CXX="g++44" \
&& \
make && make install)
(cd pcre-8.36 && \
./configure --prefix=${FAKE_ROOT} \
--enable-jit \
--enable-utf \
CC="gcc44" \
CXX="g++44" \
&& \
make && make install)
else
(cd ncurses-5.9 && \
./configure --prefix=${FAKE_ROOT} \
--enable-ext-mouse \
--enable-sigwinch \
--with-default-terminfo-dir=/usr/share/terminfo \
--enable-ext-colors \
--enable-widec \
&& \
make && make install)
(cd pcre-8.36 && \
./configure --prefix=${FAKE_ROOT} \
--enable-jit \
--enable-utf \
&& \
make && make install)
fi
(cd readline-6.3 && ./configure --prefix=${FAKE_ROOT} && make && make install)

@ -0,0 +1,80 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "arkadi/freebsd-10.1-amd64"
config.vm.provision "shell", path: "pkg.sh"
config.vm.provision "shell", path: "../provision.sh"
config.vm.provision "file", source: "../build.sh", destination: "/vagrant/build.sh"
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 4
end
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# sudo apt-get update
# sudo apt-get install -y apache2
# SHELL
end

@ -0,0 +1,3 @@
#! /usr/bin/env bash
pkg install -y wget git gcc m4

@ -12,7 +12,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "hansode/centos-5.6-x86_64"
config.vm.provision "shell", path: "provision.sh"
config.vm.provision "shell", path: "pkg.sh"
config.vm.provision "shell", path: "../provision.sh"
config.vm.provision "file", source: "../build.sh", destination: "/vagrant/build.sh"
config.vm.provider "virtualbox" do |v|
v.memory = 2048

@ -0,0 +1,9 @@
#! /usr/bin/env bash
wget -N http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
sudo rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
sudo rpm -K rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
sudo rpm -U rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
sudo yum install -y m4 git gcc44-c++
Loading…
Cancel
Save