# Maintainer: Natanael Copa global pkgname := 'dhcp' global pkgver := '4.3.5' global _realver := $(pkgver/_p/-P) global pkgrel := '0' global pkgdesc := '"ISC Dynamic Host Configuration Protocol (DHCP)'" global url := '"https://www.isc.org/'" global arch := '"all'" global license := '"ISC'" global depends := '' global pkgusers := '"dhcp'" global pkggroups := '"dhcp'" global makedepends := '"perl linux-headers file'" global install := '"dhcp.pre-install dhcp.pre-upgrade dhcp.post-upgrade'" global subpackages := ""$pkgname-doc $pkgname-dev $pkgname-dbg dhclient dhcrelay"" global source := ""http://ftp.isc.org/isc/dhcp/$(_realver)/$pkgname-$_realver.tar.gz dhcp-3.0-fix-perms.patch dhclient-script.patch dhcrelay.initd dhcrelay.confd dhcpd.confd dhcpd.initd"" global _builddir := ""$srcdir"/$pkgname-$_realver" proc prepare { cd $_builddir for i in [$source] { matchstr $i { *.patch { msg $i; patch -p1 -i "$srcdir"/$i || return 1} } } } proc build { cd $_builddir # fix ipv6 export CFLAGS="$CFLAGS -D_GNU_SOURCE \ -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc/dhcp \ --with-cli-pid-file=/var/run/dhcp/dhclient.pid \ --with-cli-lease-file=/var/lib/dhcp/dhclient.leases \ --with-srv-pid-file=/var/run/dhcp/dhcpd.pid \ --with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \ --with-relay-pid-file=/var/run/dhcp/dhcrelay.pid \ --enable-dhcpv6 \ --enable-paranoia \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ || return 1 make -j1 -C bind && make || return 1 } proc package { cd $_builddir make DESTDIR="$pkgdir" install install -m755 -D "$srcdir"/dhcpd.initd "$pkgdir"/etc/init.d/dhcpd install -m644 -D "$srcdir"/dhcpd.confd "$pkgdir"/etc/conf.d/dhcpd install -m751 -D "$_builddir"/client/scripts/linux "$pkgdir"/sbin/dhclient-script install -d "$pkgdir"/var/lib/dhcp install -d "$pkgdir"/var/run/dhcp } proc dhclient { global pkgdesc := '"ISC dhcp client'" install -d -o dhcp -g dhcp "$subpkgdir"/var/lib/dhcp install -d -o dhcp -g dhcp "$subpkgdir"/var/run/dhcp install -d "$subpkgdir"/usr/sbin install -d "$subpkgdir"/sbin install -d "$subpkgdir"/etc/dhcp mv "$pkgdir"/usr/sbin/dhclient "$subpkgdir"/usr/sbin/ mv "$pkgdir"/sbin/dhclient-script "$subpkgdir"/sbin/ mv "$pkgdir"/etc/dhcp/dhclient.conf* "$subpkgdir"/etc/dhcp/ } proc dhcrelay { global pkgdesc := '"ISC dhcp relay server'" global replaces := '"dhcp'" install -d "$subpkgdir"/var/run/dhcp \ "$subpkgdir"/usr/sbin || return 1 mv "$pkgdir"/usr/sbin/dhcrelay "$subpkgdir"/usr/sbin/ install -m755 -D "$srcdir"/dhcrelay.initd \ "$subpkgdir"/etc/init.d/dhcrelay install -m644 -D "$srcdir"/dhcrelay.confd \ "$subpkgdir"/etc/conf.d/dhcrelay } global sha512sums := '"aba0e1d361eb9e7ed33fc48c0b0b9288057af9ec51775e40e27feb9ababc182506706fcf39079236ce36b0f7ded391e107474dc29de2e60ed45d37753505e1f0 dhcp-4.3.5.tar.gz d5697a56fbbff25199962608986e7ffb533ed4afd3e344e3c79d2010dda73cc0b088f06c454e9f0c69eb054e09a374455fa71d3f73306e0c98fa76df4dd321b7 dhcp-3.0-fix-perms.patch a86fdbc73d3342be97261ac4ee13d4fc8cda812378cb370a856ad98a973adc7f4afad070cb3bde466881d8feade11a0c72389bf3338dc400e30bfa30f24cb073 dhclient-script.patch 0c3eee11ee9771a3bd7f8076827e57296136a36e6c00c3149e7274fb7a479feae4dc7d744f3c66ac78ffc96f036e14a7a5a0806095495441f98d76737a34faa6 dhcrelay.initd fd15dbaa4c61c3c26f407bf13dde859470a1adba134da064b653ccc152ce42635ee8de2fe113ae21ba8470e97e3caad8c1a47b69eb25e5e92b40e26790b96f6d dhcrelay.confd 7b7a77b7826b475a4113ebeee54501ce417cc56e85754301a82a185d88b4713d198f615a366e63e0e2b0aef988c8137dcd1e18c4036d993378257079da17693d dhcpd.confd 96ebc64e7c8a484133c23e9d1d7afe965247aaf54bc619b4fa81ed80f56b6bdb7e2c22d3f26db4c87c2a6ffd29ae2db6408954feac4c2104df712975cdfccc60 dhcpd.initd'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(dhcp)} spids:[3])] spids: [3] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(4.3.5)} spids:[6])] spids: [6] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_realver) op: Equal rhs: { (BracedVarSub token: suffix_op: (PatSub pat: {(_p)} replace: {(-P)} do_all: False do_prefix: False do_suffix: False ) spids: [10 16] ) } spids: [9] ) ] spids: [9] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(0)} spids:[18])] spids: [18] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("ISC Dynamic Host Configuration Protocol (DHCP)"))} spids: [21] ) ] spids: [21] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("https://www.isc.org/"))} spids: [26] ) ] spids: [26] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ (all))} spids:[31])] spids: [31] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ (ISC))} spids:[36])] spids: [36] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:depends) op:Equal rhs:{(SQ )} spids:[41])] spids: [41] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgusers) op:Equal rhs:{(DQ (dhcp))} spids:[43])] spids: [43] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkggroups) op:Equal rhs:{(DQ (dhcp))} spids:[48])] spids: [48] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: {(DQ ("perl linux-headers file"))} spids: [53] ) ] spids: [53] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:install) op: Equal rhs: {(DQ ("dhcp.pre-install dhcp.pre-upgrade dhcp.post-upgrade"))} spids: [58] ) ] spids: [58] ) (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") ("-dbg dhclient dhcrelay") ) } spids: [63] ) ] spids: [63] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("http://ftp.isc.org/isc/dhcp/") (${ VSub_Name _realver) (/) ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$_realver") (".tar.gz\n") ("\tdhcp-3.0-fix-perms.patch\n") ("\tdhclient-script.patch\n") ("\tdhcrelay.initd\n") ("\tdhcrelay.confd\n") ("\tdhcpd.confd\n") ("\tdhcpd.initd") ) } spids: [73] ) ] spids: [73] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$_realver")} spids: [93] ) ] spids: [93] ) (FuncDef name: prepare body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$_builddir"))}) (ForEach iter_name: i iter_words: [{($ VSub_Name "$source")}] do_arg_iter: False body: (DoGroup children: [ (Case to_match: {($ VSub_Name "$i")} arms: [ (case_arm pat_list: [{(Lit_Other "*") (.patch)}] action: [ (Sentence child: (C {(msg)} {($ VSub_Name "$i")}) terminator: ) (AndOr children: [ (C {(patch)} {(-p1)} {(-i)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$i")} ) (ControlFlow token: arg_word: {(1)} ) ] op_id: Op_DPipe ) ] spids: [135 137 161 -1] ) ] spids: [128 132 164] ) ] spids: [125 167] ) spids: [121 123] ) ] spids: [106] ) spids: [102 105] ) (FuncDef name: build body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$_builddir"))}) (C {(export)} {(Lit_VarLike "CFLAGS=") (DQ ($ VSub_Name "$CFLAGS") (" -D_GNU_SOURCE ") ("\t\t-D_PATH_DHCLIENT_CONF='") (EscapedLiteralPart token:) (/etc/dhcp/dhclient.conf) (EscapedLiteralPart token:) ("'") ) } ) (AndOr children: [ (C {(./configure)} {(--build) (Lit_Other "=") ($ VSub_Name "$CBUILD")} {(--host) (Lit_Other "=") ($ VSub_Name "$CHOST")} {(--prefix) (Lit_Other "=") (/usr)} {(--sysconfdir) (Lit_Other "=") (/etc/dhcp)} {(--with-cli-pid-file) (Lit_Other "=") (/var/run/dhcp/dhclient.pid)} {(--with-cli-lease-file) (Lit_Other "=") (/var/lib/dhcp/dhclient.leases)} {(--with-srv-pid-file) (Lit_Other "=") (/var/run/dhcp/dhcpd.pid)} {(--with-srv-lease-file) (Lit_Other "=") (/var/lib/dhcp/dhcpd.leases)} {(--with-relay-pid-file) (Lit_Other "=") (/var/run/dhcp/dhcrelay.pid)} {(--enable-dhcpv6)} {(--enable-paranoia)} {(--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)} {(-j1)} {(-C)} {(bind)}) (AndOr children: [(C {(make)}) (ControlFlow token: arg_word:{(1)})] op_id: Op_DPipe ) ] op_id: Op_DAmp ) ] spids: [176] ) spids: [172 175] ) (FuncDef name: package body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$_builddir"))}) (C {(make)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$pkgdir"))} {(install)}) (C {(install)} {(-m755)} {(-D)} {(DQ ($ VSub_Name "$srcdir")) (/dhcpd.initd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/init.d/dhcpd)} ) (C {(install)} {(-m644)} {(-D)} {(DQ ($ VSub_Name "$srcdir")) (/dhcpd.confd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/conf.d/dhcpd)} ) (C {(install)} {(-m751)} {(-D)} {(DQ ($ VSub_Name "$_builddir")) (/client/scripts/linux)} {(DQ ($ VSub_Name "$pkgdir")) (/sbin/dhclient-script)} ) (C {(install)} {(-d)} {(DQ ($ VSub_Name "$pkgdir")) (/var/lib/dhcp)}) (C {(install)} {(-d)} {(DQ ($ VSub_Name "$pkgdir")) (/var/run/dhcp)}) ] spids: [315] ) spids: [311 314] ) (FuncDef name: dhclient body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("ISC dhcp client"))} spids: [416] ) ] spids: [416] ) (C {(install)} {(-d)} {(-o)} {(dhcp)} {(-g)} {(dhcp)} {(DQ ($ VSub_Name "$subpkgdir")) (/var/lib/dhcp)} ) (C {(install)} {(-d)} {(-o)} {(dhcp)} {(-g)} {(dhcp)} {(DQ ($ VSub_Name "$subpkgdir")) (/var/run/dhcp)} ) (C {(install)} {(-d)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/sbin)}) (C {(install)} {(-d)} {(DQ ($ VSub_Name "$subpkgdir")) (/sbin)}) (C {(install)} {(-d)} {(DQ ($ VSub_Name "$subpkgdir")) (/etc/dhcp)}) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/sbin/dhclient)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/sbin/)} ) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/sbin/dhclient-script)} {(DQ ($ VSub_Name "$subpkgdir")) (/sbin/)} ) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/dhcp/dhclient.conf) (Lit_Other "*")} {(DQ ($ VSub_Name "$subpkgdir")) (/etc/dhcp/)} ) ] spids: [413] ) spids: [409 412] ) (FuncDef name: dhcrelay body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("ISC dhcp relay server"))} spids: [537] ) ] spids: [537] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:replaces) op: Equal rhs: {(DQ (dhcp))} spids: [543] ) ] spids: [543] ) (AndOr children: [ (C {(install)} {(-d)} {(DQ ($ VSub_Name "$subpkgdir")) (/var/run/dhcp)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/sbin)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/sbin/dhcrelay)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/sbin/)} ) (C {(install)} {(-m755)} {(-D)} {(DQ ($ VSub_Name "$srcdir")) (/dhcrelay.initd)} {(DQ ($ VSub_Name "$subpkgdir")) (/etc/init.d/dhcrelay)} ) (C {(install)} {(-m644)} {(-D)} {(DQ ($ VSub_Name "$srcdir")) (/dhcrelay.confd)} {(DQ ($ VSub_Name "$subpkgdir")) (/etc/conf.d/dhcrelay)} ) ] spids: [534] ) spids: [530 533] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "aba0e1d361eb9e7ed33fc48c0b0b9288057af9ec51775e40e27feb9ababc182506706fcf39079236ce36b0f7ded391e107474dc29de2e60ed45d37753505e1f0 dhcp-4.3.5.tar.gz\n" ) ( "d5697a56fbbff25199962608986e7ffb533ed4afd3e344e3c79d2010dda73cc0b088f06c454e9f0c69eb054e09a374455fa71d3f73306e0c98fa76df4dd321b7 dhcp-3.0-fix-perms.patch\n" ) ( "a86fdbc73d3342be97261ac4ee13d4fc8cda812378cb370a856ad98a973adc7f4afad070cb3bde466881d8feade11a0c72389bf3338dc400e30bfa30f24cb073 dhclient-script.patch\n" ) ( "0c3eee11ee9771a3bd7f8076827e57296136a36e6c00c3149e7274fb7a479feae4dc7d744f3c66ac78ffc96f036e14a7a5a0806095495441f98d76737a34faa6 dhcrelay.initd\n" ) ( "fd15dbaa4c61c3c26f407bf13dde859470a1adba134da064b653ccc152ce42635ee8de2fe113ae21ba8470e97e3caad8c1a47b69eb25e5e92b40e26790b96f6d dhcrelay.confd\n" ) ( "7b7a77b7826b475a4113ebeee54501ce417cc56e85754301a82a185d88b4713d198f615a366e63e0e2b0aef988c8137dcd1e18c4036d993378257079da17693d dhcpd.confd\n" ) ( "96ebc64e7c8a484133c23e9d1d7afe965247aaf54bc619b4fa81ed80f56b6bdb7e2c22d3f26db4c87c2a6ffd29ae2db6408954feac4c2104df712975cdfccc60 dhcpd.initd" ) ) } spids: [625] ) ] spids: [625] ) ] )