summaryrefslogtreecommitdiff
path: root/.copr/prepare.sh
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-02-28 13:07:58 -0600
committerbaude <bbaude@redhat.com>2018-02-28 13:08:35 -0600
commit45478b78434224f7686172959ce3d82858746758 (patch)
treec3a1aeb19f527aebdc67a4460bdaf2a10fdd191f /.copr/prepare.sh
parent2a59653bf3d5230a8be1a20ed9fcf53a185afba3 (diff)
downloadpodman-45478b78434224f7686172959ce3d82858746758.tar.gz
podman-45478b78434224f7686172959ce3d82858746758.tar.bz2
podman-45478b78434224f7686172959ce3d82858746758.zip
Re-enable copr builds
New structure for copr builds which hopefully is more stable Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to '.copr/prepare.sh')
-rw-r--r--.copr/prepare.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/.copr/prepare.sh b/.copr/prepare.sh
new file mode 100644
index 000000000..d33d55dc7
--- /dev/null
+++ b/.copr/prepare.sh
@@ -0,0 +1,22 @@
+#!/bin/sh -euf
+set -x
+
+if [ ! -e /usr/bin/git ]; then
+ dnf -y install git-core
+fi
+
+git fetch --unshallow || :
+
+COMMIT=$(git rev-parse HEAD)
+COMMIT_SHORT=$(git rev-parse --short HEAD)
+COMMIT_NUM=$(git rev-list HEAD --count)
+COMMIT_DATE=$(date --date="@$(git show -s --format=%ct HEAD)" +%Y%m%d)
+
+sed "s,#COMMIT#,${COMMIT},;
+ s,#SHORTCOMMIT#,${COMMIT_SHORT},;
+ s,#COMMITNUM#,${COMMIT_NUM},;
+ s,#COMMITDATE#,${COMMIT_DATE}," \
+ contrib/spec/podman.spec.in > contrib/spec/podman.spec
+
+mkdir build/
+git archive --prefix "podman-${COMMIT_SHORT}/" --format "tar.gz" HEAD -o "build/podman-${COMMIT_SHORT}.tar.gz"