aboutsummaryrefslogtreecommitdiffhomepage
path: root/debian/tests/smoke-rpm
blob: b7694d1e13fa9e5ce04413460008b52342f8d991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

set -e
set -x

cleanup()
{
  [ -z "${GBP_TEMPDIR}" ] || rm -rf "${GBP_TEMPDIR}"
}

trap cleanup EXIT

git init .
git config user.email "you@example.com"
git config user.name "Doesnot Matter"
git add .
git commit -m"Smoketest" -a

gbp buildpackage-rpm --help

# Build an RPM of ourselfes if build-deps are available
if python3 -c "import setuptools"; then
  GBP_TEMPDIR=$(mktemp -d)
  gbp buildpackage-rpm --git-packaging-dir=packaging/ \
                       --git-export-dir="$GBP_TEMPDIR" \
                       -D'%__python3 /usr/bin/python3' \
                       -D'%__python /usr/bin/python3' \
                       -D'%python_sitelib %(%{__python3} -Ic "from sysconfig import get_path; print(get_path('"'platlib'"', '"'posix_prefix'"'))")' \
                       -D'%_arch noarch' \
                       -bb --nodeps
fi