1 # Build recipe for eudev.
3 # Copyright (c) 2016-2022 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 # Exit immediately on any error
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.gz
31 https://github.com/eudev-project/eudev/releases/download/v${version}/$tarname
32 https://dev.gentoo.org/~blueness/eudev/$tarname
36 Dynamic device management.
38 Udev is the device manager for the Linux 2.6 kernel series.
39 Its primary function is managing device nodes in /dev.
41 It is the successor of devfs and hotplug, which means that
42 it handles the /dev directory and all user space actions
43 when adding/removing devices, including firmware load.
45 This is a fork of Udev from Gentoo.
48 homepage=https://wiki.gentoo.org/wiki/Eudev
51 # Source documentation
53 docsdir="${docdir}/${program}-${version}"
57 unpack "${tardir}/$tarname"
61 # Set sane permissions
62 chmod -R u+w,go-w,a+rX-s .
64 ./configure CPPFLAGS="$QICPPFLAGS" \
65 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
67 --libdir=/usr/lib${libSuffix} \
68 --with-rootlibexecdir=/lib/udev \
75 --enable-rule-generator \
77 --build="$(gcc -dumpmachine)"
79 # http://github.com/gentoo/eudev/pull/127
80 make -j${jobs} V=1 udevhwdbdir=/usr/lib${libSuffix}/udev/hwdb.d
81 make -j${jobs} udevhwdbdir=/usr/lib${libSuffix}/udev/hwdb.d \
82 DESTDIR="$destdir" install-strip
86 mkdir -p "${destdir}/etc/udev/rules.d"
87 for file in "${worktree}"/archive/eudev/etc/udev/rules.d/*
89 install -p -m 644 -o root -g root "$file" "${destdir}/etc/udev/rules.d"
92 for file in "${worktree}"/archive/eudev/lib/udev/*
94 install -p -m 755 -o root -g root "$file" "${destdir}/usr/lib${libSuffix}/udev"
98 # Install UDEVD perp service
100 mkdir -p "${destdir}/etc/perp/udevd"
102 cp -p "${worktree}/archive/eudev/etc/perp/rc.log" \
103 "${worktree}/archive/eudev/etc/perp/rc.main" \
104 "${destdir}/etc/perp/udevd/"
106 chmod 755 "${destdir}"/etc/perp/udevd/rc.*
108 # Be an active service by default
109 chmod +t "${destdir}/etc/perp/udevd"
111 # To handle config file(s)
112 touch "${destdir}/etc/udev/.graft-config" \
113 "${destdir}/etc/perp/udevd/.graft-config"
115 # Compress and link man pages (if needed)
116 if test -d "${destdir}/$mandir"
119 cd "${destdir}/$mandir"
120 find . -type f -exec lzip -9 {} +
121 find . -type l | while read -r file
123 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
130 mkdir -p "${destdir}/$docsdir"
131 cp -p $docs "${destdir}/$docsdir"