diff --git a/pkgs/servers/ftp/vsftpd/default.nix b/pkgs/servers/ftp/vsftpd/default.nix index 85006a1d1755..d1de493e39e0 100644 --- a/pkgs/servers/ftp/vsftpd/default.nix +++ b/pkgs/servers/ftp/vsftpd/default.nix @@ -1,28 +1,35 @@ -{ stdenv, fetchurl, openssl, libcap, pam }: +{ stdenv, fetchurl, openssl, sslEnable ? false, libcap, pam }: -stdenv.mkDerivation rec { - name = "vsftpd-2.0.5"; +stdenv.mkDerivation (rec { + name = "vsftpd-2.3.4"; src = fetchurl { url = "ftp://vsftpd.beasts.org/users/cevans/${name}.tar.gz"; - sha256 = "0nzsxknnaqnfk853yjsmi31sl02jf5ydix9wxbldv4i7vzqfnqjl"; + sha256 = "0nhsqwnb8qkbxx5wjahara1ln85hp151v656psra5brpckwysrml"; }; - NIX_LDFLAGS = "-lcrypt -lssl -lcrypto -lpam -lcap"; - - preInstall = '' - ensureDir $out/{,s}bin - ensureDir $out/man/man{5,8} + preBuild ='' + makeFlagsArray=( "LIBS=${if sslEnable then "-lcrypt -lssl -lcrypto " else ""}-lpam -lcap" ) ''; - patches = [ ./fix.patch ] ; - - preConfigure = '' - sed -i "/VSF_BUILD_SSL/s/^#undef/#define/" builddefs.h - sed -i "s@/etc/vsftpd.user_list@$out/vsftpd.user_list@" vsftpd.conf.5 tunables.c - ''; - - postInstall = "cp ${./vsftpd.user_list} $out/vsftpd.user_list"; - 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 { + preConfigure = '' + echo "Will enable SSL" + sed -i "/VSF_BUILD_SSL/s/^#undef/#define/" builddefs.h + ''; + +} else { }) +) diff --git a/pkgs/servers/ftp/vsftpd/fix.patch b/pkgs/servers/ftp/vsftpd/fix.patch deleted file mode 100644 index aefce9395617..000000000000 --- a/pkgs/servers/ftp/vsftpd/fix.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff -rc vsftpd-2.0.3/Makefile vsftpd-2.0.3-new/Makefile -*** vsftpd-2.0.3/Makefile Fri Mar 11 20:34:15 2005 ---- vsftpd-2.0.3-new/Makefile Mon Sep 12 17:06:31 2005 -*************** -*** 5,11 **** - #CFLAGS = -g - CFLAGS = -O2 -Wall -W -Wshadow #-pedantic -Werror -Wconversion - -- LIBS = `./vsf_findlibs.sh` - LINK = -Wl,-s - - OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \ ---- 5,10 ---- -*************** -*** 24,44 **** - $(CC) -o vsftpd $(OBJS) $(LINK) $(LIBS) - - install: -! if [ -x /usr/local/sbin ]; then \ -! $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \ - else \ -! $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi -! if [ -x /usr/local/man ]; then \ -! $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \ -! $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \ -! elif [ -x /usr/share/man ]; then \ -! $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \ -! $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \ - else \ -! $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \ -! $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi -! if [ -x /etc/xinetd.d ]; then \ -! $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi - - clean: - rm -f *.o *.swp vsftpd ---- 23,41 ---- - $(CC) -o vsftpd $(OBJS) $(LINK) $(LIBS) - - install: -! if [ -x $$out/sbin ]; then \ -! $(INSTALL) -m 755 vsftpd $$out/sbin/vsftpd; \ - else \ -! $(INSTALL) -m 755 vsftpd $$out/sbin/vsftpd; fi -! if [ -x $$out/man ]; then \ -! $(INSTALL) -m 644 vsftpd.8 $$out/man/man8/vsftpd.8; \ -! $(INSTALL) -m 644 vsftpd.conf.5 $$out/man/man5/vsftpd.conf.5; \ -! elif [ -x $$out/share/man ]; then \ -! $(INSTALL) -m 644 vsftpd.8 $$out/man/man8/vsftpd.8; \ -! $(INSTALL) -m 644 vsftpd.conf.5 $$out/share/man/man5/vsftpd.conf.5; \ - else \ -! $(INSTALL) -m 644 vsftpd.8 $$out/man/man8/vsftpd.8; \ -! $(INSTALL) -m 644 vsftpd.conf.5 $$out/man/man5/vsftpd.conf.5; fi - - clean: - rm -f *.o *.swp vsftpd diff --git a/pkgs/servers/ftp/vsftpd/vsftpd.user_list b/pkgs/servers/ftp/vsftpd/vsftpd.user_list deleted file mode 100644 index 4200a1e93447..000000000000 --- a/pkgs/servers/ftp/vsftpd/vsftpd.user_list +++ /dev/null @@ -1,3 +0,0 @@ -#list users here that can (not) connect to vsftpd (only needed when userlistenable=true) - -raidbackup