1 # Build recipe for dhcpcd.
3 # Copyright (c) 2017 MMPG, <mmpg@vp.pl>.
4 # Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
22 tarname=${program}-${version}.tar.xz
25 fetch=http://roy.marples.name/downloads/dhcpcd/$tarname
28 dhcpcd is an implementation of the DHCP client specified in RFC2131.
30 A DHCP client is useful for connecting your computer to a network
31 which uses DHCP to assign network addresses. dhcpcd strives to be
32 a fully featured, yet very lightweight DHCP client.
35 homepage=http://roy.marples.name/projects/dhcpcd
36 license="2-clause BSD"
38 # Source documentation
39 docs="LICENSE README.md"
40 docsdir="${docdir}/${program}-${version}"
46 unpack "${tardir}/$tarname"
50 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
52 --libdir=/usr/lib${libSuffix} \
53 --libexecdir=/usr/libexecdir/dhcpcd \
54 --dbdir=/var/lib/dhcpcd \
55 --build="$(cc -dumpmachine)"
58 make -j${jobs} DESTDIR="$destdir" install
60 # Install dhcpcd perp service(s)
62 mkdir -p "${destdir}/etc/perp/dhcpcd"
64 cp -p "${worktree}/archive/dhcpcd/rc.log" \
65 "${worktree}/archive/dhcpcd/rc.main" \
66 "${destdir}/etc/perp/dhcpcd/"
68 chmod 755 "${destdir}"/etc/perp/dhcpcd/rc.*
70 # Be an active service by default
71 chmod +t "${destdir}/etc/perp/dhcpcd"
73 # Manage (dot) new files via graft(1)
75 touch "${destdir}/etc/.graft-config" \
76 "${destdir}/etc/perp/dhcpcd/.graft-config"
78 # Compress and link man pages (if needed)
79 if test -d "${destdir}/$mandir"
82 cd "${destdir}/$mandir"
83 find . -type f -exec lzip -9 '{}' +
84 find . -type l | while read -r file
86 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
93 mkdir -p "${destdir}${docsdir}"
94 cp -p $docs "${destdir}${docsdir}/"