summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2017-04-13 11:38:35 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2017-06-03 12:26:17 +0100
commite942fd476b69f15d53a04c2c292c5e80fa444ff9 (patch)
treebe6e3914df76e1c1f0b3eb9c542525005409161f /build-aux
parent5c631b7c435066f13684a8a28faf7c3609a2d020 (diff)
downloadjson-glib-e942fd476b69f15d53a04c2c292c5e80fa444ff9.tar.gz
build: Move ancillary build scripts to a separate directory
Avoid cluttering the source directories, and makes finding things easier.
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/gen-installed-test.py19
-rwxr-xr-xbuild-aux/make_release.sh19
2 files changed, 38 insertions, 0 deletions
diff --git a/build-aux/gen-installed-test.py b/build-aux/gen-installed-test.py
new file mode 100644
index 0000000..8fe4265
--- /dev/null
+++ b/build-aux/gen-installed-test.py
@@ -0,0 +1,19 @@
+import sys
+import os
+import argparse
+
+def write_template(filename, data):
+ with open(filename, 'w') as f:
+ f.write(data)
+
+def build_template(testdir, testname):
+ return "[Test]\nType=session\nExec={}\n".format(os.path.join(testdir, testname))
+
+argparser = argparse.ArgumentParser(description='Generate installed-test data.')
+argparser.add_argument('--testdir', metavar='dir', required=True, help='Installed test directory')
+argparser.add_argument('--testname', metavar='name', required=True, help='Installed test name')
+argparser.add_argument('--outfile', metavar='file', required=True, help='Output file')
+argparser.add_argument('--outdir', metavar='dir', required=True, help='Output directory')
+args = argparser.parse_args()
+
+write_template(os.path.join(args.outdir, args.outfile), build_template(args.testdir, args.testname))
diff --git a/build-aux/make_release.sh b/build-aux/make_release.sh
new file mode 100755
index 0000000..8c69990
--- /dev/null
+++ b/build-aux/make_release.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+test -n "$srcdir" || srcdir=$(dirname "$0")
+test -n "$srcdir" || srcdir=.
+
+cd $srcdir
+
+PROJECT=json-glib
+VERSION=$(git describe --abbrev=0)
+
+NAME="${PROJECT}-${VERSION}"
+
+rm -f "${NAME}.tar"
+rm -f "${NAME}.tar.xz"
+
+echo "Creating git tree archiveā€¦"
+git archive --prefix="${NAME}/" --format=tar HEAD > ${NAME}.tar
+
+echo "Compressing archiveā€¦"
+xz -f "${NAME}.tar"