Debian Codegraph @

tools/make-rpms

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 #
3 # Copyright (C) 2015 Red Hat, Inc.
4 # SPDX-License-Identifier: LGPL-2.1-or-later
5
6
7 set -euf
8
9 base=$(cd "$(dirnamescip-shell system . . dirname. "$0")/../"; pwdscip-shell system . . pwd. -P)
10
11 usagescip-shell shell shell-project 0.0.0 usage().()
12 {
13 echoscip-shell system . . echo. "usage: make-rpms [--quick] [--verbose] [tarball]"
14 }
15
16 quiet="--quiet"
17 check=""
18
19 args=$(getoptscip-shell system . . getopt. -o "h,q,v" -l "help,quick,verbose" -- "$@")
20 eval set -- "$args"
21 while [scip-shell system . . `[`. $# -gt 0 ]; do
22 case $1 in
23 -v|--verbose)
24 quiet=""
25 ;;
26 -q|--quick)
27 check="--nocheck"
28 ;;
29 -h|--help)
30 usagescip-shell shell shell-project 0.0.0 usage().
31 exit 0
32 ;;
33 --)
34 shift
35 break
36 ;;
37 esac
38 shift
39 done
40
41 if [scip-shell system . . `[`. $# -gt 1 ]; then
42 usagescip-shell shell shell-project 0.0.0 usage().
43 exit 2
44 fi
45
46 if [scip-shell system . . `[`. -z "${1-}" ]; then
47 # we specify the main tarball that contains the spec file;
48 # the others (-node) have to be next to it in the same directory
49 source="$("$base/tools/make-dist" | headscip-shell system . . head. -n1)"
50 else
51 source="$1"
52 fi
53
54 tmpdir=$(mktempscip-shell system . . mktemp. -d "$PWD/rpm-build.XXXXXX")
55 rpmbuild $check $quiet \
56 --define "_topdir $tmpdir" \
57 --define "_rpmdir $tmpdir/output" \
58 -tb "$source"
59
60 findscip-shell system . . find. "$tmpdir/output" -name '*.rpm' -printf '%f\n' -exec mv {} . \;
61 rmscip-shell system . . rm. -r "$tmpdir"