# Maintainer: Natanael Copa # Contributor: Jakub Jirutka # # secfixes: # 2.78-r0: # - CVE-2017-13704 # - CVE-2017-14491 # - CVE-2017-14492 # - CVE-2017-14493 # - CVE-2017-14494 # - CVE-2017-14495 # - CVE-2017-14496 # global pkgname := 'dnsmasq' global pkgver := '2.78' global pkgrel := '0' global pkgdesc := '"A lightweight DNS, DHCP, RA, TFTP and PXE server'" global url := '"http://www.thekelleys.org.uk/dnsmasq/'" global arch := '"all'" global license := '"GPL2'" global depends := ""!$pkgname-dnssec"" global makedepends := '"linux-headers nettle-dev'" global install := ""$pkgname.pre-install $pkgname.pre-upgrade"" global subpackages := ""$pkgname-doc $pkgname-dnssec"" global source := ""http://www.thekelleys.org.uk/dnsmasq/$pkgname-$pkgver.tar.gz $pkgname.initd $pkgname.confd uncomment-conf-dir.patch "" global builddir := ""$srcdir/$pkgname-$pkgver"" proc build { cd $builddir make CFLAGS="$CFLAGS" COPTS="-DHAVE_DNSSEC" all || return 1 mv src/dnsmasq src/dnsmasq~dnssec || return 1 make CFLAGS="$CFLAGS" clean all } # dnsmasq doesn't provide any test suite (shame on them!), so just check that # the binary isn't totally broken... proc check { cd $builddir ./src/dnsmasq --help >/dev/null } proc package { cd $builddir make PREFIX=/usr DESTDIR="$pkgdir" install || return 1 install -D -m755 "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname || return 1 install -D -m644 "$srcdir"/$pkgname.confd \ "$pkgdir"/etc/conf.d/$pkgname || return 1 install -m644 dnsmasq.conf.example "$pkgdir"/etc/dnsmasq.conf || return 1 install -d -m755 "$pkgdir"/etc/dnsmasq.d } proc dnssec { global pkgdesc := ""$pkgdesc with DNSSEC support"" global depends := ""!$pkgname"" cd $builddir install -D -m 755 src/dnsmasq~dnssec \ "$subpkgdir"/usr/sbin/dnsmasq || return 1 install -D -m 644 trust-anchors.conf \ "$subpkgdir"/usr/share/$pkgname/trust-anchors.conf || return 1 cp -r "$pkgdir"/etc "$subpkgdir"/etc } global sha512sums := '"980a6d836566d97cca6d744bee748ffb7bb63cca9455334cb923edefc0bf6aa24d513a9082575472f6d5762adae7b045dd48b3ae6fcee852fbda623fe6a918a5 dnsmasq-2.78.tar.gz b07055d71e535f753aff432124812fbef86cc2f490ff2a4704959c34b0f69caa74791a4ad08b2b8638c9126233591d3a86c188965eb1308e7e7c12dc0039d1ad dnsmasq.initd 9a401bfc408bf1638645c61b8ca734bea0a09ef79fb36648ec7ef21666257234254bbe6c73c82cc23aa1779ddcdda0e6baa2c041866f16dfb9c4e0ba9133eab8 dnsmasq.confd d01077f39e1240041a6700137810f254daf683b2d58dafecb6b162e94d694992e57d45964a57993b298f97c2b589eedcf9fb1506692730a38b7f06b5f55ba8d8 uncomment-conf-dir.patch'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(dnsmasq)} spids:[39])] spids: [39] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(2.78)} spids:[42])] spids: [42] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(0)} spids:[45])] spids: [45] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("A lightweight DNS, DHCP, RA, TFTP and PXE server"))} spids: [48] ) ] spids: [48] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("http://www.thekelleys.org.uk/dnsmasq/"))} spids: [53] ) ] spids: [53] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ (all))} spids:[58])] spids: [58] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ (GPL2))} spids:[63])] spids: [63] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: {(DQ ("!") ($ VSub_Name "$pkgname") (-dnssec))} spids: [68] ) ] spids: [68] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: {(DQ ("linux-headers nettle-dev"))} spids: [75] ) ] spids: [75] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:install) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") (".pre-install ") ($ VSub_Name "$pkgname") (.pre-upgrade))} spids: [80] ) ] spids: [80] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:subpackages) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") ("-doc ") ($ VSub_Name "$pkgname") (-dnssec))} spids: [88] ) ] spids: [88] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("http://www.thekelleys.org.uk/dnsmasq/") ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver") (".tar.gz\n") ("\t") ($ VSub_Name "$pkgname") (".initd\n") ("\t") ($ VSub_Name "$pkgname") (".confd\n") ("\tuncomment-conf-dir.patch\n") ("\t") ) } spids: [96] ) ] spids: [96] ) (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: [113] ) ] spids: [113] ) (FuncDef name: build body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(make)} {(Lit_VarLike "CFLAGS=") (DQ ($ VSub_Name "$CFLAGS"))} {(Lit_VarLike "COPTS=") (DQ (-DHAVE_DNSSEC))} {(all)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(mv)} {(src/dnsmasq)} {(src/dnsmasq) (Lit_Tilde "~") (dnssec)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(make)} {(Lit_VarLike "CFLAGS=") (DQ ($ VSub_Name "$CFLAGS"))} {(clean)} {(all)}) ] spids: [127] ) spids: [123 126] ) (FuncDef name: check body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (SimpleCommand words: [{(./src/dnsmasq)} {(--help)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[213])] ) ] spids: [199] ) spids: [195 198] ) (FuncDef name: package body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(make)} {(Lit_VarLike "PREFIX=") (/usr)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$pkgdir"))} {(install)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-D)} {(-m755)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (.initd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/init.d/) ($ VSub_Name "$pkgname")} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-D)} {(-m644)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (.confd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/conf.d/) ($ VSub_Name "$pkgname")} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-m644)} {(dnsmasq.conf.example)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/dnsmasq.conf)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(install)} {(-d)} {(-m755)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/dnsmasq.d)}) ] spids: [223] ) spids: [219 222] ) (FuncDef name: dnssec body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ($ VSub_Name "$pkgdesc") (" with DNSSEC support"))} spids: [351] ) ] spids: [351] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: {(DQ ("!") ($ VSub_Name "$pkgname"))} spids: [358] ) ] spids: [358] ) (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(install)} {(-D)} {(-m)} {(755)} {(src/dnsmasq) (Lit_Tilde "~") (dnssec)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/sbin/dnsmasq)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-D)} {(-m)} {(644)} {(trust-anchors.conf)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/) ($ VSub_Name "$pkgname") (/trust-anchors.conf) } ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(cp)} {(-r)} {(DQ ($ VSub_Name "$pkgdir")) (/etc)} {(DQ ($ VSub_Name "$subpkgdir")) (/etc)} ) ] spids: [348] ) spids: [344 347] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "980a6d836566d97cca6d744bee748ffb7bb63cca9455334cb923edefc0bf6aa24d513a9082575472f6d5762adae7b045dd48b3ae6fcee852fbda623fe6a918a5 dnsmasq-2.78.tar.gz\n" ) ( "b07055d71e535f753aff432124812fbef86cc2f490ff2a4704959c34b0f69caa74791a4ad08b2b8638c9126233591d3a86c188965eb1308e7e7c12dc0039d1ad dnsmasq.initd\n" ) ( "9a401bfc408bf1638645c61b8ca734bea0a09ef79fb36648ec7ef21666257234254bbe6c73c82cc23aa1779ddcdda0e6baa2c041866f16dfb9c4e0ba9133eab8 dnsmasq.confd\n" ) ( "d01077f39e1240041a6700137810f254daf683b2d58dafecb6b162e94d694992e57d45964a57993b298f97c2b589eedcf9fb1506692730a38b7f06b5f55ba8d8 uncomment-conf-dir.patch" ) ) } spids: [444] ) ] spids: [444] ) ] )