alpine-overlay/kubezero/zdt-base/APKBUILD

142 lines
7.3 KiB
Plaintext

# Contributor: Stefan Reimer <stefan@zero-downtime.net>
# Maintainer: Stefan Reimer <stefan@zero-downtime.net>
pkgname=zdt-base
pkgver=0.3.21
pkgrel=0
pkgdesc="ZeroDownTime Alpine additions and customizations"
url="https://git.zero-downtime.net/ZeroDownTime/alpine-overlay/src/branch/master/kubezero/zdt-base"
arch="noarch"
license="AGPL-3.0"
depends="logrotate syslog-ng fastfetch monit file tiny-cloud dhcpcd starship"
options="!check"
subpackages="$pkgname-openrc $pkgname-aws $pkgname-nocloud"
install="$pkgname.post-install"
source="
common.sh
boot.sh
cloudbender-early.init
cloudbender.init
cloud-aws.sh
cloud-nocloud.sh
zdt-sysctl.conf
https://raw.githubusercontent.com/pixelb/ps_mem/v3.14/ps_mem.py
syslog-ng.conf
syslog-ng.logrotate.conf
syslog-ng.apparmor
cloudbender.stop
cloudbender.start
dhcpcd-mtu.hook
monitd.conf
monit_alert.sh.aws
fastfetch.jsonc
zdt-ascii.txt
route53.py
get_iam_sshkeys.py
uniq_hostname.py
write_parameters.py
zdt-profile.sh
starship.toml
aws-certbot.sh
"
build() {
sed -i -e 's,#!/usr/bin/env python,#!/usr/bin/env python3,' ps_mem.py
}
package() {
# core libraries
install -Dm755 "$srcdir/boot.sh" "$pkgdir/usr/lib/cloudbender/boot.sh"
install -Dm755 "$srcdir/common.sh" "$pkgdir/usr/lib/cloudbender/common.sh"
# set mtu on interface via dhcpcd
install -Dm644 "$srcdir/dhcpcd-mtu.hook" "$pkgdir/usr/lib/dhcpcd/dhcpcd-hooks/10-mtu"
# various sysctl tunings
install -Dm644 "$srcdir"/zdt-sysctl.conf "$pkgdir"/etc/sysctl.d/60-zdt.conf
# early init script to eg. mount var, cannot use any network !
install -Dm755 "$srcdir/cloudbender-early.init" "$pkgdir/etc/init.d/cloudbender-early"
# various tasks during first boot
install -Dm755 "$srcdir/cloudbender.init" "$pkgdir/etc/init.d/cloudbender"
# local boot & shutdown
install -Dm755 "$srcdir/cloudbender.start" "$pkgdir/etc/local.d/cloudbender.start"
install -Dm755 "$srcdir/cloudbender.stop" "$pkgdir/etc/local.d/cloudbender.stop"
# syslog-ng configs, json all into messages - installed via postinstall
install -Dm644 "$srcdir"/syslog-ng.conf "$pkgdir"/usr/lib/zdt/syslog-ng.conf
install -Dm644 "$srcdir"/syslog-ng.logrotate.conf "$pkgdir"/usr/lib/zdt/syslog-ng.logrotate.conf
install -Dm644 "$srcdir"/syslog-ng.apparmor "$pkgdir"/usr/lib/zdt/syslog-ng.apparmor
# monit
mkdir -p "$pkgdir"/etc/monit.d
install -Dm644 "$srcdir"/monitd.conf "$pkgdir"/etc/monit.d/zdt-base.conf
# ps_mem
install -Dm755 "$srcdir"/ps_mem.py "$pkgdir"/usr/sbin/ps_mem
# fastfetch
install -Dm644 "$srcdir"/fastfetch.jsonc "$pkgdir"/etc/fastfetch.jsonc
install -Dm644 "$srcdir"/zdt-ascii.txt "$pkgdir"/etc/zdt-ascii.txt
# starship
install -Dm644 "$srcdir"/starship.toml "$pkgdir"/etc/starship.toml
# zdt shell profile
install -Dm644 "$srcdir"/zdt-profile.sh "$pkgdir"/etc/profile.d/zdt-base.sh
}
aws() {
mkdir -p "$subpkgdir"
# aws libs
install -Dm755 "$srcdir/cloud-aws.sh" "$pkgdir/usr/lib/cloudbender/cloud/aws.sh"
# other tools
install -Dm755 "$srcdir"/route53.py "$subpkgdir"/usr/sbin/route53.py
install -Dm755 "$srcdir"/uniq_hostname.py "$subpkgdir"/usr/sbin/uniq_hostname.py
install -Dm755 "$srcdir"/get_iam_sshkeys.py "$subpkgdir"/usr/sbin/get_iam_sshkeys.py
install -Dm755 "$srcdir"/write_parameters.py "$subpkgdir"/usr/sbin/write_parameters.py
install -Dm755 "$srcdir"/aws-certbot.sh "$pkgdir"/usr/sbin/aws-certbot.sh
# Cloudbender SNS integration
install -Dm755 "$srcdir"/monit_alert.sh.aws "$pkgdir"/usr/bin/monit_alert.sh
}
nocloud() {
mkdir -p "$subpkgdir"
# nocloud libs
install -Dm755 "$srcdir/cloud-nocloud.sh" "$pkgdir/usr/lib/cloudbender/cloud/nocloud.sh"
}
sha512sums="
d1656d36d48b58102e3b1aee581801c8c94aa7a52a5a441bd44a59ed09e8c041eb8fa44b1fd5b6bde758c72826bbe563ecbfbac078a27840b88920c6eaf27fd7 common.sh
d494e3b65de86a49f84a6c5adf4a9425ab3f7dfa87719954f45e2e3883cf82a27e2c4a88038a69bbdf1568aa1b519f5bcdd5fdc7d5f783abe0883b0a301c7f81 boot.sh
eb7d5b6f92f500dbaba04a915cdd8d66e90456ca86bed86b3a9243f0c25577a9aa42c2ba28c3cad9dda6e6f2d14363411d78eff35656c7c60a6a8646f43dcba5 cloudbender-early.init
cac71c605324ad8e60b72f54b8c39ee0924205fcd1f072af9df92b0e8216bcde887ffec677eb2f0eacce3df430f31d5b5609e997d85f14389ee099fbde3c478f cloudbender.init
f4f1b1f67e6b368f61482f4dfcc48a32ccf75cf12349f82680b93f572534bef97ed1b4c0273e4e57fe89289f4383b15c2dafb39ae20416fc6dab96e92b8d678d cloud-aws.sh
3a84b728d4169b92356f1da52922c6110efd5bdc2df90b64abe59f89a5de57cc85a81936bdead0cae5071c1ba1735bda1bd866018b5c3f7fd4ef155d0606ac2d cloud-nocloud.sh
8e749ecc9bcb79094b9869682d998c48724b9bcd024f2dd0c75569387171092fcca569652bd43e12df79366b9942d2362c0c1f018f5f6e9e2b9f33e87df5d06d zdt-sysctl.conf
76e6a4f309f31bfa07de2d3b1faebe5670722752e18157b69d6e868cbe9e85eda393aed0728b0347a01a810eee442844c78259f86ff71e3136a013f4cbfaaea4 ps_mem.py
74727352a8ac334964c6cca9d52b3dfc8165d6f9c25e7dd589dda91dfe2d00c32ea0e9b4c37100525703c730a0d48eec3d244aa4626b6ad6b52d3707d776c52b syslog-ng.conf
484bdcf001b71ce5feed26935db437c613c059790b99f3f5a3e788b129f3e22ba096843585309993446a88c0ab5d60fd0fa530ef3cfb6de1fd34ffc828172329 syslog-ng.logrotate.conf
e86eed7dd2f4507b04050b869927b471e8de26bc7d97e7064850478323380a0580a92de302509901ea531d6e3fa79afcbf24997ef13cd0496bb3ee719ad674ee syslog-ng.apparmor
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e cloudbender.stop
f106f3e9befdeaad6beef4bada0c774eb7745568b8d29eb86970ac9ea73d1aaac080676d399a11d462973d10e1aef08125bf78d7a362db47a53a2ba06df7d9b4 cloudbender.start
f8c052c7ec12c71937c7b8bc05d8374c588f345e303b30eda9c8612dff8f8f34a87a433648a3e9b85b278196ece198533b29680a303ff6478171d43f8e095189 dhcpcd-mtu.hook
d3ebf236391bd7ae4f0a8674135e0f86e868d1c48161f5ca6485bf58eccb8132308123194691cb60e3b3987835a13295a9501c04d9052f10dca69459b67c289a monitd.conf
c955dabe692c0a4a2fa2b09ab9096f6b14e83064b34ae8d22697096daf6551f00b590d837787d66ea1d0030a7cc30bef583cc4c936c980465663e73aec5fa2dc monit_alert.sh.aws
30610b53264e31dd55394bbf581f32720b91c53d845315ac9d86efe14e320121c87cd8d2d40bd114372b0ae0e448dcd8f9b020cc51b675225076d4cde5563b06 fastfetch.jsonc
9e34401b682454821ec91d44c4b31a5c2fcb14140ca2ec52eed9bf85edbd3fef4915b2ac30f97a61133c12e2814cfc99d7f4125d6c0d256e6602d868549033b6 zdt-ascii.txt
816049360aa442f9e9aa4d6525795913cfe3dc7c6c14dc4ccad59c0880500f9d42f198edc442fe036bc84ba2690d9c5bc8ae622341d8276b3f14947db6b879b1 route53.py
7da28446762a36a6737c5b30becbce78775bd943b4d0c5ef938a50f49b4f51f66708434aa79004c19d16c56c83f54c8d6d68e1502ebc250c73f8aae12bed83c0 get_iam_sshkeys.py
ae1941fc45e61fa8d211f5ef7eff2dd01510a6d364c4302cab267812321a10e7434ecc8d8c9263d8671ce5604d04d6531601bf42886a55fb6aec7f321651e1dc uniq_hostname.py
ee4264337d86ad99ba6cf9ec3017986c804ac208c0beb5fc8651345bd277bb6de03e7c3a8c1b751767647be48f9d45ac47a7d14cf040d9c827780984394e826d write_parameters.py
72b7120a5b7e928b6c351fa6b9fb9bc1697a61922d080d58e1aa5c6f680c54ce55de8375a5992cf66921b3a7be741ebc09746fcf41ab7de8d36c48922315701e zdt-profile.sh
459f4957b10e6be8f9af04394f7bc1bd51364e629b687050607f7f4a8d60d92e90903ad7ef89ffed472f77506049ec7e163338a1b25ca6a65c6f1599cc13cfcf starship.toml
58d431dc4342997712fbf5c2092e51e9ef474372ca6a4dd1a4c53ce25333c4a406ef3549a120ef0c6ead1a5965574e8d2df7983621ebdbb4d8a3e2d3e8233738 aws-certbot.sh
"