# Contributor: Pablo Castorino # Contributor: Jakub Jirutka # Maintainer: Natanael Copa global pkgname := 'keepalived' global pkgver := '1.3.7' global pkgrel := '0' global pkgdesc := '"Health Checking for Linux Virtual Server & High-Availability'" global url := '"http://www.keepalived.org/'" global arch := '"all'" global license := '"GPL'" global depends := ""$pkgname-common !$pkgname-snmp"" global makedepends := '"libressl-dev popt-dev linux-headers net-snmp-dev libnl-dev libnfnetlink-dev automake autoconf'" global install := ""$pkgname.post-upgrade"" global subpackages := ""$pkgname-doc $pkgname-sample-config:samples:noarch $pkgname-common $pkgname-snmp"" global source := ""http://www.keepalived.org/software/$pkgname-$pkgver.tar.gz $pkgname.initd $pkgname.confd "" global builddir := ""$srcdir/$pkgname-$pkgver"" proc prepare { default_prepare # The build scripts are somehow broken, so we must regenerate them. autoreconf -fiv cp -ar $builddir "$builddir-snmp" } proc build { cd "$builddir-snmp" _build --enable-snmp cd $builddir _build } proc _build { ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --localstatedir=/var \ --with-kernel-dir=/usr/include/linux \ --enable-vrrp \ --enable-sha1 \ $ifsjoin(Argv) make } proc check { "$builddir"/bin/keepalived --version "$builddir-snmp"/bin/keepalived --version } proc package { cd $builddir make DESTDIR="$pkgdir" install var f = ''; for f in [AUTHOR CONTRIBUTORS ChangeLog README INSTALL TODO \ genhash/README genhash/AUTHOR genhash/ChangeLog] { install -m644 -D $f "$pkgdir"/usr/share/doc/$pkgname/$f } 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 } proc common { global depends := ''"" mkdir -p "$subpkgdir"/usr mv "$pkgdir"/etc "$subpkgdir"/ mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ } proc snmp { global pkgdesc := ""$pkgdesc (with SNMP support)"" global 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/ } proc samples { global pkgdesc := '"Sample configuration for keepalived'" mkdir -p "$subpkgdir"/etc/keepalived/ mv "$pkgdir"/etc/keepalived/samples "$subpkgdir"/etc/keepalived/ } global sha512sums := '"61ea5a6914325dc69d3951330fc1332a08bf2073e079c6ea14ee9dee44a772ba2fd10fc61701c668ae5dcfd739c451d421bde9a73abbed6f76a9085b235cb077 keepalived-1.3.7.tar.gz 12361313dd044269150c9ea1a4ffc6987075b0106dfdd4b3804b1852d2a47f608d954ab473419474747b475c98fade3779800be8147134969016817cfa050ee4 keepalived.initd 413cb05aa2d1d8c0f552398bb5d511ee022b4d07f5b18217350c1159d013f2d26d87ae63d2977329ec78d7416760e84c4048a5ad20a1f63ef2bc3a1a84c3a41a keepalived.confd'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(keepalived)} spids:[9])] spids: [9] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(1.3.7)} spids:[12])] spids: [12] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(0)} spids:[15])] spids: [15] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("Health Checking for Linux Virtual Server & High-Availability"))} spids: [18] ) ] spids: [18] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("http://www.keepalived.org/"))} spids: [23] ) ] spids: [23] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ (all))} spids:[28])] spids: [28] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ (GPL))} spids:[33])] spids: [33] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") ("-common !") ($ VSub_Name "$pkgname") (-snmp))} spids: [38] ) ] spids: [38] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: { (DQ ("libressl-dev popt-dev linux-headers net-snmp-dev libnl-dev\n") ("\tlibnfnetlink-dev automake autoconf") ) } spids: [46] ) ] spids: [46] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:install) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") (.post-upgrade))} spids: [52] ) ] spids: [52] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:subpackages) op: Equal rhs: { (DQ ($ VSub_Name "$pkgname") ("-doc ") ($ VSub_Name "$pkgname") ("-sample-config:samples:noarch\n") ("\t") ($ VSub_Name "$pkgname") ("-common ") ($ VSub_Name "$pkgname") (-snmp) ) } spids: [58] ) ] spids: [58] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("http://www.keepalived.org/software/") ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver") (".tar.gz\n") ("\t") ($ VSub_Name "$pkgname") (".initd\n") ("\t") ($ VSub_Name "$pkgname") (".confd\n") ("\t") ) } spids: [71] ) ] spids: [71] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir") (/) ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver"))} spids: [87] ) ] spids: [87] ) (FuncDef name: prepare body: (BraceGroup children: [ (C {(default_prepare)}) (C {(autoreconf)} {(-fiv)}) (C {(cp)} {(-ar)} {(DQ ($ VSub_Name "$builddir"))} {(DQ ($ VSub_Name "$builddir") (-snmp))}) ] spids: [101] ) spids: [97 100] ) (FuncDef name: build body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir") (-snmp))}) (C {(_build)} {(--enable-snmp)}) (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(_build)}) ] spids: [138] ) spids: [134 137] ) (FuncDef name: _build body: (BraceGroup children: [ (C {(./configure)} {(--build) (Lit_Other "=") ($ VSub_Name "$CBUILD")} {(--host) (Lit_Other "=") ($ VSub_Name "$CHOST")} {(--prefix) (Lit_Other "=") (/usr)} {(--sysconfdir) (Lit_Other "=") (/etc)} {(--mandir) (Lit_Other "=") (/usr/share/man)} {(--localstatedir) (Lit_Other "=") (/var)} {(--with-kernel-dir) (Lit_Other "=") (/usr/include/linux)} {(--enable-vrrp)} {(--enable-sha1)} {($ VSub_At "$@")} ) (C {(make)}) ] spids: [171] ) spids: [167 170] ) (FuncDef name: check body: (BraceGroup children: [ (C {(DQ ($ VSub_Name "$builddir")) (/bin/keepalived)} {(--version)}) (C {(DQ ($ VSub_Name "$builddir") (-snmp)) (/bin/keepalived)} {(--version)}) ] spids: [240] ) spids: [236 239] ) (FuncDef name: package body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(make)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$pkgdir"))} {(install)}) (Sentence child: (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:f) op:Equal spids:[290])] spids: [288] ) terminator: ) (ForEach iter_name: f iter_words: [ {(AUTHOR)} {(CONTRIBUTORS)} {(ChangeLog)} {(README)} {(INSTALL)} {(TODO)} {(genhash/README)} {(genhash/AUTHOR)} {(genhash/ChangeLog)} ] do_arg_iter: False body: (DoGroup children: [ (C {(install)} {(-m644)} {(-D)} {($ VSub_Name "$f")} {(DQ ($ VSub_Name "$pkgdir")) (/usr/share/doc/) ($ VSub_Name "$pkgname") (/) ($ VSub_Name "$f") } ) ] spids: [320 340] ) spids: [298 318] ) (C {(install)} {(-m755)} {(-D)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (.initd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/init.d/) ($ VSub_Name "$pkgname")} ) (C {(install)} {(-m644)} {(-D)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (.confd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/conf.d/) ($ VSub_Name "$pkgname")} ) (C {(rm)} {(-rf)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/rc.d)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/sysconfig)} ) ] spids: [266] ) spids: [262 265] ) (FuncDef name: common body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:depends) op:Equal rhs:{(DQ )} spids:[413])] spids: [413] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr)}) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/etc)} {(DQ ($ VSub_Name "$subpkgdir")) (/)}) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/bin)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/)} ) ] spids: [410] ) spids: [406 409] ) (FuncDef name: snmp body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ($ VSub_Name "$pkgdesc") (" (with SNMP support)"))} spids: [465] ) ] spids: [465] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") ("-common !") ($ VSub_Name "$pkgname"))} spids: [472] ) ] spids: [472] ) (C {(cd)} {(DQ ($ VSub_Name "$builddir") (-snmp))}) (C {(install)} {(-m700)} {(-D)} {(bin/keepalived)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/sbin/keepalived)} ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/snmp/mibs)}) (C {(install)} {(-m644)} {(doc/) (Lit_Other "*") (-MIB.txt)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/snmp/mibs/)} ) ] spids: [462] ) spids: [458 461] ) (FuncDef name: samples body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("Sample configuration for keepalived"))} spids: [538] ) ] spids: [538] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/etc/keepalived/)}) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/keepalived/samples)} {(DQ ($ VSub_Name "$subpkgdir")) (/etc/keepalived/)} ) ] spids: [535] ) spids: [531 534] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "61ea5a6914325dc69d3951330fc1332a08bf2073e079c6ea14ee9dee44a772ba2fd10fc61701c668ae5dcfd739c451d421bde9a73abbed6f76a9085b235cb077 keepalived-1.3.7.tar.gz\n" ) ( "12361313dd044269150c9ea1a4ffc6987075b0106dfdd4b3804b1852d2a47f608d954ab473419474747b475c98fade3779800be8147134969016817cfa050ee4 keepalived.initd\n" ) ( "413cb05aa2d1d8c0f552398bb5d511ee022b4d07f5b18217350c1159d013f2d26d87ae63d2977329ec78d7416760e84c4048a5ad20a1f63ef2bc3a1a84c3a41a keepalived.confd" ) ) } spids: [570] ) ] spids: [570] ) ] )