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
24 # Define a category for the output of the package name
27 tarname=${program}_${version}.orig.tar.bz2
30 fetch=https://deb.debian.org/debian/pool/main/p/pmount/$tarname
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
42 homepage=https://launchpad.net/pmount
45 # Source documentation
46 docs="AUTHORS COPYING ChangeLog NEWS README"
47 docsdir="${docdir}/${program}-${version}"
51 unpack "${tardir}/$tarname"
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" \
67 --libdir=/usr/lib${libSuffix} \
71 --build="$(gcc -dumpmachine)"
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
81 cd "${destdir}/usr/bin"
82 for file in pmount pumount
84 chown :plugdev "$file"
85 chmod 6710 "$file" # SetUID+SetGID
89 # Compress and link man pages (if needed)
90 if test -d "${destdir}/$mandir"
93 cd "${destdir}/$mandir"
94 find . -type f -exec lzip -9 {} +
95 find . -type l | while read -r file
97 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
104 mkdir -p "${destdir}/$docsdir"
105 cp -p $docs "${destdir}/$docsdir"