aboutsummaryrefslogtreecommitdiff
path: root/.copr/prepare.sh
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2018-02-28 13:18:09 -0600
committerGitHub <noreply@github.com>2018-02-28 13:18:09 -0600
commit3d5cb8e2231b9eb12c5f136989e336c2e4a199c3 (patch)
tree7f6bb696ab82031eb9200d90a20d074ad59b663d /.copr/prepare.sh
parent85ece8a01fbfcfb376c4f79926d205044532b738 (diff)
parent45478b78434224f7686172959ce3d82858746758 (diff)
downloadpodman-3d5cb8e2231b9eb12c5f136989e336c2e4a199c3.tar.gz
podman-3d5cb8e2231b9eb12c5f136989e336c2e4a199c3.tar.bz2
podman-3d5cb8e2231b9eb12c5f136989e336c2e4a199c3.zip
Merge pull request #419 from baude/coprgit
Re-enable copr builds
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"