recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / tools / pmount / recipe
blob5e736cbe006160bb13293068185ac96a967dcdd8
1 # Build recipe for pmount.
3 # Copyright (c) 2020 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=pmount
21 version=0.9.23
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=tools
27 tarname=${program}_${version}.orig.tar.bz2
29 # Remote source(s)
30 fetch=https://deb.debian.org/debian/pool/main/p/pmount/$tarname
32 description="
33 Mount removable devices like a normal user.
35 pmount is a wrapper around the standard mount program which permits normal
36 users to mount removable devices without a matching /etc/fstab entry.
37 This provides a robust basis for automounting frameworks like GNOME's
38 Utopia project and confines the amount of code that runs as root to a
39 minimum.
42 homepage=https://launchpad.net/pmount
43 license=GPLv3+
45 # Source documentation
46 docs="AUTHORS COPYING ChangeLog NEWS README"
47 docsdir="${docdir}/${program}-${version}"
49 build()
51     unpack "${tardir}/$tarname"
53     cd "$srcdir"
55     # Apply a patch from Dragora
56     patch -Np1 -i "${worktree}/patches/pmount/pmount-missing_header.diff"
58     # Update for hosts based on musl
59     cp -f "${worktree}/archive/common/config.guess" config.guess
60     cp -f "${worktree}/archive/common/config.sub" config.sub
62     # Set sane permissions
63     chmod -R u+w,go-w,a+rX-s .
65     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
66      $configure_args \
67      --libdir=/usr/lib${libSuffix} \
68      --mandir=$mandir \
69      --docdir=$docsdir \
70      --disable-hal \
71      --build="$(gcc -dumpmachine)"
73     make -j${jobs} V=1
74     make -j${jobs} DESTDIR="$destdir" install
76     # To handle dot (.new) files via graft(1)
77     touch "${destdir}/etc/.graft-config"
79     # Set permissions and ownerships for pmount
80     (
81         cd "${destdir}/usr/bin"
82         for file in pmount pumount
83         do
84             chown :plugdev "$file"
85             chmod 6710 "$file"  # SetUID+SetGID
86         done
87     )
89     # Compress and link man pages (if needed)
90     if test -d "${destdir}/$mandir"
91     then
92         (
93             cd "${destdir}/$mandir"
94             find . -type f -exec lzip -9 {} +
95             find . -type l | while read -r file
96             do
97                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
98                 rm -- "$file"
99             done
100         )
101     fi
103     # Copy documentation
104     mkdir -p "${destdir}/$docsdir"
105     cp -p $docs "${destdir}/$docsdir"