From a9c50631d8a212c4c4bb8fe313eaaf5c7875e1be Mon Sep 17 00:00:00 2001 From: Shimon Walner Date: Wed, 6 Nov 2019 15:36:49 -0800 Subject: [PATCH] Use package and version variables in packaging scripts --- packages/cifs-utils/packaging | 44 ++++++++++++++++++++--------------- packages/cni/packaging | 8 +++++-- packages/conntrack/packaging | 13 +++++++++-- packages/etcdctl/packaging | 5 ++-- packages/flanneld/packaging | 3 ++- packages/ipset/packaging | 8 ++++++- packages/jq/packaging | 9 ++++--- packages/kubernetes/packaging | 3 ++- packages/nfs/packaging | 17 +++++++++++++- packages/socat/packaging | 11 +++++---- 10 files changed, 85 insertions(+), 36 deletions(-) diff --git a/packages/cifs-utils/packaging b/packages/cifs-utils/packaging index c4c0271d6..5ceaa79c2 100644 --- a/packages/cifs-utils/packaging +++ b/packages/cifs-utils/packaging @@ -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 diff --git a/packages/cni/packaging b/packages/cni/packaging index 5e16ac118..9422550a5 100644 --- a/packages/cni/packaging +++ b/packages/cni/packaging @@ -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/* diff --git a/packages/conntrack/packaging b/packages/conntrack/packaging index bd0203079..a63f6caa3 100644 --- a/packages/conntrack/packaging +++ b/packages/conntrack/packaging @@ -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:?}/" diff --git a/packages/etcdctl/packaging b/packages/etcdctl/packaging index 90e303183..4e6e77f9c 100644 --- a/packages/etcdctl/packaging +++ b/packages/etcdctl/packaging @@ -1,5 +1,6 @@ set -e +ETCDCTL_PACKAGE=etcdctl ETCDCTL_VERSION="3.0.7" main() { @@ -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 \ No newline at end of file +main diff --git a/packages/flanneld/packaging b/packages/flanneld/packaging index 81da04eca..010c8d028 100644 --- a/packages/flanneld/packaging +++ b/packages/flanneld/packaging @@ -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" diff --git a/packages/ipset/packaging b/packages/ipset/packaging index 1fc53fb18..6a83ddca2 100644 --- a/packages/ipset/packaging +++ b/packages/ipset/packaging @@ -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:?}/" diff --git a/packages/jq/packaging b/packages/jq/packaging index 4c34f89a8..2a07e7411 100644 --- a/packages/jq/packaging +++ b/packages/jq/packaging @@ -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 diff --git a/packages/kubernetes/packaging b/packages/kubernetes/packaging index 1e68123f7..eb7fb139c 100644 --- a/packages/kubernetes/packaging +++ b/packages/kubernetes/packaging @@ -1,5 +1,6 @@ set -e +KUBERNETES_PACKAGE=kubernetes KUBERNETES_VERSION="1.15.5" main() { @@ -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() { diff --git a/packages/nfs/packaging b/packages/nfs/packaging index 751fc24fb..4c31db029 100644 --- a/packages/nfs/packaging +++ b/packages/nfs/packaging @@ -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:?}/" diff --git a/packages/socat/packaging b/packages/socat/packaging index 6a7df7fb9..4cbd88976 100644 --- a/packages/socat/packaging +++ b/packages/socat/packaging @@ -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