forked from siderolabs/extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg.yaml
92 lines (85 loc) · 3.23 KB
/
pkg.yaml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: nut-client
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: base
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/openssl:{{ .BUILD_ARG_PKGS }}"
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/util-linux:{{ .BUILD_ARG_PKGS }}"
steps:
- sources:
- url: https://github.com/networkupstools/nut/releases/download/v{{ .NUT_VERSION }}/nut-{{ .NUT_VERSION }}.tar.gz
destination: nut.tar.gz
sha256: 7da48ee23b1f0d8d72560bb0af84f5c5ae4dbe35452b84cb49840132e47f099c
sha512: 32bff67749ef28cf57860bb5859d06b0a76daeada7f22eba59962f1695edb1f0f444d912fc4ae8c14ac3af5ab08b9cdb64d0ed65884fd38adc4bc8e470ce2a4c
prepare:
- |
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml
- |
tar -xf nut.tar.gz --strip-components=1
- |
# no shell for you
patch -p1 < /pkg/patches/replace_system.patch
- |
mkdir -p /usr/bin
ln -sf /toolchain/bin/env /usr/bin/env
# Create symlinks for files used when building.
ln -s /toolchain/bin/pkg-config /usr/bin/pkg-config
ln -s /toolchain/bin/file /usr/bin/file
cp /toolchain/share/automake-1.16/config.guess config.guess
cp /toolchain/lib/libstdc++* /lib
autoreconf -if
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
./configure \
--prefix=/usr/local \
--libexecdir=/usr/local/lib/nut \
--datadir=/usr/local/share/nut \
--sysconfdir=/usr/local/etc/nut \
--with-drvpath=/usr/local/lib/nut \
--with-statepath=/var/run/nut \
--with-altpidpath=/var/run/nut \
--with-udev-dir=/usr/local/etc/udev \
--with-systemdsystemunitdir=no \
--with-systemdshutdowndir=no \
--with-systemdtmpfilesdir=no \
--with-user=nut \
--with-group=nut \
--with-openssl \
--disable-static \
--without-avahi \
--without-cgi \
--without-freeipmi \
--without-ipmi \
--without-libltdl \
--without-modbus \
--without-neon \
--without-nss \
--without-powerman \
--without-serial \
--without-snmp \
--without-wrap \
--without-usb
build:
- |
make -j $(nproc) all
install:
- |
make DESTDIR=/rootfs install-exec
containerRoot=/rootfs/usr/local/lib/containers/nut-client
mkdir -p "$containerRoot"/{etc,sbin,usr/local/lib}
cp /rootfs/usr/local/sbin/upsmon "$containerRoot/upsmon"
mv /rootfs/usr/local/lib/lib* "$containerRoot/usr/local/lib/"
cp /pkg/files/* "$containerRoot/etc/"
# TODO replace /usr/bin/wall with either a wrapper for printk or a
# Go cmd to log to Talos Events
# cleanup
rm -rf /rootfs/usr/local/bin
rm -rf /rootfs/usr/local/etc
rm -rf /rootfs/usr/local/lib/nut
rm -rf /rootfs/usr/local/sbin
finalize:
- from: /rootfs
to: /rootfs
- from: /pkg/manifest.yaml
to: /
- from: /pkg/nut-client.yaml
to: /rootfs/usr/local/etc/containers/