Mail archive
alpine-aports

[alpine-aports] [PATCH] main/chrony: don't run chronyd as root

From: Sören Tempel <soeren+git_at_soeren-tempel.net>
Date: Fri, 7 Aug 2015 20:02:00 +0200

fixes #4462
---
 main/chrony/APKBUILD | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/main/chrony/APKBUILD b/main/chrony/APKBUILD
index 558a8a8..1b555d2 100644
--- a/main/chrony/APKBUILD
+++ b/main/chrony/APKBUILD
_at_@ -1,14 +1,16 @@
 # Maintainer: Natanael Copa <ncopa_at_alpinelinux.org>
 pkgname=chrony
 pkgver=2.1.1
-pkgrel=1
+pkgrel=2
 _ver=${pkgver/_/-}
 pkgdesc="NTP client and server programs"
 url="http://chrony.tuxfamily.org/"
+pkgusers="$pkgname"
+pkggroups="$pkgname"
 arch="all"
 license="GPL2"
 depends=""
-makedepends="texinfo"
+makedepends="libcap-dev texinfo"
 subpackages="$pkgname-doc"
 source="http://download.tuxfamily.org/chrony/$pkgname-$_ver.tar.gz
 	0001-uclibc-res-do-not-call-res_init.patch
_at_@ -22,15 +24,14 @@ source="http://download.tuxfamily.org/chrony/$pkgname-$_ver.tar.gz
 
 _builddir="$srcdir"/$pkgname-$_ver
 prepare() {
-	local i
+	cd "$_builddir"
 	# We copy timepps.h to the local build directory instead of
 	# creating a pps-tools-dev package for ppstime.h
 	# (See https://github.com/ago/pps-tools)
-	mkdir -p "$_builddir"/pps-tools/sys
-	cp timepps.h "$_builddir"/pps-tools/sys/
-
-	cd "$_builddir"
+	mkdir -p pps-tools/sys
+	cp "$srcdir"/timepps.h "$_builddir"/pps-tools/sys/
 
+	local i=
 	for i in $source; do
 		case $i in
 		*.diff|*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1
_at_@ -40,7 +41,6 @@ prepare() {
 
 
 build() {
-
         cd "$_builddir"
         CPPFLAGS="$CPPFLAGS -I./pps-tools/" \
 	./configure \
_at_@ -49,6 +49,7 @@ build() {
 		--mandir=/usr/share/man \
 		--sysconfdir=/etc/$pkgname \
 		--disable-readline \
+		--with-user=$pkgname \
 		|| return 1
 
 	make all docs || return 1
_at_@ -72,6 +73,7 @@ package() {
 
 	install -m644 "$srcdir"/chrony.conf "$pkgdir"/etc/chrony/chrony.conf
 }
+
 md5sums="15e470a51ab6e09e65bc0a2fbc5299af  chrony-2.1.1.tar.gz
 c479553205e2dfe1409c7924b0d0f81b  0001-uclibc-res-do-not-call-res_init.patch
 a756428186bb27884d157a9f2c9732c6  max_resolve_interval.patch
-- 
2.5.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Fri Aug 07 2015 - 20:02:00 GMT