1 # Build recipe for eudev.
3 # Copyright (c) 2016-2023 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
21 version=20230406_39979ddf4
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.lz
31 https://dragora.mirror.garr.it/current/sources/$tarname
32 rsync://rsync.dragora.org/current/sources/$tarname
35 # https://github.com/eudev-project/eudev/releases/download/v${version}/$tarname
36 # https://dev.gentoo.org/~blueness/eudev/$tarname
40 Dynamic device management.
42 Udev is the device manager for the Linux 2.6 kernel series.
43 Its primary function is managing device nodes in /dev.
45 It is the successor of devfs and hotplug, which means that
46 it handles the /dev directory and all user space actions
47 when adding/removing devices, including firmware load.
49 This is a fork of Udev from Gentoo.
52 homepage=https://wiki.gentoo.org/wiki/Eudev
55 # Source documentation
57 docsdir="${docdir}/${program}-${version}"
61 unpack "${tardir}/$tarname"
65 # To re-generate source taken from repo
68 # Set sane permissions
69 chmod -R u+w,go-w,a+rX-s .
71 ./configure CPPFLAGS="$QICPPFLAGS" \
72 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
74 --libdir=/usr/lib${libSuffix} \
75 --with-rootlibexecdir=/lib/udev \
82 --enable-rule-generator \
84 --build="$(gcc -dumpmachine)"
86 # http://github.com/gentoo/eudev/pull/127
87 make -j${jobs} V=1 udevhwdbdir=/usr/lib${libSuffix}/udev/hwdb.d
88 make -j${jobs} udevhwdbdir=/usr/lib${libSuffix}/udev/hwdb.d \
89 DESTDIR="$destdir" install-strip
93 mkdir -p "${destdir}/etc/udev/rules.d"
94 for file in "${worktree}"/archive/eudev/etc/udev/rules.d/*
96 install -p -m 644 -o root -g root "$file" "${destdir}/etc/udev/rules.d"
99 for file in "${worktree}"/archive/eudev/lib/udev/*
101 install -p -m 755 -o root -g root "$file" "${destdir}/usr/lib${libSuffix}/udev"
105 # Install UDEVD perp service
107 mkdir -p "${destdir}/etc/perp/udevd"
109 cp -p "${worktree}/archive/eudev/etc/perp/rc.log" \
110 "${worktree}/archive/eudev/etc/perp/rc.main" \
111 "${destdir}/etc/perp/udevd/"
113 chmod 755 "${destdir}"/etc/perp/udevd/rc.*
115 # Be an active service by default
116 chmod +t "${destdir}/etc/perp/udevd"
118 # To handle config file(s)
119 touch "${destdir}/etc/udev/.graft-config" \
120 "${destdir}/etc/perp/udevd/.graft-config"
122 # Compress and link man pages (if needed)
123 if test -d "${destdir}/$mandir"
126 cd "${destdir}/$mandir"
127 find . -type f -exec lzip -9 {} +
128 find . -type l | while read -r file
130 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
137 mkdir -p "${destdir}/$docsdir"
138 cp -p $docs "${destdir}/$docsdir"