1 # Build recipe for dhcpcd.
3 # Copyright (c) 2017 MMPG, <mmpg@vp.pl>.
4 # Copyright (c) 2017-2019 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 # Define a category for the output of the package name
23 pkgcategory=networking
25 tarname=${program}-${version}.tar.xz
28 fetch=http://roy.marples.name/downloads/dhcpcd/$tarname
31 dhcpcd is an implementation of the DHCP client specified in RFC2131.
33 A DHCP client is useful for connecting your computer to a network
34 which uses DHCP to assign network addresses. dhcpcd strives to be
35 a fully featured, yet very lightweight DHCP client.
38 homepage=http://roy.marples.name/projects/dhcpcd
39 license="2-clause BSD"
41 # Source documentation
42 docs="LICENSE README.md"
43 docsdir="${docdir}/${program}-${version}"
49 unpack "${tardir}/$tarname"
53 # Set sane permissions
54 chmod -R u+w,go-w,a+rX-s .
56 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
58 --libdir=/usr/lib${libSuffix} \
59 --libexecdir=/usr/libexec/dhcpcd \
60 --dbdir=/var/lib/dhcpcd \
61 --build="$(cc -dumpmachine)"
64 make -j${jobs} DESTDIR="$destdir" install
66 # Install dhcpcd perp service(s)
68 mkdir -p "${destdir}/etc/perp/dhcpcd"
70 cp -p "${worktree}/archive/dhcpcd/rc.log" \
71 "${worktree}/archive/dhcpcd/rc.main" \
72 "${destdir}/etc/perp/dhcpcd/"
74 chmod 755 "${destdir}"/etc/perp/dhcpcd/rc.*
76 # Be an active service by default
77 chmod +t "${destdir}/etc/perp/dhcpcd"
79 # Manage (dot) new files via graft(1)
81 touch "${destdir}/etc/.graft-config" \
82 "${destdir}/etc/perp/dhcpcd/.graft-config"
84 # Compress and link man pages (if needed)
85 if test -d "${destdir}/$mandir"
88 cd "${destdir}/$mandir"
89 find . -type f -exec lzip -9 '{}' +
90 find . -type l | while read -r file
92 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
99 mkdir -p "${destdir}${docsdir}"
100 cp -p $docs "${destdir}${docsdir}/"