aboutsummaryrefslogblamecommitdiffstats
path: root/main/chrony/APKBUILD
blob: 8dec5648e9a189ebc31572d3436af22671349147 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                
                                                              

                                                   

          
                                        
                                  

                    
          
                      
                                                   
                                                                  
                   
                                          
                                                                   
                       
                                  
 

                     
                   
                 
         
 



                      
           

                       


                                                                   
                              
                                             
 
 
         
                                                         
                               
                                         
                                            
                                    
                                      
                                                    

                                  

 
         


                  
           

                                      
                                          
                                                                                 
 

                                                                        

                                                                           
 

                                                         
                                           
                                    
 

                                                       
                                                                            



                                                           
 
 

                                                                                                                                                   
                                                                                                                                                 
                                                                                                                                                            

                                                                                                                                               
                                                                                                                                             

                                                                                                                                           
# Contributor: Łukasz Jendrysik
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=chrony
pkgver=4.1
pkgrel=0
pkgdesc="NTP client and server programs"
url="https://chrony.tuxfamily.org"
pkgusers="$pkgname"
pkggroups="$pkgname"
arch="all"
license="GPL-2.0-only"
install="$pkgname.pre-install $pkgname.pre-upgrade"
makedepends="asciidoctor libcap-dev texinfo nettle-dev gnutls-dev"
checkdepends="bash"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://download.tuxfamily.org/chrony/chrony-$pkgver.tar.gz
	fix-tests.patch
	max_resolve_interval.patch

	chronyd.confd
	chronyd.initd
	chrony.conf
	timepps.h
	"

# secfixes:
#   3.5.1-r0:
#     - CVE-2020-14367

prepare() {
	default_prepare

	# 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 pps-tools/sys
	cp "$srcdir"/timepps.h pps-tools/sys/
}

build() {
	CPPFLAGS="$CPPFLAGS -I./pps-tools/" ./configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--sysconfdir=/etc/$pkgname \
		--disable-readline \
		--with-user=$pkgname \
		--with-sendmail=/usr/sbin/sendmail \
		--enable-ntp-signd
	make all docs
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/etc/logrotate.d
	install -Dm644 examples/chrony.logrotate "$pkgdir"/etc/logrotate.d/chrony

	mkdir -p "$pkgdir"/usr/share/doc/chrony
	install -m644 examples/*.example "$pkgdir"/usr/share/doc/chrony/
	install -Dm755 "$srcdir"/chronyd.initd "$pkgdir"/etc/init.d/chronyd
	install -Dm644 "$srcdir"/chronyd.confd "$pkgdir"/etc/conf.d/chronyd

	install -dm2750 -g wheel "$pkgdir"/var/log/chrony

	mkdir -p "$pkgdir"/var/lib/chrony \
		"$pkgdir"/etc/chrony

	# chrony.drift must be writable by chrony user
	chown $pkgusers:$pkggroups "$pkgdir"/etc/chrony
	install -m644 "$srcdir"/chrony.conf "$pkgdir"/etc/chrony/chrony.conf
	chown root:root "$pkgdir"/etc/chrony/*

	chown $pkgusers:$pkggroups "$pkgdir"/var/lib/chrony
	touch "$pkgdir"/var/lib/chrony/chrony.drift
}

sha512sums="
5e283d6a56e6852606c681a7c29c5786b102d584178cbd7033ebbc95a8e95533605631363b850a3087cca438a5878db7a317f120aab2fd856487d02fccfbcb1f  chrony-4.1.tar.gz
067d47224a8c075ec8f63ffc58e65b030fdf228a72c4f03d50a2f2c17414da65bb5d27c7c2e4ba99e909f452041db83eaebe3c9e34c0c8fce18e05ebb489735e  fix-tests.patch
b26581ed32680585edea5b8163a0062a87f648394c0f363c77a7d01a36608fcf4d005d9e6ab179ed2827b8a08f598f7bad4801bb5e135cad5107eb77fb19b247  max_resolve_interval.patch
c1ce577ed1af9f3d88a6a2880a4834ae0c6a7f45870d9396d2aacd7716eb8de346ce458e1a45fdd48b1e8b8f5cd3afcba9534ac47fedb517604c9d910a342fac  chronyd.confd
1501161812ad12679d47a1b671d2ddbe94ec5825d5e225729057abc3b8869cb813acd8bdd7adaba0cd786afdf04280228e327a3b83f89a11d06bf3cb826c5269  chronyd.initd
663c6316bcca762de119d88e4bb6536bfe0fea19939fe1b673900847619e7f1d6783b789b38ebba97b5dc3778dedf798bafd65f00f8bd7e312bfed7df0caaf71  chrony.conf
eb11fc19243d1789016d88eb7645bfe67c46304547781489bf36eb1dd4c252d523681ff835a6488fa0ef62b6b9e2f781c672279f4439f5d5640a3f214a113048  timepps.h
"