recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / boot / eudev / recipe
bloba7a451cd6e00b46697adff356edcf7b4f0f1c9cb
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
18 set -e
20 program=eudev
21 version=3.2.11
22 release=3
24 # Define a category for the output of the package name
25 pkgcategory=boot
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch="
31   https://github.com/eudev-project/eudev/releases/download/v${version}/$tarname
32   https://dev.gentoo.org/~blueness/eudev/$tarname
35 description="
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
49 license=GPLv2+
51 # Source documentation
52 docs=COPYING
53 docsdir="${docdir}/${program}-${version}"
55 build()
57     unpack "${tardir}/$tarname"
59     cd "$srcdir"
61     # Set sane permissions
62     chmod -R u+w,go-w,a+rX-s .
64     ./configure CPPFLAGS="$QICPPFLAGS" \
65     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
66      $configure_args \
67      --libdir=/usr/lib${libSuffix} \
68      --with-rootlibexecdir=/lib/udev \
69      --mandir=$mandir \
70      --docdir=$docsdir \
71      --enable-static=no \
72      --enable-shared=yes \
73      --enable-hwdb \
74      --enable-manpages \
75      --enable-rule-generator \
76      --disable-selinux \
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
84     # Insert custom rules
86     mkdir -p "${destdir}/etc/udev/rules.d"
87     for file in "${worktree}"/archive/eudev/etc/udev/rules.d/*
88     do
89         install -p -m 644 -o root -g root "$file" "${destdir}/etc/udev/rules.d"
90     done
92     for file in "${worktree}"/archive/eudev/lib/udev/*
93     do
94         install -p -m 755 -o root -g root "$file" "${destdir}/usr/lib${libSuffix}/udev"
95     done
96     unset -v file
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"
117     then
118         (
119             cd "${destdir}/$mandir"
120             find . -type f -exec lzip -9 {} +
121             find . -type l | while read -r file
122             do
123                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
124                 rm -- "$file"
125             done
126         )
127     fi
129     # Copy documentation
130     mkdir -p "${destdir}/$docsdir"
131     cp -p $docs "${destdir}/$docsdir"