File: ubuntu-ppa

package info (click to toggle)
apptainer 1.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,748 kB
  • sloc: sh: 3,321; ansic: 1,706; awk: 414; python: 103; makefile: 54
file content (70 lines) | stat: -rwxr-xr-x 2,038 bytes parent folder | download
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash

set -e

if [ $# -ne 2 ];then
   echo "Should be exactly two args passed"
   exit 1
fi

if [ -z $1 ]; then
   echo "Apptainer version is empty"
   exit 1
fi

APPTAINER_VERSION=$1
APPTAINER_REVISION=$2

if [ -z "${OS_TYPE}" ]; then
   echo "OS_TYPE is unset"
   exit 1
fi

if [ -z "${OS_VERSION}" ]; then
   echo "OS_VERSION is unset"
   exit 1
fi

if [ -z "${OS_NAME}" ]; then
   echo "OS_NAME is unset"
   exit 1
fi

if [ -z "${TARGET_PPA}" ]; then
   echo "TARGET_PPA is unset"
   exit 1
fi

if [ -z "${PPA_SIGN_KEY}" ]; then
   echo "PPA_SIGN_KEY is unset"
   exit 1
fi

if [ -z "${GO_ARCH}" ]; then
   GO_ARCH="linux-amd64"
fi

BUILD_VERSION="$APPTAINER_VERSION-$APPTAINER_REVISION~$OS_NAME"

# replace debian related stuffs for debuild
sed -i "s/0.1.0-1/$BUILD_VERSION/g" dist/debian/changelog
sed -i "s/unstable/$OS_NAME/g" dist/debian/changelog
sed -i "s/Placeholder/rebuild for $OS_NAME/g" dist/debian/changelog

sed -i '82,83d' dist/debian/rules
sed -i "81c \ \ \ \ \ \ \ \ \ \ \ \ tar -xf \$\$HERE/debian/go\$(MINGO_VERSION).\$(GO_ARCH).tar.gz; \\\\" dist/debian/rules
# sed -i '81c \    \    \    tar -xf $$HERE/debian/go$(MINGO_VERSION).$(GO_ARCH).tar.gz; \\' dist/debian/rules
sed -i '31i GOMODCACHE = $${TMPDIR:-/tmp}/appdebgo/modcache' dist/debian/rules
sed -i '9i GO_ARCH := linux-$(shell dpkg --print-architecture)' dist/debian/rules
sed -i 's/GOCACHE=\$(GOCACHE)/GOCACHE=\$(GOCACHE) GOMODCACHE=\$(GOMODCACHE)/g' dist/debian/rules

# real build
./scripts/ci-docker-run

# change permission, sign the changes and upload via dput
sudo chown "$USER:$USER" .
sudo chown "$USER:$USER" ..
find . -maxdepth 1 -type f -exec sudo chown -R "$USER:$USER" {} \;
sed -i "s/Changed-By: Gregory M\. Kurtzer <gmkurtzer@gmail\.com>/Changed-By: TSC <tsc@apptainer\.org>/" "apptainer_${BUILD_VERSION}_source.changes"
debsign -p "gpg --pinentry-mode loopback --passphrase $GPG_PASSPHRASE" -S -k "${PPA_SIGN_KEY}" "apptainer_${BUILD_VERSION}_source.changes"
dput -f -U "${TARGET_PPA}" "apptainer_${BUILD_VERSION}_source.changes"