Commit e2624064 authored by Lorenzo Setale's avatar Lorenzo Setale
Browse files

allows to build packages for multiple architectures

parent c96b0f48
GPG_KEY_ID := 41A6970FF48EB5DA9B81BB6C66EB83CBEBD4FBB3
CLOUDFLARE_FILES_JSON := $(shell find dist|sed 's;dist;https://get.siderus.io;'|jq -R '[.]'|jq -s -c 'add'|sed 's;.*;{"files":&};')
CLOUDFLARE_EMAIL := hello@siderus.io
CLOUDFLARE_ZONE := 348858e237b4b78e6f78d2712314dee7
......@@ -15,9 +13,10 @@ endif
-include makefiles/*.mk
clean:
rm -rf dist
rm -rf build
clean_%:
rm -rf $$(echo "$@" | sed "s/clean_//g")
clean: clean_build clean_dist
.PHONY: clean
prepare_dir: clean
......
GPG_KEY_ID := 41A6970FF48EB5DA9B81BB6C66EB83CBEBD4FBB3
collect_deb_packages:
mkdir -p dist/apt/
# This will move al the debian packages built/downloaded into the directory
# to be built together in a repository
cp build/*.deb dist/apt/
cp build/deb/*/*.deb dist/apt/
-cp build/*.deb dist/apt/
-cp build/deb/*/*.deb dist/apt/
.PHONY: collect_deb_packages
repository_apt:
......
......@@ -10,25 +10,25 @@ ifeq ($(ARCH),arm)
DEB_ARCH := armhf
endif
IPFS_VERSION:=$(shell curl https://dist.ipfs.io/go-ipfs/versions | tail -n 1)
IPFS_VERSION:=$(shell curl -s 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"
download_ipfs:
_download_ipfs:
mkdir -p build/orig/
curl -L --output build/orig/ipfs-${IPFS_VERSION}-${ARCH}.tar.gz \
https://dist.ipfs.io/go-ipfs/${IPFS_VERSION}/go-ipfs_${IPFS_VERSION}_${OS}-${ARCH}.tar.gz
.PHONY: download_ipfs
.PHONY: _download_ipfs
unpack_ipfs: download_ipfs
_unpack_ipfs: _download_ipfs
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
.PHONY: _unpack_ipfs
prepare_ipfs_deb: unpack_ipfs
_prepare_ipfs_deb: _unpack_ipfs
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
......@@ -58,9 +58,12 @@ prepare_ipfs_deb: unpack_ipfs
chmod +x build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/debian/rules
# Move the source here
cp -aR build/source/go-ipfs/${ARCH}/go-ipfs build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION}/
.PHONY: prepare_ipfs_deb
.PHONY: _prepare_ipfs_deb
build_ipfs_deb: prepare_ipfs_deb
_build_ipfs_deb_package: _prepare_ipfs_deb
cd build/deb/${DEB_ARCH}/ipfs-${NUMBER_IPFS_VERSION} ;\
dpkg-buildpackage -us -uc -d --host-arch ${DEB_ARCH}
.PHONY: build_ipfs_deb
.PHONY: ipfs_deb_package
deb_ipfs_%:
$(MAKE) clean_build _build_ipfs_deb_package collect_deb_packages -e ARCH=$$(echo "$@" | sed "s/deb_ipfs_//g")
ORION_VERSION := $(shell curl https://get.siderus.io/orion/latest-version)
ORION_REPO_TAG ?= $(shell curl ${_CURL_GITLAB_TOKEN_HEADER} https://gitlab.com/api/v4/projects/5931650/repository/tags | jq '.[] | .name' -r | sed 's/v//' | grep -v "latest" | head -n1)
ORION_VERSION := $(shell curl -s https://get.siderus.io/orion/latest-version)
ORION_REPO_TAG ?= $(shell curl -s ${_CURL_GITLAB_TOKEN_HEADER} https://gitlab.com/api/v4/projects/5931650/repository/tags | jq '.[] | .name' -r | sed 's/v//' | grep -v "latest" | head -n1)
ARCH ?= amd64
download_orion: prepare_dir
# Downloading Siderus Orion from GitHub
# The latest version
curl ${_CURL_GITLAB_TOKEN_HEADER} \
-L --output dist/apt/Siderus_Orion_${ORION_VERSION}_amd64.deb \
https://get.siderus.io/orion/Orion_${ORION_VERSION}_amd64.deb
-L --output dist/apt/Siderus_Orion_${ORION_VERSION}_${ARCH}.deb \
https://get.siderus.io/orion/Orion_${ORION_VERSION}_${ARCH}.deb
.PHONY: download_orion
# This check will ensure that latest version on get.siderus.io is not already
......
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