diff --git a/.gitignore b/.gitignore index f8f3c14..6312246 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .deps/ +.vagrant/ Makefile Makefile.in aclocal.m4 diff --git a/README b/README index d571154..1900629 100644 --- a/README +++ b/README @@ -70,6 +70,7 @@ backend to use. Recent versions of autoconf, automake, pkg-config and libtool must be installed. Help2man is used to generate the manpages. Gengetopt version 2.22.6 or later is needed for command line parameter handling. +The [Vagrant VM](vagrant/development) has all these dependencies preinstalled. Generate the build system using: diff --git a/vagrant/development/README.md b/vagrant/development/README.md new file mode 100644 index 0000000..61eddc4 --- /dev/null +++ b/vagrant/development/README.md @@ -0,0 +1,16 @@ +Vagrant VM for development +=== + +Usage: + + alice@work $ cd yubico-piv-tool/vagrant/development + alice@work $ vagrant up + alice@work $ vagrant ssh + ubuntu@ubuntu-xenial $ cd /vagrant + ubuntu@ubuntu-xenial $ autoreconf --install + ubuntu@ubuntu-xenial $ ./configure + ubuntu@ubuntu-xenial $ make + ubuntu@ubuntu-xenial $ sudo make install + ubuntu@ubuntu-xenial $ yubico-piv-tool --help + ubuntu@ubuntu-xenial $ exit + alice@work $ vagrant destroy diff --git a/vagrant/development/Vagrantfile b/vagrant/development/Vagrantfile new file mode 100644 index 0000000..e5ce751 --- /dev/null +++ b/vagrant/development/Vagrantfile @@ -0,0 +1,42 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + + # Use Ubuntu 16.04 Xenial as a base box. + config.vm.box = "ubuntu/xenial64" + + # Install dependencies needed for yubikey-piv-manager development. + config.vm.provision "shell", path: "provision.sh" + + # Sync repository to /vagrant + config.vm.synced_folder '../..', '/vagrant' + + # VirtualBox configuration + config.vm.provider "virtualbox" do |vb| + vb.name = "yubikey-piv-tool_development" + end + + # Uncomment this to add a USB filter for YubiKeys. + # This will connect the YubiKey to the VM when re-inserted. + # This filter uses VirtualBox as provider. + # Modify the paramters as needed depending on the device. + + FILTER_NAME="YubiKey 4" + MANUFACTURER="Yubico" + VENDOR_ID="0x1050" + PRODUCT_ID="0x0407" + PRODUCT="Yubikey 4 OTP+U2F+CCID" + + config.vm.provider "virtualbox" do |vb| + vb.customize ['modifyvm', :id, '--usb', 'on'] + vb.customize ['usbfilter', 'add', '0', + '--target', :id, + '--name', FILTER_NAME, + '--manufacturer', MANUFACTURER, + '--vendorid', VENDOR_ID, + '--productid', PRODUCT_ID, + '--product', PRODUCT] + end + +end diff --git a/vagrant/development/provision.sh b/vagrant/development/provision.sh new file mode 100644 index 0000000..c56292d --- /dev/null +++ b/vagrant/development/provision.sh @@ -0,0 +1,18 @@ +#! /usr/bin/env bash + +# Install development dependencies +sudo apt-get update -qq +sudo apt-get install -qq software-properties-common +sudo add-apt-repository -y ppa:yubico/stable +sudo apt-get update -qq && apt-get -qq upgrade +sudo apt-get install -qq \ + autoconf \ + automake \ + gengetopt \ + help2man \ + libpcsclite-dev \ + libssl-dev \ + libtool \ + libykpiv1 \ + pkg-config \ + virtualbox-guest-dkms