aboutsummaryrefslogtreecommitdiff
path: root/bin/package
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2024-10-27 14:10:34 -0400
committerKyle Meyer <kyle@kyleam.com>2024-10-27 14:13:09 -0400
commit6ed25f26baf57115f8907966b0e170cef55f2a81 (patch)
tree83543667117851faddae91aaaea7e39c139f1479 /bin/package
downloadstatic-annex-6ed25f26baf57115f8907966b0e170cef55f2a81.tar.gz
Add initial setup
Diffstat (limited to 'bin/package')
-rwxr-xr-xbin/package41
1 files changed, 41 insertions, 0 deletions
diff --git a/bin/package b/bin/package
new file mode 100755
index 0000000..837dfbf
--- /dev/null
+++ b/bin/package
@@ -0,0 +1,41 @@
+#!/bin/sh
+# SPDX-License-Identifier: 0BSD
+
+set -eu
+
+test $# = 2 || {
+ cat >&2 <<-EOF
+usage: $0 <ghc version> <annex version>
+
+Create 'builds/git-annex-<annex version>-linux-amd64.tar.gz' from
+files under ./git-annex/, most importantly the git-annex binary under
+cabal's build directory for <ghc version> and <annex version>.
+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"