lol
1{ stdenv, fetchurl, intltool, ntfs3g, utillinux
2, mediaDir ? "/media/"
3, lockDir ? "/var/lock/pmount"
4, whiteList ? "/etc/pmount.allow"
5}:
6
7# constraint mention in the configure.ac
8assert stdenv.lib.hasSuffix "/" mediaDir;
9
10stdenv.mkDerivation rec {
11 name = "pmount-${version}";
12 version = "0.9.23";
13
14 src = fetchurl {
15 url = "mirror://debian/pool/main/p/pmount/pmount_${version}.orig.tar.bz2";
16 sha256 = "db38fc290b710e8e9e9d442da2fb627d41e13b3ee80326c15cc2595ba00ea036";
17 };
18
19 buildInputs = [ intltool utillinux ];
20
21 configureFlags = [
22 "--with-media-dir=${mediaDir}"
23 "--with-lock-dir=${lockDir}"
24 "--with-whitelist=${whiteList}"
25 "--with-mount-prog=${utillinux}/bin/mount"
26 "--with-umount-prog=${utillinux}/bin/umount"
27 "--with-mount-ntfs3g=${ntfs3g}/sbin/mount.ntfs-3g"
28 ];
29
30 postConfigure = ''
31 # etc/Mafile.am is hardcoded and it does not respect the --prefix option.
32 substituteInPlace ./etc/Makefile --replace DESTDIR prefix
33 # Do not change ownership & Do not add the set user ID bit
34 substituteInPlace ./src/Makefile --replace '-o root -g root -m 4755 ' '-m 755 '
35 '';
36
37 doCheck = false; # fails 1 out of 1 tests with "Error: could not open fstab-type file: No such file or directory"
38
39 meta = {
40 homepage = http://pmount.alioth.debian.org/;
41 description = "Mount removable devices as normal user";
42 license = stdenv.lib.licenses.gpl2;
43 platforms = stdenv.lib.platforms.linux;
44 };
45}