forked from hyperledger/indy-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-indy_node.sh
executable file
·52 lines (44 loc) · 1.69 KB
/
build-indy_node.sh
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
#!/bin/bash -xe
INPUT_PATH="$1"
VERSION="$2"
OUTPUT_PATH="${3:-.}"
PACKAGE_VERSION=${4:-$VERSION}
PACKAGE_NAME=indy-node
# copy the sources to a temporary folder
TMP_DIR="$(mktemp -d)"
cp -r "${INPUT_PATH}/." "${TMP_DIR}"
# prepare the sources
cd "${TMP_DIR}/build-scripts/ubuntu-2204"
./prepare-package.sh "${TMP_DIR}" indy_node "${VERSION}" debian-packages
echo "Fetching the indy-plenum version from setup.py and converting it to deb format ..."
# Converts Versions defined in the following forms to their equivalent dep version format:
# 1.14.0.rc0 ==> 1.14.0~rc0
# 1.14.0-rc0 ==> 1.14.0~rc0
# 1.14.0.dev0654678970 ==> 1.14.0~dev0654678970
# 1.14.0-dev0654678970 ==> 1.14.0~dev0654678970
plenumDebVersion=$(grep -oP "indy-plenum==\d+.\d+.\d+((-|.)?(rc|dev)\d+)?" ${TMP_DIR}/setup.py | grep -oP "\d+.\d+.\d+((-|.)?(rc|dev)\d+)?" | sed 's/\./\~/3' | sed 's/\-/\~/1')
echo "plenumDebVersion: ${plenumDebVersion}"
sed -i "s/{package_name}/${PACKAGE_NAME}/" "prerm"
fpm --input-type "python" \
--output-type "deb" \
--architecture "amd64" \
--verbose \
--python-package-name-prefix "python3" \
--python-bin "/usr/bin/python3" \
--exclude "*.pyc" \
--exclude "*.pyo" \
--depends at \
--depends iptables \
--depends libsodium23 \
--depends "indy-plenum(=${plenumDebVersion})" \
--python-disable-dependency "indy-plenum" \
--no-python-fix-dependencies \
--maintainer "Hyperledger <[email protected]>" \
--before-install "preinst_node" \
--after-install "postinst_node" \
--before-remove "prerm" \
--name "${PACKAGE_NAME}" \
--version ${PACKAGE_VERSION} \
--package "${OUTPUT_PATH}" \
"${TMP_DIR}"
rm -rf "${TMP_DIR}"