aboutsummaryrefslogblamecommitdiffstats
path: root/community/keepalived/APKBUILD
blob: c884e114c01c6e7e3c30f165b4c148874ea4f721 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                  
                                               
                                                   
                  
             
        
                                                                      
                                 
          
                      
                                        
                                                                      
                                           
                               

                                                               
                                                                     
                                


                      
 





                      
           
                       



                                           
         
                           
                            
 
                      

              
 
          



                                 
                                   

                                         
                               
                               

                  

 




                                                 
           
                                      
 
                                                                             
                                                                           
                                                                       

            

                                                                               
 

                                                         

 




                                 
                                      








                                              
                                                                        

                                                 
                                                                     

 

                                                     
 



                                                                        
                                                                                                                                                                      
                                                                                                                                                          

                                                                                                                                                   
# Contributor: Pablo Castorino <pcastorino@mendoza-conicet.gob.ar>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=keepalived
pkgver=2.0.19
pkgrel=0
pkgdesc="Health Checking for Linux Virtual Server & High-Availability"
url="https://www.keepalived.org/"
arch="all"
license="GPL-2.0-only"
depends="$pkgname-common !$pkgname-snmp"
makedepends="openssl-dev popt-dev linux-headers net-snmp-dev libnl-dev
	libnfnetlink-dev automake autoconf"
install="$pkgname.post-upgrade"
subpackages="$pkgname-doc $pkgname-sample-config:samples:noarch
	$pkgname-common $pkgname-snmp"
source="https://www.keepalived.org/software/keepalived-$pkgver.tar.gz
	always-use-pid-dir.patch
	$pkgname.initd
	$pkgname.confd
	"

# secfixes:
#   2.0.11-r0:
#     - CVE-2018-19044
#     - CVE-2018-19045
#     - CVE-2018-19046

prepare() {
	default_prepare

	cp -ar "$builddir" "$builddir-snmp"
}

build() {
	cd "$builddir-snmp"
	_build --enable-snmp

	cd "$builddir"
	_build
}

_build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-vrrp \
		--enable-sha1 \
		$@
	make
}

check() {
	"$builddir"/bin/keepalived --version
	"$builddir-snmp"/bin/keepalived --version
}

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

	local f; for f in AUTHOR CONTRIBUTORS ChangeLog README INSTALL TODO \
			genhash/README genhash/AUTHOR genhash/ChangeLog; do
		install -m644 -D $f "$pkgdir"/usr/share/doc/$pkgname/$f
	done

	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname

	# Clean up sysvinit files
	rm -rf "$pkgdir"/etc/rc.d "$pkgdir"/etc/sysconfig
}

common() {
	depends=""

	mkdir -p "$subpkgdir"/usr

	mv "$pkgdir"/etc "$subpkgdir"/
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

snmp() {
	pkgdesc="$pkgdesc (with SNMP support)"
	depends="$pkgname-common !$pkgname"

	cd "$builddir-snmp"

	install -m700 -D bin/keepalived "$subpkgdir"/usr/sbin/keepalived

	mkdir -p "$subpkgdir"/usr/share/snmp/mibs
	install -m644 doc/*-MIB.txt "$subpkgdir"/usr/share/snmp/mibs/
}

samples() {
	pkgdesc="Sample configuration for keepalived"

	mkdir -p "$subpkgdir"/etc/keepalived/
	mv "$pkgdir"/etc/keepalived/samples "$subpkgdir"/etc/keepalived/
}

sha512sums="68a510983bc043484e5edbc1d87563677a048282ec52873105f0af922e8b4de5b8e7176944010f9d4d6f65d1a4ebaf930c3d37273e28c1f115ed0fda245d8109  keepalived-2.0.19.tar.gz
afa49ffccc97ade7229548d85c37b9a75943c7945eb44aa6907cace71be5c3851bb2031b94d09dbdee0eb7313d200cb4acb208e89811f2727570fde50fba13e3  always-use-pid-dir.patch
4f1a3fdb0a936707a234efa063296f575fa8168551c87d2f9d43b7681d24605f852b4ddb2c674d1e311111f85232a708939a71cf128eb57c940ccb6927518dd4  keepalived.initd
2e6a9411d78fb954b5ede75d04225bf3f37d9ef4773c2b3587e1de1a0795f61a1ed784fa229854c2ee97f153205c3f76b3ff79cd55ede07f211731f0d17569cb  keepalived.confd"