Commit 019d9d9b authored by Lorenzo Setale's avatar Lorenzo Setale

enables multi-arch deployments

parent 8df9c843
......@@ -3,8 +3,15 @@
ARCH ?= amd64
OS ?= linux
IPFS_VERSION=$(shell curl https://dist.ipfs.io/go-ipfs/versions | tail -n 1)
NUMBER_IPFS_VERSION=$(shell echo ${IPFS_VERSION} | sed 's/v//')
ifeq ($(ARCH),amd64)
DEB_ARCH := amd64
endif
ifeq ($(ARCH),arm)
DEB_ARCH := armhf
endif
IPFS_VERSION:=$(shell curl https://dist.ipfs.io/go-ipfs/versions | tail -n 1)
NUMBER_IPFS_VERSION:=$(shell echo ${IPFS_VERSION} | sed 's/v//')
EMAIL ?= "hello@siderus.io"
DEBFULLNAME ?= "Siderus OU"
......@@ -16,45 +23,44 @@ download_ipfs:
.PHONY: download_ipfs
unpack_ipfs: download_ipfs
rm -rf build/source/
mkdir -p build/source/
tar -xvzf build/orig/ipfs-${IPFS_VERSION}-${ARCH}.tar.gz -C build/source/
rm -rf build/source/go-ipfs/${ARCH}
mkdir -p build/source/go-ipfs/${ARCH}
tar -xvzf build/orig/ipfs-${IPFS_VERSION}-${ARCH}.tar.gz -C build/source/go-ipfs/${ARCH}
.PHONY: unpack_ipfs
prepare_ipfs_deb: unpack_ipfs
mkdir -p build/ipfs-${NUMBER_IPFS_VERSION}
cp -aR source/ipfs.deb/* build/ipfs-${NUMBER_IPFS_VERSION}/
@echo "Source: ipfs" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Section: misc" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Priority: optional" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Maintainer: ${DEBFULLNAME} <${EMAIL}>" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Build-Depends: debhelper (>= 9)" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Standards-Version: ${NUMBER_IPFS_VERSION}" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Package: ipfs" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
# @echo "Depends: " >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Version: ${NUMBER_IPFS_VERSION}" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Maintainer: ${DEBFULLNAME} <${EMAIL}>" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Architecture: ${ARCH}" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Description: IPFS is a global, versioned, peer-to-peer filesystem." >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " It combines good ideas from Git, BitTorrent, Kademlia," >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " SFS, and the Web. It is like a single bittorrent swarm," >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " exchanging git objects. IPFS provides an interface as" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " simple as the HTTP web, but with permanence built in." >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " You can also mount the world at /ipfs." >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " This package is maintained and distributed by Siderus." >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/control
mkdir -p build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}
cp -aR source/ipfs.deb/* build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/
@echo "Source: ipfs" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Section: misc" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Priority: optional" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Maintainer: ${DEBFULLNAME} <${EMAIL}>" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Build-Depends: debhelper (>= 9)" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Standards-Version: ${NUMBER_IPFS_VERSION}" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Package: ipfs" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
# @echo "Depends: " >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Architecture: ${DEB_ARCH}" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo "Description: IPFS is a global, versioned, peer-to-peer filesystem." >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " It combines good ideas from Git, BitTorrent, Kademlia," >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " SFS, and the Web. It is like a single bittorrent swarm," >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " exchanging git objects. IPFS provides an interface as" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " simple as the HTTP web, but with permanence built in." >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " You can also mount the world at /ipfs." >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
@echo " This package is maintained and distributed by Siderus." >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/control
# Building the changelog
@echo "ipfs (${NUMBER_IPFS_VERSION}) internal; urgency=low" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo " " >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo " This package has been built by Siderus using an automation pipeline. Please" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo " refer to the official go-ipfs changelog for more information" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo " " >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo " -- ${DEBFULLNAME} <${EMAIL}> $(shell date -R)" >> build/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo "ipfs (${NUMBER_IPFS_VERSION}) internal; urgency=low" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo " " >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo " This package has been built by Siderus using an automation pipeline. Please" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo " refer to the official go-ipfs changelog for more information" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo " " >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
@echo " -- ${DEBFULLNAME} <${EMAIL}> $(shell date -R)" >> build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/changelog
chmod +x build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/rules
# Move the source here
cp -aR build/source/go-ipfs build/ipfs-${NUMBER_IPFS_VERSION}/
cp -aR build/source/go-ipfs/${ARCH}/go-ipfs build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/
.PHONY: prepare_ipfs_deb
build_ipfs_deb: prepare_ipfs_deb
cd build/ipfs-${NUMBER_IPFS_VERSION} ;\
dpkg-buildpackage -us -uc -d
cd build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION} ;\
dpkg-buildpackage -us -uc -d --host-arch ${DEB_ARCH}
.PHONY: build_ipfs_deb
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