#!/bin/sh # SPDX-License-Identifier: 0BSD set -eu test $# = 2 || { cat >&2 <<-EOF usage: $0 Create 'builds/git-annex--linux-amd64.tar.gz' from files under ./git-annex/, most importantly the git-annex binary under cabal's build directory for and . EOF exit 2 } version_ghc=$1 version_annex=$2 cabal_root=git-annex/dist-newstyle/build/x86_64-linux binary=$cabal_root/ghc-$version_ghc/git-annex-$version_annex/build/git-annex/git-annex pkg_root=builds/git-annex-$version_annex mkdir -p "$pkg_root" pkg_bin=$pkg_root/bin mkdir "$pkg_bin" cp "$binary" "$pkg_bin"/ ln -s git-annex "$pkg_bin"/git-annex-shell ln -s git-annex "$pkg_bin"/git-remote-annex ln -s git-annex "$pkg_bin"/git-remote-tor-annex cp git-annex/COPYRIGHT "$pkg_root"/ pkg_man=$pkg_root/share/man/man1 mkdir -p "$pkg_man" cp git-annex/man/*.1 "$pkg_man"/ gzip -9 "$pkg_man"/*.1 tar czf "$pkg_root"-linux-amd64.tar.gz -C builds git-annex-"$version_annex" rm -r "$pkg_root"