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:
parent
a5e55f9d9f
commit
3dfe820830
@ -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"
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user