aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Rader2023-09-13 11:48:17 -0400
committerDavid Rader2023-09-13 11:48:17 -0400
commitc21f5d08fcad8f96e0b8b31dee2c12bfc304c165 (patch)
treed719bfef1ef2ea3d83d610d2bc5f321a6cc2a90f
downloadaur-c21f5d08fcad8f96e0b8b31dee2c12bfc304c165.tar.gz
created
-rw-r--r--.gitignore2
-rw-r--r--PKGBUILD75
-rw-r--r--README.md23
-rw-r--r--keepalived.install22
4 files changed, 122 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..06dc27f086ea
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.gz
+*.zst
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..5a1dec7df095
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,75 @@
+# This is a PKGBUILD file that builds keepalived from source and deploys it as an
+# openrc service - nothing fancy, nothing special.
+
+# Maintainer: drad <sa@adercon.com>
+# Contributor: krad <krad@adercon.com>
+# Contributor: arad <arad@adercon.com>
+# Contributor: nrad <nrad@adercon.com>
+
+pkgname=keepalived
+pkgver="2.2.8"
+pkgrel="1"
+pkgdesc="keepalived bundled as an openrc based service"
+arch=("x86_64")
+#~ url='https://www.keepalived.org/software/keepalived-2.2.8.tar.gz'
+url='https://www.keepalived.org'
+license=('GPL3')
+#~ depends=()
+makedepends=('gcc' 'openssl' 'libnl' 'net-snmp')
+#~ optdepends=()
+#~ conflicts=()
+
+install=keepalived.install
+
+#changelog=CHANGELOG.md
+source=("$pkgname-$pkgver.tar.gz::$url/software/$pkgname-$pkgver.tar.gz")
+md5sums=('8c26f75a8767e5341d82696e1e717115')
+
+#~ prepare() {}
+
+build() {
+ cd "$pkgname-$pkgver"
+ ./configure --prefix=/usr/local/$pkgname-$pkgver
+ make
+}
+
+check() {
+ cd "$pkgname-$pkgver"
+ make -k check
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir/" install
+
+ sed -i -- 's|command="/sbin/$SVCNAME"|command="/usr/local/sbin/$SVCNAME"|g' "$pkgname/etc/openrc/$pkgname"
+ sed -i -- 's|command_args="$KEEPALIVED_OPTS"|command_args="-f /etc/keepalived/keepalived.conf"|g' "$pkgname/etc/openrc/$pkgname"
+
+ # remove the .service as its not needed on openrc systems
+ rm -rf "$pkgdir/no"
+
+ # the man pages
+ rm -rf "$pkgdir/usr/local/$pkgname-$pkgver/share/man/man1/"
+ mkdir -p "$pkgdir/usr/share/man/"
+ cp -R "$pkgdir/usr/local/$pkgname-$pkgver/share/man/" "$pkgdir/usr/share/"
+
+ # the sample config file
+ install -Dm644 "$pkgname/etc/$pkgname/keepalived.conf.sample" -t "$pkgdir/etc/$pkgname/"
+ rm -rf "$pkgdir/etc/$pkgname/samples"
+
+ # the daemon
+ install -Dm755 "$pkgdir/usr/local/$pkgname-$pkgver/sbin/$pkgname" -t "$pkgdir/usr/local/sbin/"
+
+ # the openrc script
+ install -Dm755 "$pkgname/etc/openrc/$pkgname" -t "$pkgdir/etc/init.d/"
+
+ # remove the extemporaneous stuff
+ rm -rf "$pkgdir/usr/local/$pkgname-$pkgver/"
+}
+
+#~ post_install() {
+ #~ # deploy the open-rc init script
+ #~ cp "$pkgdir/$pkgname-$pkgver/$pkgname/etc/openrc/$pkgname /etc/init.d/$pkgname"
+ #~ sed -i -- 's|command="/sbin/$SVCNAME"|command="/usr/local/sbin/$SVCNAME"|g' "/etc/init.d/$pkgname"
+ #~ sed -i -- 's|command_args="$KEEPALIVED_OPTS"|command_args="-f /etc/keepalived/keepalived.conf"|g' "/etc/init.d/$pkgname"
+#~ }
diff --git a/README.md b/README.md
new file mode 100644
index 000000000000..75c074e52f38
--- /dev/null
+++ b/README.md
@@ -0,0 +1,23 @@
+# README
+
+A build of keepalived for openrc deployment - nothing fancy, nothing special.
+
+### Get
+
+NOTE: we recommend cloning into the ~/.aur/ directory - its not necessary but documentation assumes this location.
+
+- get PKGBUILD: `cd ~/.aur && git clone git@gitlab.com:drad/keepalived.git`
+
+### Build
+
+Build with: `cd ~/.aur/keepalived && makepkg -src`
+
+
+### Install
+
+Install with: `cd ~/.aur/keepalived && sudo pacman -U keepalived{version}.pkg.tar.zst`
+
+### Remove
+
+Remove with: `sudo pacman -R keepalived`
+
diff --git a/keepalived.install b/keepalived.install
new file mode 100644
index 000000000000..372658e4f50f
--- /dev/null
+++ b/keepalived.install
@@ -0,0 +1,22 @@
+post_install() {
+ echo ">> "
+ echo ">> keepalived has been installed and an init.d script deployed as /etc/init.d/keepalived"
+ echo ">> "
+ echo ">> The init.d script has not been registered nor started."
+ echo ">> "
+ echo ">> To register the init.d script:"
+ echo ">> rc-update add keepalived default"
+ echo ">> To start the service:"
+ echo ">> rc-service keepalived start"
+ echo ">> To get keepalived status:"
+ echo ">> rc-service keepalived status"
+ echo ">> To stop keepalived:"
+ echo ">> rc-service keepalived stop"
+ echo ">> "
+ echo ">> NOTICE: No keepalive.conf (config file) has been deployed;"
+ echo ">> although, a sample config file has been provided and is available"
+ echo ">> at /etc/keepalived/keepalived.conf.sample. You will need to create"
+ echo ">> the /etc/keepalived/keepalived.conf file with your settings before"
+ echo ">> keepalive will run!"
+ echo ">> "
+}