etc: Enable a tty for a serial port by default.
[dragora.git] / recipes / boot / eudev / recipe
blob8da3a94ca8f678621d35806acd1da9000d835c32
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
18 set -e
20 program=eudev
21 version=20230406_39979ddf4
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=boot
27 tarname=${program}-${version}.tar.lz
29 # Remote source(s)
30 fetch="
31  https://dragora.mirror.garr.it/current/sources/$tarname
32  rsync://rsync.dragora.org/current/sources/$tarname
34 #fetch="
35 #  https://github.com/eudev-project/eudev/releases/download/v${version}/$tarname
36 #  https://dev.gentoo.org/~blueness/eudev/$tarname
39 description="
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
53 license=GPLv2+
55 # Source documentation
56 docs=COPYING
57 docsdir="${docdir}/${program}-${version}"
59 build()
61     unpack "${tardir}/$tarname"
63     cd "$srcdir"
65     # To re-generate source taken from repo
66     sh ./autogen.sh
68     # Set sane permissions
69     chmod -R u+w,go-w,a+rX-s .
71     ./configure CPPFLAGS="$QICPPFLAGS" \
72     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
73      $configure_args \
74      --libdir=/usr/lib${libSuffix} \
75      --with-rootlibexecdir=/lib/udev \
76      --mandir=$mandir \
77      --docdir=$docsdir \
78      --enable-static=no \
79      --enable-shared=yes \
80      --enable-hwdb \
81      --enable-manpages \
82      --enable-rule-generator \
83      --disable-selinux \
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
91     # Insert custom rules
93     mkdir -p "${destdir}/etc/udev/rules.d"
94     for file in "${worktree}"/archive/eudev/etc/udev/rules.d/*
95     do
96         install -p -m 644 -o root -g root "$file" "${destdir}/etc/udev/rules.d"
97     done
99     for file in "${worktree}"/archive/eudev/lib/udev/*
100     do
101         install -p -m 755 -o root -g root "$file" "${destdir}/usr/lib${libSuffix}/udev"
102     done
103     unset -v file
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"
124     then
125         (
126             cd "${destdir}/$mandir"
127             find . -type f -exec lzip -9 {} +
128             find . -type l | while read -r file
129             do
130                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
131                 rm -- "$file"
132             done
133         )
134     fi
136     # Copy documentation
137     mkdir -p "${destdir}/$docsdir"
138     cp -p $docs "${destdir}/$docsdir"