dhcpcd upgraded to version 7.0.0-rc4
[dragora.git] / recipes / networking / dhcpcd / recipe
blob7485c3581e6a1f1584b8cee1101e4e7d7018b9c3
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.
18 program=dhcpcd
19 version=7.0.0-rc4
20 release=1
22 tarname=${program}-${version}.tar.xz
24 # Remote source(s)
25 fetch=http://roy.marples.name/downloads/dhcpcd/$tarname
27 description="
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}"
42 build()
44     set -e
45     
46     unpack "${tardir}/$tarname"
47     
48     cd "$srcdir"
49     
50     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
51     $configure_args \
52     --libdir=/usr/lib${libSuffix} \
53     --libexecdir=/usr/libexecdir/dhcpcd \
54     --dbdir=/var/lib/dhcpcd \
55     --build="$(cc -dumpmachine)"
56     
57     make -j${jobs}
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"
80     then
81         (
82             cd "${destdir}/$mandir"
83             find . -type f -exec lzip -9 '{}' +
84             find . -type l | while read -r file
85             do
86                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
87                 rm -- "$file"
88             done
89         )
90     fi
91     
92     # Copy documentation
93     mkdir -p "${destdir}${docsdir}"
94     cp -p $docs "${destdir}${docsdir}/"