Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

Commit

Permalink
Use package and version variables in packaging scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
swalner-pivotal committed Nov 6, 2019
1 parent d1a051c commit a9c5063
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 36 deletions.
44 changes: 25 additions & 19 deletions packages/cifs-utils/packaging
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,58 @@ set -e
temp_path=${PWD}/temp
mkdir $temp_path

tar xf autoconf-2.69.tar.gz

pushd autoconf-2.69
AUTOCONF_PACKAGE=autoconf
AUTOCONF_VERSION=2.69
tar xf $AUTOCONF_PACKAGE-$AUTOCONF_VERSION.tar.gz
pushd $AUTOCONF_PACKAGE-$AUTOCONF_VERSION
./configure --prefix=${temp_path}
make
make install
export PATH=${PATH}:${temp_path}/bin
popd

tar xf automake-1.15.tar.gz

pushd automake-1.15
AUTOMAKE_PACKAGE=automake
AUTOMAKE_VERSION=1.15
tar xf $AUTOMAKE_PACKAGE-$AUTOMAKE_VERSION.tar.gz
pushd $AUTOMAKE_PACKAGE-$AUTOMAKE_VERSION
./configure --prefix=${temp_path}
make
make install
popd

tar xf libtool-2.4.6.tar.gz

pushd libtool-2.4.6
LIBTOOL_PACKAGE=libtool
LIBTOOL_VERSION=2.4.6
tar xf $LIBTOOL_PACKAGE-$LIBTOOL_VERSION.tar.gz
pushd $LIBTOOL_PACKAGE-$LIBTOOL_VERSION
./configure --prefix=${temp_path}
make
make install
popd

tar xf talloc-2.1.9.tar.gz

pushd talloc-2.1.9
TALLOC_PACKAGE=talloc
TALLOC_VERSION=2.1.9
tar xf $TALLOC_PACKAGE-$TALLOC_VERSION.tar.gz
pushd $TALLOC_PACKAGE-$TALLOC_VERSION
./configure --prefix=${temp_path}
make
make install
popd

tar xf pkg-config-0.29.2.tar.gz

pushd pkg-config-0.29.2
PKG_CONFIG_PACKAGE=pkg-config
PKG_CONFIG_VERSION=0.29.2
tar xf $PKG_CONFIG_PACKAGE-$PKG_CONFIG_VERSION.tar.gz
pushd $PKG_CONFIG_PACKAGE-$PKG_CONFIG_VERSION
./configure --prefix=${temp_path} --with-internal-glib
make
make install
popd

tar jxf cifs-utils-6.7.tar.bz2

pushd cifs-utils-6.7
CIFS_PACKAGE=cifs-utils
CIFS_VERSION=6.7
tar jxf $CIFS_PACKAGE-$CIFS_VERSION.tar.bz2
pushd $CIFS_PACKAGE-$CIFS_VERSION
autoreconf -i
./configure --prefix=${temp_path}
make CPPFLAGS="-I${temp_path}/include"
cp mount.cifs ${BOSH_INSTALL_TARGET}
cp -a mount.cifs ${BOSH_INSTALL_TARGET}
popd
8 changes: 6 additions & 2 deletions packages/cni/packaging
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
set -exu

mkdir -p ${BOSH_INSTALL_TARGET}/bin
tar -xzf cni/cni-plugins-amd64*.tgz -C ${BOSH_INSTALL_TARGET}/bin/

CNI_PACKAGE="cni-plugins"
CNI_VERSION="0.7.1"

tar -xzf cni/${CNI_PACKAGE}-amd64-${CNI_VERSION}.tgz -C ${BOSH_INSTALL_TARGET}/bin/

mkdir -p utillocal
dpkg -x cni/util-linux*.deb utillocal/

cp utillocal/usr/bin/nsenter ${BOSH_INSTALL_TARGET}/bin
cp -a utillocal/usr/bin/nsenter ${BOSH_INSTALL_TARGET}/bin

chmod +x ${BOSH_INSTALL_TARGET}/bin/*
13 changes: 11 additions & 2 deletions packages/conntrack/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
set -e

mkdir -p "${BOSH_INSTALL_TARGET:?}/"
cp -a conntrack/* "${BOSH_INSTALL_TARGET:?}"
cp libmnl0* "${BOSH_INSTALL_TARGET:?}"

CONNTRACK_PACKAGE=conntrack
CONNTRACK_VERSION="1.4.3"
cp -a conntrack/${CONNTRACK_PACKAGE}_${CONNTRACK_VERSION}-3_amd64.deb "${BOSH_INSTALL_TARGET:?}/"

LIBNETFILTER_PACKAGE=libnetfilter-conntrack3
LIBNETFILTER_VERSION="1.0.5"
cp -a conntrack/${LIBNETFILTER_PACKAGE}_${LIBNETFILTER_VERSION}-1_amd64.deb "${BOSH_INSTALL_TARGET:?}/"

LIBMN_PACKABE=libmnl0
LIBMN_VERSION="1.0.3"
cp -a ${LIBMN_PACKAGE}_${LIBMN_VERSION}-5_amd64.deb "${BOSH_INSTALL_TARGET:?}/"
5 changes: 3 additions & 2 deletions packages/etcdctl/packaging
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set -e

ETCDCTL_PACKAGE=etcdctl
ETCDCTL_VERSION="3.0.7"

main() {
Expand All @@ -8,11 +9,11 @@ main() {
}

copy_binary() {
cp -a etcdctl-${ETCDCTL_VERSION} "${BOSH_INSTALL_TARGET:?}/etcdctl"
cp -a ${ETCDCTL_PACKAGE}-${ETCDCTL_VERSION} "${BOSH_INSTALL_TARGET:?}/etcdctl"
}

make_executable() {
chmod +x "${BOSH_INSTALL_TARGET:?}/etcdctl"
}

main
main
3 changes: 2 additions & 1 deletion packages/flanneld/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
set -e

FLANNELD_PACKAGE=flannel
FLANNELD_VERSION="0.11.0"
tar xvf flannel-v${FLANNELD_VERSION}-linux-amd64.tar.gz
tar xvf ${FLANNEL_PACKAGE}-v${FLANNELD_VERSION}-linux-amd64.tar.gz
cp -a flanneld "${BOSH_INSTALL_TARGET:?}/flanneld"
chmod +x "${BOSH_INSTALL_TARGET:?}/flanneld"
8 changes: 7 additions & 1 deletion packages/ipset/packaging
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
set -e

mkdir -p "${BOSH_INSTALL_TARGET:?}/"
cp -a ipset/* "${BOSH_INSTALL_TARGET:?}"

IPSET_PACKAGE=ipset
IPSET_VERSION=6.20.1
LIBIPSET_PACKAGE=libipset3
LIBIPSET_VERSION=6.20.1
cp -a ipset/${IPSET_PACKAGE}_${IPSET_VERSION}-1_amd64.deb "${BOSH_INSTALL_TARGET:?}/"
cp -a ipset/${LIBIPSET_PACKAGE}_${LIBIPSET_VERSION}-1_amd64.deb "${BOSH_INSTALL_TARGET:?}/"
9 changes: 6 additions & 3 deletions packages/jq/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
set -e # exit immediately if a simple command exits with a non-zero status
set -u # report the usage of uninitialized variables
set -eu

mkdir -p $BOSH_INSTALL_TARGET/bin
cp -a jq-linux64-1.6 $BOSH_INSTALL_TARGET/bin/jq

JQ_PACKAGE=jq
JQ_VERSION="1.6"

cp -a ${JQ_PACKAGE}-linux64-${JQ_VERSION} $BOSH_INSTALL_TARGET/bin/jq/
chmod +x $BOSH_INSTALL_TARGET/bin/jq
3 changes: 2 additions & 1 deletion packages/kubernetes/packaging
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set -e

KUBERNETES_PACKAGE=kubernetes
KUBERNETES_VERSION="1.15.5"

main() {
Expand All @@ -15,7 +16,7 @@ create_target_dir() {

copy_depedencies_to_bosh() {
cp -a container-images/* "${BOSH_INSTALL_TARGET:?}/container-images"
cp -a kubernetes-${KUBERNETES_VERSION}/* "${BOSH_INSTALL_TARGET:?}/bin"
cp -a ${KUBERNETES_PACKAGE}-${KUBERNETES_VERSION}/* "${BOSH_INSTALL_TARGET:?}/bin"
}

make_binaries_executable() {
Expand Down
17 changes: 16 additions & 1 deletion packages/nfs/packaging
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
set -e

NFSCOMMON_PACKAGE="nfs-common"
NFSCOMMON_VERSION="1.2.8"
KEYUTILS_PACKAGE=keyutils
KEYUTILS_VERSION="1.5.9"
LIBEVENT_PACKAGE=libevent
LIBEVENT_VERSION="2.0.21"
LIBNFSIDMAP_PACKAGE=libnfsidmap2
LIBNFSIDMAP_VERSION="0.25"
RPCBIND_PACKAGE=rpcbind
RPCBIND_VERSION="0.2.3"

mkdir -p "${BOSH_INSTALL_TARGET:?}/"
cp -a nfs-debs/* "${BOSH_INSTALL_TARGET:?}"
cp -a nfs-debs/${NFSCOMMON_PACKAGE}_1:${NFSCOMMON_VERSION}-9ubuntu12.1_amd64.deb "${BOSH_INSTALL_TARGET:?}/"
cp -a nfs-debs/${KEYUTILS_PACKAGE}_${KEYUTILS_VERSION}-8ubuntu1_amd64.deb "${BOSH_INSTALL_TARGET:?}/"
cp -a nfs-debs/${LIBEVENT_PACKAGE}-2.0-5_${LIBNFSIDMAP_VERSION}-stable-2ubuntu0.16.04.1_amd64.deb "${BOSH_INSTALL_TARGET:?}/"
cp -a nfs-debs/${LIBNFSIDMAP_PACKAGE}_${LIBNFSIDMAP_VERSION}-5_amd64.deb "${BOSH_INSTALL_TARGET:?}/"
cp -a nfs-debs/${RPCBIND_PACKAGE}_${RPCBIND_VERSION}-0.2_amd64.deb "${BOSH_INSTALL_TARGET:?}/"
11 changes: 7 additions & 4 deletions packages/socat/packaging
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
set -e # exit immediately if a simple command exits with a non-zero status
set -u # report the usage of uninitialized variables
set -eu

mkdir -p $BOSH_INSTALL_TARGET/bin
tar xzf socat-1.7.3.2.tar.gz

SOCAT_PACKAGE=socat
SOCAT_VERSION="1.7.3.2"

tar xzf ${SOCAT_PACKAGE}-${SOCAT_VERSION}.tar.gz
pushd socat-1.7.3.2
./configure
make
cp socat ${BOSH_INSTALL_TARGET}/bin
cp -a socat ${BOSH_INSTALL_TARGET}/bin
chmod 755 ${BOSH_INSTALL_TARGET}/bin/socat
popd
chmod +x $BOSH_INSTALL_TARGET/bin/socat

0 comments on commit a9c5063

Please sign in to comment.