recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / networking / dhcpcd / recipe
blob545cd74658e62f1f5e992fd54b7c33ce8d2f2689
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.
18 program=dhcpcd
19 version=8.0.6
20 release=1
22 # Define a category for the output of the package name
23 pkgcategory=networking
25 tarname=${program}-${version}.tar.xz
27 # Remote source(s)
28 fetch=http://roy.marples.name/downloads/dhcpcd/$tarname
30 description="
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}"
45 build()
47     set -e
49     unpack "${tardir}/$tarname"
51     cd "$srcdir"
53     # Set sane permissions
54     chmod -R u+w,go-w,a+rX-s .
56     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
57     $configure_args \
58     --libdir=/usr/lib${libSuffix} \
59     --libexecdir=/usr/libexec/dhcpcd \
60     --dbdir=/var/lib/dhcpcd \
61     --build="$(cc -dumpmachine)"
63     make -j${jobs}
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"
86     then
87         (
88             cd "${destdir}/$mandir"
89             find . -type f -exec lzip -9 '{}' +
90             find . -type l | while read -r file
91             do
92                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
93                 rm -- "$file"
94             done
95         )
96     fi
98     # Copy documentation
99     mkdir -p "${destdir}${docsdir}"
100     cp -p $docs "${destdir}${docsdir}/"