forked from mirrors/nixpkgs
vsftpd-2.3.4, make ssl optional, do not hardcode userlist
svn path=/nixpkgs/trunk/; revision=26927
This commit is contained in:
parent
b3e902c1a9
commit
9d87a3059d
|
@ -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 { })
|
||||
)
|
||||
|
|
|
@ -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
|
|
@ -1,3 +0,0 @@
|
|||
#list users here that can (not) connect to vsftpd (only needed when userlistenable=true)
|
||||
|
||||
raidbackup
|
Loading…
Reference in a new issue