recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / tools / pmount / recipe
blob2fee3211fc59f43b4b866e11ddf26e958b32094b
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 program=pmount
18 version=0.9.23
19 release=1
21 # Define a category for the output of the package name
22 pkgcategory=tools
24 tarname=${program}_${version}.orig.tar.bz2
26 # Remote source(s)
27 fetch=http://deb.debian.org/debian/pool/main/p/pmount/$tarname
29 description="
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
36 minimum.
39 homepage=http://launchpad.net/pmount
40 license=GPLv3+
42 # Source documentation
43 docs="AUTHORS COPYING ChangeLog NEWS README"
44 docsdir="${docdir}/${program}-${version}"
46 build()
48     set -e
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
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" \
65      $configure_args \
66      --libdir=/usr/lib${libSuffix} \
67      --mandir=$mandir \
68      --docdir=$docsdir \
69      --disable-hal \
70      --build="$(cc -dumpmachine)"
72     make -j${jobs} V=1
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
79     (
80         cd "${destdir}/usr/bin"
81         for file in pmount pumount
82         do
83             chown :plugdev "$file"
84             chmod 6710 "$file"  # SetUID+SetGID
85         done
86     )
88     # Compress and link man pages (if needed)
89     if test -d "${destdir}/$mandir"
90     then
91         (
92             cd "${destdir}/$mandir"
93             find . -type f -exec lzip -9 '{}' +
94             find . -type l | while read -r file
95             do
96                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
97                 rm -- "$file"
98             done
99         )
100     fi
102     # Copy documentation
103     mkdir -p "${destdir}${docsdir}"
104     cp -p $docs "${destdir}${docsdir}"