blob: 39a082308fd3180ba3cb6034c1de0dc07f5c6aac (
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
58
59
60
61
62
63
64
65
66
|
#!/bin/sh
CWD=$(pwd)
set -e
BUILD_ARCH=$(dpkg-architecture -qDEB_TARGET_ARCH)
SRC="blackbox_exporter"
if [ ! -d ${SRC} ]; then
echo "Source directory does not exist, please 'git clone'"
exit 1
fi
cd $SRC
mkdir -p debian
echo "I: Create $SRC/debian/control"
cat <<EOF > debian/control
Source: blackbox-exporter
Section: net
Priority: optional
Maintainer: VyOS Package Maintainers <maintainers@vyos.net>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.5.1
Homepage: https://github.com/prometheus/blackbox_exporter
Package: blackbox-exporter
Architecture: ${BUILD_ARCH}
Depends: \${shlibs:Depends}, \${misc:Depends}
Description: The blackbox exporter allows blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP, ICMP and gRPC.
EOF
echo "I: Create $SRC/debian/changelog"
cat <<EOF > debian/changelog
blackbox-exporter (0.25.0) UNRELEASED; urgency=medium
* Upstream package
-- VyOS Maintainers <maintainers@vyos.io> Thu, 26 Sep 2024 12:35:47 +0000
EOF
echo "I: Create $SRC/debian/rules"
cat <<EOF > debian/rules
#!/usr/bin/make -f
clean:
@# Do nothing
build:
@# Do nothing
binary:
mkdir -p debian/blackbox-exporter
mkdir -p debian/blackbox-exporter/usr/sbin
mkdir -p debian/blackbox-exporter/run/blackbox_exporter
cp blackbox_exporter debian/blackbox-exporter/usr/sbin/blackbox_exporter
dh_gencontrol
dh_builddeb
EOF
chmod +x debian/rules
echo "I: Build blackbox_exporter"
go build
echo "I: Build Debian Package"
dpkg-buildpackage -uc -us -tc -b -d
|