From 140d538ca1b0cd7e79af699f96cead7662577fc6 Mon Sep 17 00:00:00 2001 From: bill-auger Date: Mon, 13 Apr 2020 00:08:35 -0400 Subject: [beanstalkd]: add package --- pcr-testing/beanstalkd/PKGBUILD | 59 ++++++++++++++++++++++++++++++ pcr-testing/beanstalkd/beanstalkd.conf | 11 ++++++ pcr-testing/beanstalkd/beanstalkd.service | 13 +++++++ pcr-testing/beanstalkd/beanstalkd@.service | 13 +++++++ pcr-testing/beanstalkd/fix-warnings.patch | 51 ++++++++++++++++++++++++++ 5 files changed, 147 insertions(+) create mode 100644 pcr-testing/beanstalkd/PKGBUILD create mode 100644 pcr-testing/beanstalkd/beanstalkd.conf create mode 100644 pcr-testing/beanstalkd/beanstalkd.service create mode 100644 pcr-testing/beanstalkd/beanstalkd@.service create mode 100644 pcr-testing/beanstalkd/fix-warnings.patch (limited to 'pcr-testing') diff --git a/pcr-testing/beanstalkd/PKGBUILD b/pcr-testing/beanstalkd/PKGBUILD new file mode 100644 index 000000000..b6feff46a --- /dev/null +++ b/pcr-testing/beanstalkd/PKGBUILD @@ -0,0 +1,59 @@ +# Maintainer: bill-auger + + +pkgname=beanstalkd +pkgver=1.11 +pkgrel=1 +pkgdesc="simple, fast work-queue server" +arch=('armv7h' 'i686' 'x86_64') +url=https://beanstalkd.github.io/ +license=('MIT') + +backup=(etc/conf.d/beanstalkd) +source=($pkgname-$pkgver::https://github.com/beanstalkd/beanstalkd/archive/v${pkgver}.tar.gz + beanstalkd@.service + beanstalkd.service + beanstalkd.conf + fix-warnings.patch) +sha256sums=('5e3414e49d00e9ef9530897983e56bdba98da6f8f1f30f5fe7e6064b2f68c544' + '57004d06ed38973e4bba47c92d1461e77e58027818c1899352ace95fb400f937' + 'ef0393098d6df9afb21ef8d1bc331b3843fcecf6c56498136df1aa38e08f6fbf' + 'ae29f7566e0ac475051a29852e62dbb1ee2b59e2ab03f01676c5b5513ada0e3c' + 'fcb9eaba50bd2bc78e8be9fc05a99501fa38bbe35e7e4568cf8363afe0ee4ac4') + + +prepare() +{ + cd "$srcdir"/$pkgname-$pkgver + + # https://github.com/beanstalkd/beanstalkd/pull/575 + patch -p1 < "$srcdir"/fix-warnings.patch +} + +build() +{ + cd "$srcdir"/$pkgname-$pkgver + + make CFLAGS="${CFLAGS}" +} + +check() +{ + cd "$srcdir"/$pkgname-$pkgver + + # check requires network +# make check +} + +package() +{ + cd "$srcdir"/$pkgname-$pkgver + + make DESTDIR="$pkgdir"/ PREFIX=/usr install + + install -Dm644 "${srcdir}"/beanstalkd.conf "${pkgdir}"/etc/conf.d/beanstalkd + install -Dm644 "${srcdir}"/beanstalkd.service "${pkgdir}"/usr/lib/systemd/system/beanstalkd.service + install -Dm644 "${srcdir}"/beanstalkd@.service "${pkgdir}"/usr/lib/systemd/system/beanstalkd@.service + install -Dm644 adm/systemd/beanstalkd.socket "${pkgdir}"/usr/lib/systemd/system/beanstalkd.socket + install -Dm644 doc/beanstalkd.1 "${pkgdir}"/usr/share/man/man1/beanstalkd.1 +} diff --git a/pcr-testing/beanstalkd/beanstalkd.conf b/pcr-testing/beanstalkd/beanstalkd.conf new file mode 100644 index 000000000..d7a89d199 --- /dev/null +++ b/pcr-testing/beanstalkd/beanstalkd.conf @@ -0,0 +1,11 @@ +## Defaults for the beanstalkd init script +## e.g. /etc/init.d/beanstalkd +## /usr/lib/systemd/system/beanstalkd.service + +BEANSTALKD_LISTEN_ADDR=127.0.0.1 +BEANSTALKD_LISTEN_PORT=11300 + +# You can use BEANSTALKD_EXTRA to pass additional options. +# See beanstalkd(1) for a list of the available options. +# Uncomment the following line for persistent job storage. +#BEANSTALKD_EXTRA="-b /var/lib/beanstalkd" diff --git a/pcr-testing/beanstalkd/beanstalkd.service b/pcr-testing/beanstalkd/beanstalkd.service new file mode 100644 index 000000000..149033fad --- /dev/null +++ b/pcr-testing/beanstalkd/beanstalkd.service @@ -0,0 +1,13 @@ +[Unit] +Description=Simple, fast work queue +Documentation=man:beanstalkd(1) +After=network.target + +[Service] +User=nobody +Group=nobody +EnvironmentFile=/etc/conf.d/beanstalkd +ExecStart=/usr/bin/beanstalkd -l ${BEANSTALKD_LISTEN_ADDR} -p ${BEANSTALKD_LISTEN_PORT} ${BEANSTALKD_EXTRA} + +[Install] +WantedBy=multi-user.target diff --git a/pcr-testing/beanstalkd/beanstalkd@.service b/pcr-testing/beanstalkd/beanstalkd@.service new file mode 100644 index 000000000..a6695b034 --- /dev/null +++ b/pcr-testing/beanstalkd/beanstalkd@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Simple, fast work queue (%i) +Documentation=man:beanstalkd(1) +After=network.target + +[Service] +User=nobody +Group=nobody +EnvironmentFile=/etc/conf.d/beanstalkd-%i +ExecStart=/usr/bin/beanstalkd -l ${BEANSTALKD_LISTEN_ADDR} -p ${BEANSTALKD_LISTEN_PORT} ${BEANSTALKD_EXTRA} + +[Install] +WantedBy=multi-user.target diff --git a/pcr-testing/beanstalkd/fix-warnings.patch b/pcr-testing/beanstalkd/fix-warnings.patch new file mode 100644 index 000000000..865c3781f --- /dev/null +++ b/pcr-testing/beanstalkd/fix-warnings.patch @@ -0,0 +1,51 @@ +diff --git a/ct/ct.c b/ct/ct.c +index e7b4e15..b797057 100644 +--- a/ct/ct.c ++++ b/ct/ct.c +@@ -323,8 +323,8 @@ runbenchn(Benchmark *b, int n) + ctstarttimer(); + b->f(n); + ctstoptimer(); +- write(durfd, &bdur, sizeof bdur); +- write(durfd, &bbytes, sizeof bbytes); ++ if (write(durfd, &bdur, sizeof bdur)); ++ if (write(durfd, &bbytes, sizeof bbytes)); + exit(0); + } + setpgid(pid, pid); +@@ -540,7 +540,7 @@ writetokens(int n) + if (wjobfd >= 0) { + fcntl(wjobfd, F_SETFL, fcntl(wjobfd, F_GETFL)|O_NONBLOCK); + for (; n>1; n--) { +- write(wjobfd, &c, 1); /* ignore error; nothing we can do anyway */ ++ if (write(wjobfd, &c, 1)); /* ignore error; nothing we can do anyway */ + } + } + } +diff --git a/file.c b/file.c +index e55a9c0..4211ea1 100644 +--- a/file.c ++++ b/file.c +@@ -533,7 +533,7 @@ filewclose(File *f) + if (!f) return; + if (!f->iswopen) return; + if (f->free) { +- (void)ftruncate(f->fd, f->w->filesize - f->free); ++ if (ftruncate(f->fd, f->w->filesize - f->free)); + } + close(f->fd); + f->iswopen = 0; +diff --git a/sd-daemon.c b/sd-daemon.c +index 8596961..3b46942 100644 +--- a/sd-daemon.c ++++ b/sd-daemon.c +@@ -355,7 +355,8 @@ int sd_notify(int unset_environment, const char *state) { + + memset(&sockaddr, 0, sizeof(sockaddr)); + sockaddr.sa.sa_family = AF_UNIX; +- strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path)); ++ strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path) - 1); ++ sockaddr.un.sun_path[sizeof(sockaddr.un.sun_path) - 1] = '\0'; + + if (sockaddr.un.sun_path[0] == '@') + sockaddr.un.sun_path[0] = 0; -- cgit v1.2.2