Use github tarballs

tar.xz is 800kB smaller than tar.gz, but not having to create the tarball
manually is much more convenient.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2015-07-09 13:41:11 -04:00
parent a5e55f9d9f
commit 3dfe820830
2 changed files with 2 additions and 29 deletions

View File

@ -1,26 +0,0 @@
#!/bin/bash
set -e
NAME=systemd
UPSTREAM=git@github.com:systemd/systemd.git
[ -n "$1" ] && HEAD="$1" || HEAD="HEAD"
WORKDIR="$(mktemp -d --tmpdir "$NAME.XXXXXXXXXX")"
trap 'rm -rf $WORKDIR' exit
git clone "$UPSTREAM" "$WORKDIR"
pushd "$WORKDIR" > /dev/null
git branch to-archive $HEAD
read COMMIT_SHORTID COMMIT_TITLE <<EOGIT
$(git log to-archive^..to-archive --pretty='format:%h %s')
EOGIT
popd > /dev/null
echo "Making git snapshot using commit: $COMMIT_SHORTID $COMMIT_TITLE"
DIRNAME="$NAME-git$COMMIT_SHORTID"
git archive --remote="$WORKDIR" --format=tar --prefix="$DIRNAME/" to-archive | xz -9 > "$DIRNAME.tar.xz"
echo "Written $DIRNAME.tar.xz"

View File

@ -22,10 +22,9 @@ License: LGPLv2+ and MIT and GPLv2+
Summary: A System and Service Manager
%if %{defined gitcommit}
# Snapshot tarball can be created using: ./make-git-shapshot.sh [gitcommit]
Source0: %{name}-git%{gitcommit}.tar.xz
Source0: https://github.com/systemd/systemd/archive/%{?gitcommit}.tar.gz#/%{name}-%{gitcommit}.tar.gz
%else
Source0: %{name}-%{version}.tar.xz
Source0: https://github.com/systemd/systemd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
%endif
# Prevent accidental removal of the systemd package