2011-04-23 08:58:57 +02:00
|
|
|
{ stdenv, fetchurl, openssl, sslEnable ? false, libcap, pam }:
|
2005-09-12 17:20:57 +02:00
|
|
|
|
2011-04-23 08:58:57 +02:00
|
|
|
stdenv.mkDerivation (rec {
|
|
|
|
name = "vsftpd-2.3.4";
|
2010-07-28 13:55:54 +02:00
|
|
|
|
2005-09-12 17:20:57 +02:00
|
|
|
src = fetchurl {
|
2008-01-31 15:08:02 +01:00
|
|
|
url = "ftp://vsftpd.beasts.org/users/cevans/${name}.tar.gz";
|
2011-04-23 08:58:57 +02:00
|
|
|
sha256 = "0nhsqwnb8qkbxx5wjahara1ln85hp151v656psra5brpckwysrml";
|
2005-09-12 17:20:57 +02:00
|
|
|
};
|
2011-04-29 20:18:56 +02:00
|
|
|
|
|
|
|
# The gcc-wrappers use -idirafter for glibc, and vsftpd also, and
|
|
|
|
# their dummyinc come before those of glibc, then the build works bad.
|
|
|
|
prePatch = ''
|
|
|
|
sed -i -e 's/-idirafter.*//' Makefile
|
|
|
|
'';
|
2005-09-12 17:20:57 +02:00
|
|
|
|
2011-04-23 08:58:57 +02:00
|
|
|
preBuild =''
|
|
|
|
makeFlagsArray=( "LIBS=${if sslEnable then "-lcrypt -lssl -lcrypto " else ""}-lpam -lcap" )
|
2008-01-31 15:08:02 +01:00
|
|
|
'';
|
2005-09-12 17:20:57 +02:00
|
|
|
|
2011-04-23 08:58:57 +02:00
|
|
|
buildInputs = [ openssl libcap pam ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -pv $out/sbin
|
|
|
|
install -v -m 755 vsftpd $out/sbin/vsftpd
|
|
|
|
|
|
|
|
mkdir -pv $out/share/man/man{5,8}
|
|
|
|
install -v -m 644 vsftpd.8 $out/share/man/man8/vsftpd.8
|
|
|
|
install -v -m 644 vsftpd.conf.5 $out/share/man/man5/vsftpd.conf.5
|
|
|
|
|
|
|
|
mkdir -pv $out/etc/xinetd.d
|
|
|
|
install -v -m 644 xinetd.d/vsftpd $out/etc/xinetd.d/vsftpd
|
|
|
|
'';
|
|
|
|
} // (if sslEnable then {
|
2010-07-28 13:55:54 +02:00
|
|
|
preConfigure = ''
|
2011-04-23 08:58:57 +02:00
|
|
|
echo "Will enable SSL"
|
2010-07-28 13:55:54 +02:00
|
|
|
sed -i "/VSF_BUILD_SSL/s/^#undef/#define/" builddefs.h
|
|
|
|
'';
|
2009-03-22 16:32:28 +01:00
|
|
|
|
2011-04-23 08:58:57 +02:00
|
|
|
} else { })
|
|
|
|
)
|