svn path=/nixpkgs/branches/kde-4.7/; revision=28146
[NixPkgs.git] / pkgs / os-specific / linux / pmount / default.nix
blob8f814c7212a33f883ce5ec59a12206f576c1f625
1 {stdenv, fetchurl, cryptsetup, dbus, dbus_glib, hal, intltool, ntfs3g, utillinuxng
2 , mediaDir ? "/media/"
3 , lockDir ? "/var/lock/pmount"
4 , whiteList ? "/etc/pmount.allow"
5 }:
7 # constraint mention in the configure.ac
8 assert stdenv.lib.hasSuffix "/" mediaDir;
10 stdenv.mkDerivation rec {
11   name = "pmount-0.9.23";
13   src = fetchurl {
14     url = "https://alioth.debian.org/frs/download.php/3310/${name}.tar.gz";
15     sha256 = "db38fc290b710e8e9e9d442da2fb627d41e13b3ee80326c15cc2595ba00ea036";
16   };
18   buildInputs = [ hal intltool utillinuxng ];
20   configureFlags = ""
21   + " --with-media-dir=${mediaDir}"
22   + " --with-lock-dir=${lockDir}"
23   + " --with-whitelist=${whiteList}"
24   + " --with-mount-prog=${utillinuxng}/bin/mount"
25   + " --with-umount-prog=${utillinuxng}/bin/umount"
26   + " --with-cryptsetup=${cryptsetup}/sbin/cryptsetup"
27   + " --with-mount-ntfs3g=${ntfs3g}/sbin/mount.ntfs-3g"
28   + " --enable-hal";
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   '';
37   meta = {
38     homepage = http://pmount.alioth.debian.org/;
39     description = "Mount removable devices as normal user";
40     license = "GPLv2";
41   };