Commit 8598343b authored by Michal Nowikowski's avatar Michal Nowikowski

added scripts for keama packaging

parent c2147767
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENV["LC_ALL"] = "C"
Vagrant.configure("2") do |config|
config.vm.box = "isc/lxc-" + ENV['DISTRO']
# config.vm.synced_folder '../../', '/isc-dhcp', disabled: true
# config.vm.provision "shell", privileged: false, path: "/vagrant/vagrant-pkg.sh"
end
#!/bin/bash
set -e -x
KEAMA_VERSION=$1
#DISTROS="debian-10 ubuntu-18.04 ubuntu-20.04 fedora-32 centos-7 centos-8"
DISTROS="debian-10 ubuntu-18.04 ubuntu-20.04 centos-7"
for d in $DISTROS; do
export DISTRO=$d
vagrant destroy -f || true
vagrant up
vagrant ssh -- /vagrant/vagrant-pkg.sh $KEAMA_VERSION
vagrant destroy -f
rm -rf $DISTRO
mkdir $DISTRO
mv keama/isc-dhcp-keama* $DISTRO/
done
#!/bin/bash
set -e -x
KEAMA_VERSION=$1
# install deps
if [ -e /etc/debian_version ]; then
FPM_TARGET=deb
sudo apt-get update --allow-releaseinfo-change
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ruby ruby-dev rubygems build-essential \
git wget unzip
else
FPM_TARGET=rpm
. /etc/os-release
# centos 7
if [ "$ID" == "centos" -a "$VERSION_ID" == "7" ]; then
sudo yum -y install gcc make rpm-build libffi-devel git wget unzip centos-release-scl
sudo yum --enablerepo=centos-sclo-rh -y install rh-ruby23 rh-ruby23-ruby-devel rh-ruby23-rubygems rh-ruby23-rubygem-rake
source /opt/rh/rh-ruby23/enable
echo 'source /opt/rh/rh-ruby23/enable' | sudo tee -a /root/.bashrc
else
if [ "$ID" == "centos" -a "$VERSION_ID" == "8" ]; then
sudo ping -c 4 onet.pl
fi
sudo dnf -y install --enablerepo=PowerTools ruby ruby-devel rubygems rubygem-rake gcc make rpm-build libffi-devel git wget unzip
fi
fi
sudo -i gem install --no-document fpm
# cleanup
pushd /vagrant
make clean || true
make distclean || true
# configure
./configure --prefix=/usr
# compile
pushd keama
make
# install to DESTDIR
rm -rf root
mkdir root
export DESTDIR=`pwd`/root
make install
# build package
rm -f isc-dhcp-keama*
fpm -n isc-dhcp-keama -v ${KEAMA_VERSION} \
--license 'ISC' \
--vendor 'Internet Systems Consortium, Inc.' \
--url 'https://gitlab.isc.org/isc-projects/dhcp' \
--description 'ISC DHCP Kea Migration Assistant' \
-s dir \
-t ${FPM_TARGET} \
-C ${DESTDIR} .
# check package
if [ -e /etc/debian_version ]; then
sudo dpkg -i isc-dhcp-keama_*_amd64.deb
else
sudo rpm -i isc-dhcp-keama*rpm
fi
ls -al /usr/sbin/keama
/usr/sbin/keama 2>&1 | grep Usage
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment