summaryrefslogtreecommitdiffstats
path: root/release/vagrant-static
diff options
context:
space:
mode:
Diffstat (limited to 'release/vagrant-static')
-rw-r--r--release/vagrant-static/Vagrantfile110
-rwxr-xr-xrelease/vagrant-static/build-pkg.sh30
-rwxr-xr-xrelease/vagrant-static/build.sh84
-rw-r--r--release/vagrant-static/musl-pkg.sh24
-rwxr-xr-xrelease/vagrant-static/pkg.sh22
-rw-r--r--release/vagrant-static/provision-pkg.sh7
-rwxr-xr-xrelease/vagrant-static/provision.sh152
7 files changed, 429 insertions, 0 deletions
diff --git a/release/vagrant-static/Vagrantfile b/release/vagrant-static/Vagrantfile
new file mode 100644
index 0000000..98df560
--- /dev/null
+++ b/release/vagrant-static/Vagrantfile
@@ -0,0 +1,110 @@
+# -*- 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.provider "virtualbox" do |v|
+ v.memory = 2048
+ v.cpus = 4
+ end
+
+ config.vm.synced_folder ".", "/vagrant", type: "nfs"
+ config.vm.define :freebsd do |freebsd|
+ freebsd.vm.network "private_network", :type => 'dhcp'
+ freebsd.vm.provision "shell", path:"pkg.sh"
+ freebsd.vm.provision "shell", path:"provision.sh"
+ freebsd.vm.box = "freebsd/FreeBSD-12.1-RELEASE"
+ freebsd.vm.box_version = "2019.11.01"
+ freebsd.vm.synced_folder ".", "/vagrant", type: "nfs"
+ freebsd.ssh.shell = "sh"
+ freebsd.vm.base_mac = "080027D14C66"
+ freebsd.vm.boot_timeout = 1200
+ end
+
+ config.vm.define :musl do |musl|
+ musl.vbguest.auto_update = false
+ musl.vm.synced_folder ".", "/vagrant", type: "virtualbox"
+ musl.vm.network "private_network", ip: "192.168.56.16"
+ musl.vm.provision "shell", path:"musl-pkg.sh"
+ musl.vm.provision "shell", path:"provision.sh"
+ musl.vm.box = "generic/alpine315"
+ end
+
+ config.vm.define :linux do |linux|
+ linux.vm.network :private_network, ip: "192.168.56.14"
+ linux.vm.provision "shell", path:"pkg.sh"
+ linux.vm.provision "shell", path:"provision.sh"
+ linux.vm.box = "centos/7"
+ end
+
+ config.vm.define :pkger do |pkger|
+ # config.vm.synced_folder ".", "/vagrant", type: "nfs"
+ pkger.vm.network :private_network, ip: "192.168.56.15"
+ pkger.vm.provision "shell", path:"provision-pkg.sh"
+ pkger.vm.box = "ubuntu/xenial64"
+ 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
diff --git a/release/vagrant-static/build-pkg.sh b/release/vagrant-static/build-pkg.sh
new file mode 100755
index 0000000..232abd5
--- /dev/null
+++ b/release/vagrant-static/build-pkg.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+VERSION=$1
+
+fpm --verbose \
+ -s zip \
+ -t rpm \
+ -n "lnav" \
+ -v "$VERSION" \
+ -p /vagrant/ \
+ -a native \
+ --url https://lnav.org \
+ -m 'timothyshanestack@gmail.com' \
+ --description 'A log file viewer and analyzer for the terminal' \
+ --license BSD-2-Clause \
+ --category 'System/Monitoring' \
+ /vagrant/lnav-linux.zip
+
+fpm --verbose \
+ -s zip \
+ -t deb \
+ -n "lnav" \
+ -v "$VERSION" \
+ -p /vagrant/ \
+ -a native \
+ --url https://lnav.org \
+ -m 'timothyshanestack@gmail.com' \
+ --description 'A log file viewer and analyzer for the terminal' \
+ --license BSD-2-Clause \
+ /vagrant/lnav-linux.zip
diff --git a/release/vagrant-static/build.sh b/release/vagrant-static/build.sh
new file mode 100755
index 0000000..aa0491b
--- /dev/null
+++ b/release/vagrant-static/build.sh
@@ -0,0 +1,84 @@
+#!/usr/bin/env bash
+
+OS=$(uname -s)
+if test x"${OS}" != x"FreeBSD"; then
+ source scl_source enable devtoolset-9
+fi
+
+if test x"${OS}" != x"FreeBSD"; then
+ MAKE=make
+else
+ MAKE=gmake
+fi
+
+FAKE_ROOT=/home/vagrant/fake.root
+
+SRC_VERSION=$1
+
+mkdir -p ~/github
+
+cd ~/github
+if ! test -d lnav; then
+ git clone https://github.com/tstack/lnav.git
+fi
+
+cd ~/github/lnav
+git restore .
+git pull --rebase
+
+if test -n "$SRC_VERSION"; then
+ git checkout "$SRC_VERSION"
+fi
+
+saved_PATH=${PATH}
+export PATH=${FAKE_ROOT}/bin:${PATH}
+saved_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${FAKE_ROOT}/lib
+if test ! -f "configure"; then
+ ./autogen.sh
+ rm -rf ~/github/lbuild
+ mkdir -p ~/github/lbuild
+fi
+cd ~/github/lbuild
+
+TARGET_FILE='/vagrant/lnav-linux.zip'
+if test x"${OS}" != x"FreeBSD"; then
+ if test x"$(lsb_release | awk '{print $3}')" == x"Alpine"; then
+ TARGET_FILE='/vagrant/lnav-musl.zip'
+ ../lnav/configure \
+ --with-libarchive=${FAKE_ROOT} \
+ CFLAGS='-static -g1 -gz=zlib -no-pie -O2' \
+ CXXFLAGS='-static -g1 -gz=zlib -U__unused -no-pie -O2' \
+ LDFLAGS="-L${FAKE_ROOT}/lib" \
+ CPPFLAGS="-I${FAKE_ROOT}/include" \
+ LIBS="-L${FAKE_ROOT}/lib -lexecinfo -lssh2 -llzma -lssl -lcrypto -lz" \
+ --enable-static
+ PATH="${FAKE_ROOT}/bin:${PATH}"
+ else
+ ../lnav/configure \
+ --enable-static \
+ --with-libarchive=${FAKE_ROOT} \
+ LDFLAGS="-L${FAKE_ROOT}/lib" \
+ CPPFLAGS="-I${FAKE_ROOT}/include -O2" \
+ LIBS="-L${FAKE_ROOT}/lib -lssh2 -llzma -lssl -lcrypto -lz" \
+ PATH="${FAKE_ROOT}/bin:${PATH}"
+ fi
+else
+ ../lnav/configure \
+ --enable-static \
+ LDFLAGS="-L${FAKE_ROOT}/lib -static" \
+ LIBS="-lm -lelf" \
+ CPPFLAGS="-I${FAKE_ROOT}/include -O2" \
+ PATH="${FAKE_ROOT}/bin:${PATH}"
+fi
+
+${MAKE} -j2 && cp src/lnav /vagrant/lnav
+
+if test x"${OS}" != x"FreeBSD"; then
+ mkdir instdir
+ make install DESTDIR=$PWD/instdir
+ (cd instdir/ && zip -r "${TARGET_FILE}" .)
+fi
+
+export PATH=${saved_PATH}
+export LD_LIBRARY_PATH=${saved_LD_LIBRARY_PATH}
diff --git a/release/vagrant-static/musl-pkg.sh b/release/vagrant-static/musl-pkg.sh
new file mode 100644
index 0000000..fea8308
--- /dev/null
+++ b/release/vagrant-static/musl-pkg.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+sudo apk update && sudo apk upgrade
+sudo apk add \
+ build-base \
+ binutils \
+ m4 \
+ git \
+ zip \
+ perl \
+ ncurses \
+ ncurses-dev \
+ autoconf \
+ automake \
+ elfutils \
+ elfutils-dev \
+ libelf-static \
+ libexecinfo-dev \
+ libexecinfo-static \
+ libtool \
+ libunwind \
+ libunwind-dev \
+ libunwind-static \
+ linux-headers
diff --git a/release/vagrant-static/pkg.sh b/release/vagrant-static/pkg.sh
new file mode 100755
index 0000000..931dc33
--- /dev/null
+++ b/release/vagrant-static/pkg.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+OS=$(uname -s)
+if test x"${OS}" != x"FreeBSD"; then
+ sudo yum install -y \
+ zip \
+ unzip \
+ m4 \
+ autoconf \
+ automake \
+ ncurses \
+ ncurses-devel \
+ ncurses-static \
+ git \
+ centos-release-scl \
+ perl-Data-Dumper \
+ patch \
+ wget
+ sudo yum install -y "devtoolset-9-gcc*"
+else
+ pkg install -y wget git m4 bash autoconf automake sqlite3 gmake
+fi
diff --git a/release/vagrant-static/provision-pkg.sh b/release/vagrant-static/provision-pkg.sh
new file mode 100644
index 0000000..bb1991d
--- /dev/null
+++ b/release/vagrant-static/provision-pkg.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+# Installs dependencies for running fpm
+
+sudo apt-get update
+sudo apt-get install -y ruby2.3 ruby-dev gcc make zip unzip rpm
+sudo gem install fpm
diff --git a/release/vagrant-static/provision.sh b/release/vagrant-static/provision.sh
new file mode 100755
index 0000000..3b98103
--- /dev/null
+++ b/release/vagrant-static/provision.sh
@@ -0,0 +1,152 @@
+#!/usr/bin/env bash
+
+OS=$(uname -s)
+if test x"${OS}" != x"FreeBSD"; then
+ source scl_source enable devtoolset-9
+fi
+
+FAKE_ROOT=/home/vagrant/fake.root
+
+rm -rf ~/extract
+mkdir -p ${FAKE_ROOT} ~/packages ~/extract ~/github
+
+export PATH=${FAKE_ROOT}/bin:${PATH}
+
+cd ~/github
+
+SQLITE_CFLAGS="\
+ -DSQLITE_ENABLE_COLUMN_METADATA \
+ -DSQLITE_SOUNDEX \
+ -DSQLITE_ENABLE_DBSTAT_VTAB \
+ -DSQLITE_ENABLE_API_ARMOR \
+ -DSQLITE_ENABLE_JSON1 \
+ -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
+ "
+
+NCURSES_FALLBACKS="\
+ansi,\
+cygwin,\
+Eterm,\
+Eterm-256color,\
+gnome,\
+gnome-256color,\
+konsole,\
+konsole-256color,\
+linux,\
+putty,\
+rxvt,\
+rxvt-256color,\
+screen,\
+screen-16color,\
+screen-256color,\
+tmux,\
+tmux-256color,\
+vt100,\
+vt220,\
+xterm,\
+xterm-256color\
+"
+
+cd ~/extract
+
+for pkg in /vagrant/pkgs/*.tar.gz; do
+ tar xfz "$pkg"
+done
+
+(cd make-4.2.1 && ./configure --prefix=${FAKE_ROOT} && make && make install)
+
+OS=$(uname -s)
+
+
+(cd readline-6.3 && ./configure --prefix=${FAKE_ROOT} && make && make install)
+
+(cd bzip2-1.0.8 && make install PREFIX=${FAKE_ROOT})
+
+(cd sqlite-* &&
+ ./configure --disable-editline --prefix=${FAKE_ROOT} \
+ CFLAGS="${SQLITE_CFLAGS}" \
+ && \
+ make && make install)
+
+(cd openssl-* &&
+ ./config --prefix=${FAKE_ROOT} -fPIC &&
+ make &&
+ make install)
+
+(cd ncurses-6.3 && \
+ ./configure --prefix=${FAKE_ROOT} \
+ --enable-ext-mouse \
+ --enable-sigwinch \
+ --with-default-terminfo-dir=/usr/share/terminfo \
+ --enable-ext-colors \
+ --enable-widec \
+ --enable-termcap \
+ --with-fallbacks=$NCURSES_FALLBACKS \
+ && \
+ make && make install)
+
+(cd pcre2-* && \
+ ./configure --prefix=${FAKE_ROOT} \
+ --enable-jit \
+ && \
+ make && make install)
+
+if test x"${OS}" != x"FreeBSD"; then
+ (cd zlib-1.2.12 && ./configure --prefix=${FAKE_ROOT} && make && make install)
+
+ (cd libssh2-* &&
+ ./configure --prefix=${FAKE_ROOT} \
+ --with-libssl-prefix=${FAKE_ROOT} \
+ --with-libz-prefix=${FAKE_ROOT} \
+ "CPPFLAGS=-I${FAKE_ROOT}/include" \
+ "LDFLAGS=-ldl -L${FAKE_ROOT}/lib" &&
+ make &&
+ make install)
+
+ (cd curl-* &&
+ ./configure --prefix=${FAKE_ROOT} \
+ --with-libssh2=${FAKE_ROOT} \
+ --with-ssl=${FAKE_ROOT} \
+ --with-zlib=${FAKE_ROOT} \
+ "LDFLAGS=-ldl" &&
+ make &&
+ make install)
+else
+ (cd zlib-1.2.12 && ./configure --prefix=${FAKE_ROOT} "CFLAGS=-fPIC" \
+ && make && make install)
+
+ (cd libssh2-* &&
+ ./configure --prefix=${FAKE_ROOT} \
+ --with-libssl-prefix=${FAKE_ROOT} \
+ --with-libz-prefix=${FAKE_ROOT} \
+ &&
+ make &&
+ make install)
+
+ (cd curl-* &&
+ ./configure --prefix=${FAKE_ROOT} \
+ --with-libssh2=${FAKE_ROOT} \
+ --with-ssl=${FAKE_ROOT} \
+ --with-zlib=${FAKE_ROOT} \
+ "CFLAGS=-fPIC" &&
+ make &&
+ make install)
+fi
+
+(cd xz-* &&
+ ./configure --prefix=${FAKE_ROOT} \
+ --disable-shared \
+ "LDFLAGS=-L${FAKE_ROOT}/lib" \
+ "CPPFLAGS=-I${FAKE_ROOT}/include" \
+ &&
+ make &&
+ make install)
+
+(cd libarchive-* &&
+ ./configure --prefix=${FAKE_ROOT} \
+ --disable-shared \
+ "LDFLAGS=-L${FAKE_ROOT}/lib" \
+ "CPPFLAGS=-I${FAKE_ROOT}/include" \
+ &&
+ make &&
+ make install)