1 # Build recipe for eudev.
3 # Copyright (c) 2016-2021 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
30 fetch=https://dev.gentoo.org/~blueness/eudev/$tarname
33 Dynamic device management.
35 Udev is the device manager for the Linux 2.6 kernel series.
36 Its primary function is managing device nodes in /dev.
38 It is the successor of devfs and hotplug, which means that
39 it handles the /dev directory and all user space actions
40 when adding/removing devices, including firmware load.
42 This is a fork of Udev from Gentoo.
45 homepage=https://wiki.gentoo.org/wiki/Eudev
48 # Source documentation
50 docsdir="${docdir}/${program}-${version}"
54 unpack "${tardir}/$tarname"
58 # Set sane permissions
59 chmod -R u+w,go-w,a+rX-s .
61 ./configure CPPFLAGS="$QICPPFLAGS" \
62 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
64 --libdir=/usr/lib${libSuffix} \
71 --enable-rule-generator \
73 --disable-introspection \
75 --with-rootprefix="" \
76 --with-rootlibdir=/lib \
77 --build="$(gcc -dumpmachine)"
79 # http://github.com/gentoo/eudev/pull/127
80 make -j${jobs} V=1 udevhwdbdir=/lib/udev/hwdb.d
81 make -j${jobs} udevhwdbdir=/lib/udev/hwdb.d \
82 DESTDIR="$destdir" install-strip
84 # Make symlink for multipath
85 ( cd "${destdir}/usr/sbin" && ln -sf /lib/udev/scsi_id . )
89 mkdir -p "${destdir}/etc/udev/rules.d"
90 for file in "${worktree}"/archive/eudev/etc/udev/rules.d/*
92 install -p -m 644 -o root -g root "$file" "${destdir}/etc/udev/rules.d"
95 mkdir -p "${destdir}/lib/udev"
96 for file in "${worktree}"/archive/eudev/lib/udev/*
98 install -p -m 755 -o root -g root "$file" "${destdir}/lib/udev"
102 # Install UDEVD perp service
104 mkdir -p "${destdir}/etc/perp/udevd"
106 cp -p "${worktree}/archive/eudev/etc/perp/rc.log" \
107 "${worktree}/archive/eudev/etc/perp/rc.main" \
108 "${destdir}/etc/perp/udevd/"
110 chmod 755 "${destdir}"/etc/perp/udevd/rc.*
112 # Be an active service by default
113 chmod +t "${destdir}/etc/perp/udevd"
115 # To handle config file(s)
116 touch "${destdir}/etc/udev/.graft-config" \
117 "${destdir}/etc/perp/udevd/.graft-config"
119 # Compress and link man pages (if needed)
120 if test -d "${destdir}/$mandir"
123 cd "${destdir}/$mandir"
124 find . -type f -exec lzip -9 {} +
125 find . -type l | while read -r file
127 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
134 mkdir -p "${destdir}${docsdir}"
135 cp -p $docs "${destdir}${docsdir}"