2021-01-15 14:45:37 +00:00
|
|
|
{ lib, stdenv, fetchurl, intltool, ntfs3g, util-linux
|
2010-01-03 11:10:22 +00:00
|
|
|
, mediaDir ? "/media/"
|
|
|
|
, lockDir ? "/var/lock/pmount"
|
|
|
|
, whiteList ? "/etc/pmount.allow"
|
|
|
|
}:
|
|
|
|
|
|
|
|
# constraint mention in the configure.ac
|
2021-01-15 14:45:37 +00:00
|
|
|
assert lib.hasSuffix "/" mediaDir;
|
2010-01-03 11:10:22 +00:00
|
|
|
|
2011-01-31 18:58:49 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "pmount";
|
2013-12-24 08:04:13 +00:00
|
|
|
version = "0.9.23";
|
2010-01-03 11:10:22 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-12-24 08:04:13 +00:00
|
|
|
url = "mirror://debian/pool/main/p/pmount/pmount_${version}.orig.tar.bz2";
|
2011-01-31 18:58:49 +00:00
|
|
|
sha256 = "db38fc290b710e8e9e9d442da2fb627d41e13b3ee80326c15cc2595ba00ea036";
|
2010-01-03 11:10:22 +00:00
|
|
|
};
|
|
|
|
|
2022-09-25 02:49:25 +00:00
|
|
|
nativeBuildInputs = [ intltool util-linux ];
|
|
|
|
buildInputs = [ util-linux ];
|
2010-01-03 11:10:22 +00:00
|
|
|
|
2018-07-25 21:44:21 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-media-dir=${mediaDir}"
|
|
|
|
"--with-lock-dir=${lockDir}"
|
|
|
|
"--with-whitelist=${whiteList}"
|
2020-11-24 15:29:28 +00:00
|
|
|
"--with-mount-prog=${util-linux}/bin/mount"
|
|
|
|
"--with-umount-prog=${util-linux}/bin/umount"
|
2018-07-25 21:44:21 +00:00
|
|
|
"--with-mount-ntfs3g=${ntfs3g}/sbin/mount.ntfs-3g"
|
|
|
|
];
|
2010-01-03 11:10:22 +00:00
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
# etc/Mafile.am is hardcoded and it does not respect the --prefix option.
|
|
|
|
substituteInPlace ./etc/Makefile --replace DESTDIR prefix
|
|
|
|
# Do not change ownership & Do not add the set user ID bit
|
|
|
|
substituteInPlace ./src/Makefile --replace '-o root -g root -m 4755 ' '-m 755 '
|
|
|
|
'';
|
|
|
|
|
2018-08-01 21:58:57 +00:00
|
|
|
doCheck = false; # fails 1 out of 1 tests with "Error: could not open fstab-type file: No such file or directory"
|
|
|
|
|
2010-01-03 11:10:22 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://bazaar.launchpad.net/~fourmond/pmount/main/files";
|
2010-01-03 11:10:22 +00:00
|
|
|
description = "Mount removable devices as normal user";
|
2021-01-15 14:45:37 +00:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.linux;
|
2010-01-03 11:10:22 +00:00
|
|
|
};
|
|
|
|
}
|