summaryrefslogtreecommitdiff
path: root/scripts/package-build/strongswan/build-vici.sh
blob: 5ad0ee801896da283f9349b9dd563bf9738ffeff (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
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
#!/bin/sh
CWD=$(pwd)
set -e

SRC="strongswan/src/libcharon/plugins/vici/python"
if [ ! -d ${SRC} ]; then
    echo "Source directory does not exists, please 'git clone'"
    exit 1
fi

cd ${SRC}

mkdir -p debian

# Create control file
echo "I: create $SRC/debian/control"
cat <<EOF > debian/control
Source: strongswan
Section: python
Priority: optional
Maintainer: VyOS Package Maintainers <maintainers@vyos.net>
Build-Depends: debhelper (>= 9), python3, python3-setuptools
Standards-Version: 3.9.6

Package: python3-vici
Architecture: all
Depends: \${misc:Depends}, \${python3:Depends}
Description: Native Python interface for strongSwan's VICI protocol
EOF


# Create rules file
echo "I: create $SRC/rules"
cat <<EOF > debian/rules
#!/usr/bin/make -f

%:
	dh \$@ --with python3
EOF
# Make the rules file executable
chmod +x debian/rules

echo '10' > debian/compat

# Copy changelog
cp ../../../../../debian/changelog debian/


ls -la
pwd


echo "I: Build Debian Package"
dpkg-buildpackage -uc -us -tc -b -d

echo "I: copy packages"
cp ../*.deb  ../../../../../../