Skip to content
Snippets Groups Projects
Commit b80d1214 authored by Georges Racinet's avatar Georges Racinet
Browse files

RHGitaly: src-tarball make target

parent 0a957277
No related branches found
No related tags found
2 merge requests!151heptapod#743: making 0.36 the new stable,!146RHGitaly source packaging and new pipeline rules
all: help
HGITALY_VERSION := $(shell cat ../hgitaly/VERSION)
MERCURIAL_SOURCE_REPO = dependencies/mercurial
MERCURIAL_SOURCE_REV := $(shell cat mercurial.rev)
MERCURIAL_SOURCE_REMOTE ?= https://foss.heptapod.net/mercurial/mercurial-devel
......@@ -11,6 +12,9 @@
@echo "Available commands: "
@echo " make dev-dependencies: prepare development dependencies"
@echo " (hg-core, various resources)"
@echo " make src-tarball: package the workspace as a tarball,"
@echo " including all dependencies that "
@echo " cannot be obtained from crates.io"
@echo
@echo "Interesting variables: "
@echo " MERCURIAL_SHARE_FROM: if set, Mercurial sources repository"
......@@ -28,3 +32,7 @@
else
hg clone --noupdate $(MERCURIAL_SOURCE_REMOTE) $(MERCURIAL_SOURCE_REPO)
endif
.PHONY: src-tarball
src-tarball: dev-dependencies
./src-tarball.sh ${HGITALY_VERSION}
#!/bin/sh
set -e
if [ -z "$1" ]; then
echo "usage: $0 HGITALY_VERSION";
exit 1
fi
HGITALY_VERSION=$1
set -u
DIST_HGITALY=hgitaly-${HGITALY_VERSION}
DIST_RHGITALY=rhgitaly-${HGITALY_VERSION}
TARBALL=${DIST_RHGITALY}.tgz
cd `dirname $0`
mkdir -p dist
cd dist
rm -rf ${DIST_HGITALY} ${DIST_RHGITALY}
echo "Performing extractions"
hg archive ${DIST_HGITALY}
rm -f ${DIST_HGITALY}/rust/dependencies/hg-core # cp -Lrf cannot do this
cp -Lr ../dependencies/hg-core ${DIST_HGITALY}/rust/dependencies
mkdir -p ${DIST_RHGITALY}/hgitaly
for path in hgitaly/VERSION protos rust; do
cp -r ${DIST_HGITALY}/${path} ${DIST_RHGITALY}/${path}
done
echo "Creating tarball"
tar czf ${TARBALL} ${DIST_RHGITALY}
echo "Removing temporary directories ${DIST_HGITALY} and ${DIST_RHGITALY}"
rm -rf ${DIST_HGITALY} ${DIST_RHGITALY}
echo "tarball available in `realpath ${TARBALL}`"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment