# Contributor: Sergei Lukin # Contributor: Sören Tempel # Contributor: Carlo Landmeter # Maintainer: Natanael Copa global pkgname := 'bind' global pkgver := '9.11.1_p2' global _ver := $(pkgver%_p*) global _p := $(pkgver#*_p) test $_p != $pkgver && global _ver := ""$(_ver)-P$_p"" global pkgrel := '2' global pkgdesc := '"The ISC DNS server'" global url := '"http://www.isc.org'" global arch := '"all'" global license := '"MIT BSD'" global depends := ''"" global pkgusers := '"named'" global pkggroups := '"named'" global makedepends := '"bash libressl-dev libcap-dev perl linux-headers bsd-compat-headers libxml2-dev'" global install := ""$pkgname.pre-install"" global subpackages := ""$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-tools"" global source := ""http://ftp.isc.org/isc/bind9/$(_ver)/bind-$(_ver).tar.gz bind.so_bsdcompat.patch named.initd named.confd named.conf.authoritative named.conf.recursive 127.zone localhost.zone named.ca "" # secfixes: # 9.11.0_p5-r0: # - CVE-2017-3136 # - CVE-2017-3137 # - CVE-2017-3138 # 9.10.4_p5-r0: # - CVE-2016-9131 # - CVE-2016-9147 # - CVE-2016-9444 global builddir := ""$srcdir/bind-$(_ver)"" proc prepare { cd $builddir ### http://bugs.gentoo.org/show_bug.cgi?id=227333 export CFLAGS="$CFLAGS -D_GNU_SOURCE" # Adjusting PATHs in manpages for i in [bin/named/named.8 bin/check/named-checkconf.8 bin/rndc/rndc.8] { sed -i \ -e 's:/etc/named.conf:/etc/bind/named.conf:g' \ -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \ -e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \ $(i) || return 1 } patch -p0 -i "$srcdir"/bind.so_bsdcompat.patch || return 1 } proc build { cd $builddir ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc/bind \ --localstatedir=/var \ --with-openssl=/usr \ --enable-linux-caps \ --with-libxml2 \ --enable-threads \ --enable-filter-aaaa \ --enable-ipv6 \ --enable-shared \ --enable-static \ --with-libtool \ --with-randomdev=/dev/random \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ || return 1 make || return 1 } proc package { cd $builddir install -d -m0770 -g named -o root "$pkgdir"/var/bind \ "$pkgdir"/var/bind/sec \ "$pkgdir"/var/bind/dyn \ "$pkgdir"/var/run/named \ || return 1 install -d -m0750 -g named -o root "$pkgdir"/etc/bind \ "$pkgdir"/var/bind/pri || return 1 make -j1 DESTDIR="$pkgdir" install || return 1 # FIXME: Workaround for broken symlink handling in abuild rm -f "$pkgdir"/usr/share/man/man1/bind9-config.1 find "$pkgdir"/usr/share/man/man3 -name 'lwres_*' \ -type f -exec rm -f '{''}' ';' install -Dm755 "$srcdir"/named.initd \ "$pkgdir"/etc/init.d/named || return 1 install -Dm644 "$srcdir"/named.confd \ "$pkgdir"/etc/conf.d/named || return 1 install -Dm644 "$srcdir"/named.conf.authoritative \ "$pkgdir"/etc/bind/named.conf.authoritative || return 1 install -Dm644 "$srcdir"/named.conf.recursive \ "$pkgdir"/etc/bind/named.conf.recursive || return 1 install -Dm644 "$srcdir"/named.ca \ "$pkgdir"/var/bind/named.ca || return 1 install -Dm644 "$srcdir"/127.zone \ "$pkgdir"/var/bind/pri/127.zone || return 1 install -Dm644 "$srcdir"/localhost.zone \ "$pkgdir"/var/bind/pri/localhost.zone || return 1 cd "$pkgdir"/var/bind ln -s named.ca root.cache || return 1 } proc tools { global pkgdesc := '"The ISC DNS tools'" global install := ''"" global depends := ''"" mkdir -p "$subpkgdir"/usr/bin for i in [dig host nslookup delv nsupdate] { mv "$pkgdir"/usr/bin/$(i) "$subpkgdir"/usr/bin/ || return 1 } mkdir -p "$subpkgdir"/usr/sbin for i in ["$pkgdir"/usr/sbin/dnssec-*] { mv $i "$subpkgdir"/usr/sbin || return 1 } } global sha512sums := '"275e63d87372a7cd994a5116a750fd1fffc3d29d0104e98a85316a181d9a251a5cb3e009a55b73685a17a68e2f4516db005c667f6e75309f88e2d30096507769 bind-9.11.1-P2.tar.gz f3e3d1b680617485b9db20a59a10fec3b3b539d423984493228a7d5aaa29d699b9012ad60e863e56bdaf15b73952c22710d0ded1c86cd24417ac775ee062cfa3 bind.so_bsdcompat.patch 196c0a3b43cf89e8e3547d7fb63a93ff9a3306505658dfd9aa78e6861be6b226580b424dd3dd44b955b2d9f682b1dc62c457f3ac29ce86200ef070140608c015 named.initd 127bdcc0b5079961f0951344bc3fad547450c81aee2149eac8c41a8c0c973ea0ffe3f956684c6fcb735a29c43d2ff48c153b6a71a0f15757819a72c492488ddf named.confd d2f61d02d7829af51faf14fbe2bafe8bc90087e6b6697c6275a269ebbddcaa14a234fff5c41da793e945e8ff1de3de0858a40334e0d24289eab98df4bb721ac5 named.conf.authoritative 3aba9763cfaf0880a89fd01202f41406b465547296ce91373eb999ea7719040bc1ac4e47b0de025a8060f693d3d88774a20d09a43fa7ac6aa43989b58b5ee8fe named.conf.recursive eed9886717539399518e011ae5eae6335aed4fae019e1def088c5be26bdc896c99c07adf84ee61babafa31d31ff3b028263d1c88d2eee17ecf4c95a9d77d524c 127.zone 340e86472a2c2746fe585c0aa5f079d3a9b46e828c1f53d48026533a169b7f77ded7d0a13d291d6962607bb9481456e6fa69df1834603e7555332615fb998f0b localhost.zone badb85a67199b1ff28cdd3529c6d7c70b2757a71f52fd5e0aecb6dab80fa1838af863cd5d451be078cad3ef35f0c256aaac1831671cec119c5a689503e98a192 named.ca'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(bind)} spids:[12])] spids: [12] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(9.11.1_p2)} spids:[15])] spids: [15] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_ver) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{("_p*")}) spids: [19 23] ) } spids: [18] ) ] spids: [18] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_p) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{("*_p")}) spids: [26 30] ) } spids: [25] ) ] spids: [25] ) (AndOr children: [ (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$_p"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ ($ VSub_Name "$pkgver"))} {(Lit_Other "]")} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_ver) op: Equal rhs: {(DQ (${ VSub_Name _ver) (-P) ($ VSub_Name "$_p"))} spids: [49] ) ] spids: [49] ) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(2)} spids:[58])] spids: [58] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("The ISC DNS server"))} spids: [61] ) ] spids: [61] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("http://www.isc.org"))} spids: [66] ) ] spids: [66] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ (all))} spids:[71])] spids: [71] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ ("MIT BSD"))} spids:[76])] spids: [76] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:depends) op:Equal rhs:{(DQ )} spids:[81])] spids: [81] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgusers) op:Equal rhs:{(DQ (named))} spids:[85])] spids: [85] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkggroups) op:Equal rhs:{(DQ (named))} spids:[90])] spids: [90] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: {(DQ ("bash libressl-dev libcap-dev perl linux-headers bsd-compat-headers libxml2-dev"))} spids: [95] ) ] spids: [95] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:install) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") (.pre-install))} spids: [100] ) ] spids: [100] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:subpackages) op: Equal rhs: { (DQ ($ VSub_Name "$pkgname") ("-doc ") ($ VSub_Name "$pkgname") ("-dev ") ($ VSub_Name "$pkgname") ("-libs ") ($ VSub_Name "$pkgname") (-tools) ) } spids: [106] ) ] spids: [106] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("http://ftp.isc.org/isc/bind9/") (${ VSub_Name _ver) (/bind-) (${ VSub_Name _ver) (".tar.gz\n") ("\tbind.so_bsdcompat.patch\n") ("\tnamed.initd\n") ("\tnamed.confd\n") ("\tnamed.conf.authoritative\n") ("\tnamed.conf.recursive\n") ("\t127.zone\n") ("\tlocalhost.zone\n") ("\tnamed.ca\n") ("\t") ) } spids: [118] ) ] spids: [118] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir") (/bind-) (${ VSub_Name _ver))} spids: [169] ) ] spids: [169] ) (FuncDef name: prepare body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(export)} {(Lit_VarLike "CFLAGS=") (DQ ($ VSub_Name "$CFLAGS") (" -D_GNU_SOURCE"))}) (ForEach iter_name: i iter_words: [{(bin/named/named.8)} {(bin/check/named-checkconf.8)} {(bin/rndc/rndc.8)}] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (C {(sed)} {(-i)} {(-e)} {(SQ <"s:/etc/named.conf:/etc/bind/named.conf:g">)} {(-e)} {(SQ <"s:/etc/rndc.conf:/etc/bind/rndc.conf:g">)} {(-e)} {(SQ <"s:/etc/rndc.key:/etc/bind/rndc.key:g">)} {(DQ (${ VSub_Name i))} ) (ControlFlow token: arg_word: {(1)} ) ] op_id: Op_DPipe ) ] spids: [224 270] ) spids: [216 222] ) (AndOr children: [ (C {(patch)} {(-p0)} {(-i)} {(DQ ($ VSub_Name "$srcdir")) (/bind.so_bsdcompat.patch)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) ] spids: [182] ) spids: [178 181] ) (FuncDef name: build body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(./configure)} {(--build) (Lit_Other "=") ($ VSub_Name "$CBUILD")} {(--host) (Lit_Other "=") ($ VSub_Name "$CHOST")} {(--prefix) (Lit_Other "=") (/usr)} {(--sysconfdir) (Lit_Other "=") (/etc/bind)} {(--localstatedir) (Lit_Other "=") (/var)} {(--with-openssl) (Lit_Other "=") (/usr)} {(--enable-linux-caps)} {(--with-libxml2)} {(--enable-threads)} {(--enable-filter-aaaa)} {(--enable-ipv6)} {(--enable-shared)} {(--enable-static)} {(--with-libtool)} {(--with-randomdev) (Lit_Other "=") (/dev/random)} {(--mandir) (Lit_Other "=") (/usr/share/man)} {(--infodir) (Lit_Other "=") (/usr/share/info)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [(C {(make)}) (ControlFlow token: arg_word:{(1)})] op_id: Op_DPipe ) ] spids: [298] ) spids: [294 297] ) (FuncDef name: package body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(install)} {(-d)} {(-m0770)} {(-g)} {(named)} {(-o)} {(root)} {(DQ ($ VSub_Name "$pkgdir")) (/var/bind)} {(DQ ($ VSub_Name "$pkgdir")) (/var/bind/sec)} {(DQ ($ VSub_Name "$pkgdir")) (/var/bind/dyn)} {(DQ ($ VSub_Name "$pkgdir")) (/var/run/named)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-d)} {(-m0750)} {(-g)} {(named)} {(-o)} {(root)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/bind)} {(DQ ($ VSub_Name "$pkgdir")) (/var/bind/pri)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(make)} {(-j1)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$pkgdir"))} {(install)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/share/man/man1/bind9-config.1)}) (C {(find)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/share/man/man3)} {(-name)} {(SQ <"lwres_*">)} {(-type)} {(f)} {(-exec)} {(rm)} {(-f)} {(EscapedLiteralPart token:) (EscapedLiteralPart token:) } {(EscapedLiteralPart token:)} ) (AndOr children: [ (C {(install)} {(-Dm755)} {(DQ ($ VSub_Name "$srcdir")) (/named.initd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/init.d/named)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-Dm644)} {(DQ ($ VSub_Name "$srcdir")) (/named.confd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/conf.d/named)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-Dm644)} {(DQ ($ VSub_Name "$srcdir")) (/named.conf.authoritative)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/bind/named.conf.authoritative)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-Dm644)} {(DQ ($ VSub_Name "$srcdir")) (/named.conf.recursive)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/bind/named.conf.recursive)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-Dm644)} {(DQ ($ VSub_Name "$srcdir")) (/named.ca)} {(DQ ($ VSub_Name "$pkgdir")) (/var/bind/named.ca)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-Dm644)} {(DQ ($ VSub_Name "$srcdir")) (/127.zone)} {(DQ ($ VSub_Name "$pkgdir")) (/var/bind/pri/127.zone)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-Dm644)} {(DQ ($ VSub_Name "$srcdir")) (/localhost.zone)} {(DQ ($ VSub_Name "$pkgdir")) (/var/bind/pri/localhost.zone)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(cd)} {(DQ ($ VSub_Name "$pkgdir")) (/var/bind)}) (AndOr children: [ (C {(ln)} {(-s)} {(named.ca)} {(root.cache)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) ] spids: [421] ) spids: [417 420] ) (FuncDef name: tools body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("The ISC DNS tools"))} spids: [774] ) ] spids: [774] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:install) op:Equal rhs:{(DQ )} spids:[780])] spids: [780] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:depends) op:Equal rhs:{(DQ )} spids:[785])] spids: [785] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/bin)}) (ForEach iter_name: i iter_words: [{(dig)} {(host)} {(nslookup)} {(delv)} {(nsupdate)}] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/bin/) (${ VSub_Name i)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/bin/)} ) (ControlFlow token: arg_word: {(1)} ) ] op_id: Op_DPipe ) ] spids: [818 843] ) spids: [806 816] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/sbin)}) (ForEach iter_name: i iter_words: [{(DQ ($ VSub_Name "$pkgdir")) (/usr/sbin/dnssec-) (Lit_Other "*")}] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (C {(mv)} {(DQ ($ VSub_Name "$i"))} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/sbin)} ) (ControlFlow token: arg_word: {(1)} ) ] op_id: Op_DPipe ) ] spids: [870 891] ) spids: [862 868] ) ] spids: [771] ) spids: [767 770] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "275e63d87372a7cd994a5116a750fd1fffc3d29d0104e98a85316a181d9a251a5cb3e009a55b73685a17a68e2f4516db005c667f6e75309f88e2d30096507769 bind-9.11.1-P2.tar.gz\n" ) ( "f3e3d1b680617485b9db20a59a10fec3b3b539d423984493228a7d5aaa29d699b9012ad60e863e56bdaf15b73952c22710d0ded1c86cd24417ac775ee062cfa3 bind.so_bsdcompat.patch\n" ) ( "196c0a3b43cf89e8e3547d7fb63a93ff9a3306505658dfd9aa78e6861be6b226580b424dd3dd44b955b2d9f682b1dc62c457f3ac29ce86200ef070140608c015 named.initd\n" ) ( "127bdcc0b5079961f0951344bc3fad547450c81aee2149eac8c41a8c0c973ea0ffe3f956684c6fcb735a29c43d2ff48c153b6a71a0f15757819a72c492488ddf named.confd\n" ) ( "d2f61d02d7829af51faf14fbe2bafe8bc90087e6b6697c6275a269ebbddcaa14a234fff5c41da793e945e8ff1de3de0858a40334e0d24289eab98df4bb721ac5 named.conf.authoritative\n" ) ( "3aba9763cfaf0880a89fd01202f41406b465547296ce91373eb999ea7719040bc1ac4e47b0de025a8060f693d3d88774a20d09a43fa7ac6aa43989b58b5ee8fe named.conf.recursive\n" ) ( "eed9886717539399518e011ae5eae6335aed4fae019e1def088c5be26bdc896c99c07adf84ee61babafa31d31ff3b028263d1c88d2eee17ecf4c95a9d77d524c 127.zone\n" ) ( "340e86472a2c2746fe585c0aa5f079d3a9b46e828c1f53d48026533a169b7f77ded7d0a13d291d6962607bb9481456e6fa69df1834603e7555332615fb998f0b localhost.zone\n" ) ( "badb85a67199b1ff28cdd3529c6d7c70b2757a71f52fd5e0aecb6dab80fa1838af863cd5d451be078cad3ef35f0c256aaac1831671cec119c5a689503e98a192 named.ca" ) ) } spids: [896] ) ] spids: [896] ) ] )