recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / boot / eudev / recipe
blobb0213d07ca876626dc2c165780a6a9e61b86f7cd
1 # Build recipe for eudev.
3 # Copyright (c) 2016-2020 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 program=eudev
18 version=3.2.9
19 release=1
21 # Define a category for the output of the package name
22 pkgcategory=boot
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://dev.gentoo.org/~blueness/eudev/$tarname
29 description="
30 Dynamic device management.
32 Udev is the device manager for the Linux 2.6 kernel series.
33 Its primary function is managing device nodes in /dev.
35 It is the successor of devfs and hotplug, which means that
36 it handles the /dev directory and all user space actions
37 when adding/removing devices, including firmware load.
39 This is a fork of Udev from Gentoo.
42 homepage=http://wiki.gentoo.org/wiki/Eudev
43 license=GPLv2+
45 # Source documentation
46 docs=COPYING
47 docsdir="${docdir}/${program}-${version}"
49 build()
51     set -e
53     unpack "${tardir}/$tarname"
55     cd "$srcdir"
57     # Set sane permissions
58     chmod -R u+w,go-w,a+rX-s .
60     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
61      $configure_args \
62      --libdir=/usr/lib${libSuffix} \
63      --mandir=$mandir \
64      --docdir=$docsdir \
65      --enable-static=yes \
66      --enable-shared=yes \
67      --enable-hwdb \
68      --enable-manpages \
69      --enable-rule-generator \
70      --disable-selinux \
71      --disable-introspection \
72      --build="$(cc -dumpmachine)"
74     make -j${jobs} V=1
75     make -j${jobs} DESTDIR="$destdir" install-strip
77     # Move installed hwdb files under /lib
78     # Reported on http://github.com/gentoo/eudev/pull/127
79     mkdir -p "${destdir}/lib/udev/hwdb.d"
80     mv "${destdir}/etc/udev/hwdb.d"/* "${destdir}/lib/udev/hwdb.d"
82     # Make symlink for multipath
83     (
84         cd "${destdir}/usr/sbin" && \
85         ln -sf /usr/lib${libSuffix}/udev/scsi_id .
86     )
88     # Install perp service for udevd(8)
90     mkdir -p "${destdir}/etc/perp/udevd"
92     cp -p "${worktree}/archive/eudev/rc.log" \
93           "${worktree}/archive/eudev/rc.main" \
94           "${destdir}/etc/perp/udevd/"
96     chmod 755 "${destdir}"/etc/perp/udevd/rc.*
98     # Be an active service by default
99     chmod +t "${destdir}/etc/perp/udevd"
101     # To handle config file(s)
102     touch "${destdir}/etc/perp/udevd/.graft-config" \
103           "${destdir}/etc/udev/.graft-config"
105     # Compress and link man pages (if needed)
106     if test -d "${destdir}/$mandir"
107     then
108         (
109             cd "${destdir}/$mandir"
110             find . -type f -exec lzip -9 '{}' +
111             find . -type l | while read -r file
112             do
113                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
114                 rm -- "$file"
115             done
116         )
117     fi
119     # Copy documentation
120     mkdir -p "${destdir}${docsdir}"
121     cp -p $docs "${destdir}${docsdir}"