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.
21 # Define hash tag to categorize the package name output
24 tarname=${program}_${version}.orig.tar.bz2
27 fetch=http://deb.debian.org/debian/pool/main/p/pmount/$tarname
30 Mount removable devices like a normal user.
32 pmount is a wrapper around the standard mount program which permits normal
33 users to mount removable devices without a matching /etc/fstab entry.
34 This provides a robust basis for automounting frameworks like GNOME's
35 Utopia project and confines the amount of code that runs as root to a
39 homepage=http://launchpad.net/pmount
42 # Source documentation
43 docs="AUTHORS COPYING ChangeLog NEWS README"
44 docsdir="${docdir}/${program}-${version}"
50 unpack "${tardir}/$tarname"
54 # Apply a patch from Dragora
55 patch -Np1 -i "${worktree}/patches/pmount/pmount-missing_header.diff"
57 # Update for hosts based on musl
58 cp -f "${worktree}/archive/common/config.guess" config.guess
59 cp -f "${worktree}/archive/common/config.sub" config.sub
61 # Set sane permissions
62 chmod -R u+w,go-w,a+rX-s .
64 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
66 --libdir=/usr/lib${libSuffix} \
70 --build="$(cc -dumpmachine)"
73 make -j${jobs} DESTDIR="$destdir" install
75 # To handle dot (.new) files via graft(1)
76 touch "${destdir}/etc/.graft-config"
78 # Set permissions and ownerships for pmount
80 cd "${destdir}/usr/bin"
81 for file in pmount pumount
83 chown :plugdev "$file"
84 chmod 6710 "$file" # SetUID+SetGID
88 # Compress and link man pages (if needed)
89 if test -d "${destdir}/$mandir"
92 cd "${destdir}/$mandir"
93 find . -type f -exec lzip -9 '{}' +
94 find . -type l | while read -r file
96 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
103 mkdir -p "${destdir}${docsdir}"
104 cp -p $docs "${destdir}${docsdir}"