1 # Build recipe for dhcpcd.
3 # Copyright (c) 2017 MMPG, <mmpg@vp.pl>.
4 # Copyright (c) 2017-2019, 2021-2022 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.
18 # Exit immediately on any error
25 # Define a category for the output of the package name
26 pkgcategory=networking
28 tarname=${program}-${version}.tar.xz
31 fetch=https://roy.marples.name/downloads/dhcpcd/$tarname
34 dhcpcd is an implementation of the DHCP client specified in RFC2131.
36 A DHCP client is useful for connecting your computer to a network
37 which uses DHCP to assign network addresses. dhcpcd strives to be
38 a fully featured, yet very lightweight DHCP client.
41 homepage=https://roy.marples.name/projects/dhcpcd
42 license="2-clause BSD"
44 # Source documentation
45 docs="LICENSE README.md"
46 docsdir="${docdir}/${program}-${version}"
50 unpack "${tardir}/$tarname"
54 # Set sane permissions
55 chmod -R u+w,go-w,a+rX-s .
57 ./configure CPPFLAGS="$QICPPFLAGS" \
58 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
60 --libdir=/usr/lib${libSuffix} \
61 --libexecdir=/usr/libexec/dhcpcd \
62 --dbdir=/var/lib/dhcpcd \
63 --build="$(gcc -dumpmachine)"
66 make -j${jobs} DESTDIR="$destdir" install
68 # Install dhcpcd perp service(s)
70 mkdir -p "${destdir}/etc/perp/dhcpcd"
72 cp -p "${worktree}/archive/dhcpcd/rc.log" \
73 "${worktree}/archive/dhcpcd/rc.main" \
74 "${destdir}/etc/perp/dhcpcd/"
76 chmod 755 "${destdir}"/etc/perp/dhcpcd/rc.*
78 # Disable default service in favor of connmand
79 chmod -t "${destdir}/etc/perp/dhcpcd"
81 # Manage (dot) new files via graft(1)
83 touch "${destdir}/etc/.graft-config" \
84 "${destdir}/etc/perp/dhcpcd/.graft-config"
86 # Compress and link man pages (if needed)
87 if test -d "${destdir}/$mandir"
90 cd "${destdir}/$mandir"
91 find . -type f -exec lzip -9 {} +
92 find . -type l | while read -r file
94 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
101 mkdir -p "${destdir}${docsdir}"
102 cp -p $docs "${destdir}${docsdir}"