Subject: Re: pkg/33494: net/vsftpd doesn't build on Solaris
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <joerg@britannica.bec.de>
List: pkgsrc-bugs
Date: 05/16/2006 16:55:02
The following reply was made to PR pkg/33494; it has been noted by GNATS.

From: joerg@britannica.bec.de
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/33494: net/vsftpd doesn't build on Solaris
Date: Tue, 16 May 2006 18:50:03 +0200

 --jI8keyz6grp/JLjh
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Tue, May 16, 2006 at 04:20:03PM +0000, Stefan Pfetzing wrote:
 >  Yep, it fails after linking (when my patch-ag is used)
 [snip]
 
 ARGH. OK, I see. Does the attached patch work? I've also made PAM
 optional.
 
 >  >> diff -uraN ../net/vsftpd/patches/patch-ag vsftpd/patches/patch-ag
 >  >
 >  >  I can't comment on the patch itself. Does a variable like timezone or
 >  >  localtime exist perhaps?
 >  
 >  Dunno, but this way does work fine - the only problem is, the tm  
 >  struct doesn't contain tm_gmtoff.
 
 This looks just too complicated. According to what I found on the net,
 Solaris should have declare "extern time_t timezone", which is the
 difference between UTC and localtime. Can you try to use that instead?
 It is much simpler after all :-)
 
 Joerg
 
 --jI8keyz6grp/JLjh
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="vsftpd.diff"
 
 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/net/vsftpd/Makefile,v
 retrieving revision 1.22
 diff -u -r1.22 Makefile
 --- Makefile	23 Apr 2006 00:12:41 -0000	1.22
 +++ Makefile	16 May 2006 16:46:57 -0000
 @@ -36,6 +36,12 @@
  SUBST_SED.paths+=	-e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
  SUBST_STAGE.paths=	post-patch
  
 +MAKE_ENV+=		LIBS=${LIBS:M*:Q}
 +
 +.include "../../mk/bsd.prefs.mk"
 +
 +LIBS.SunOS=	-lsocket -lnsl
 +
  .include "options.mk"
  
  do-install:
 Index: distinfo
 ===================================================================
 RCS file: /cvsroot/pkgsrc/net/vsftpd/distinfo,v
 retrieving revision 1.8
 diff -u -r1.8 distinfo
 --- distinfo	13 Jan 2006 18:12:46 -0000	1.8
 +++ distinfo	16 May 2006 16:46:57 -0000
 @@ -3,7 +3,7 @@
  SHA1 (vsftpd-2.0.4.tar.gz) = 6ffbcc08a91300664d527b3ac7c515421d5cd764
  RMD160 (vsftpd-2.0.4.tar.gz) = e8f07c125c0c3a8f0d457b47fd0062d6431c480b
  Size (vsftpd-2.0.4.tar.gz) = 154857 bytes
 -SHA1 (patch-aa) = 7e42db098d0d2261d5f02b36f7cba4ec6d91c6a0
 +SHA1 (patch-aa) = 323f694874777747ce525aa9ebb5d740684ec553
  SHA1 (patch-ab) = 18431ae27f53270ad4c19b0530e55348397fe143
  SHA1 (patch-ac) = 49269d863fd232d1e78cda039ae1a67368acfe1e
  SHA1 (patch-ad) = dd22f355216685fe0089addc5b1acf3b11490b06
 Index: options.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/net/vsftpd/options.mk,v
 retrieving revision 1.2
 diff -u -r1.2 options.mk
 --- options.mk	30 Jan 2006 18:07:06 -0000	1.2
 +++ options.mk	16 May 2006 16:46:57 -0000
 @@ -1,8 +1,8 @@
  # $NetBSD: options.mk,v 1.2 2006/01/30 18:07:06 wiz Exp $
  
  PKG_OPTIONS_VAR=	PKG_OPTIONS.vsftpd
 -PKG_SUPPORTED_OPTIONS=	inet6 ssl tcpwrappers
 -PKG_SUGGESTED_OPTIONS=	inet6 tcpwrappers
 +PKG_SUPPORTED_OPTIONS=	inet6 pam ssl tcpwrappers
 +PKG_SUGGESTED_OPTIONS=	inet6 pam tcpwrappers
  
  .include "../../mk/bsd.options.mk"
  
 @@ -12,6 +12,18 @@
  BROKEN=		Needs ipv6 option enabled.
  .endif
  
 +.if !empty(PKG_OPTIONS:Mpam)
 +.include "../../mk/pam.buildlink3.mk"
 +LIBS+=		-L${PAMBASE}
 +LIBS+=		${COMPILER_RPATH_FLAG}${PAMBASE}
 +LIBS+=		-lpam
 +.else
 +SUBST_CLASSES+=		pam
 +SUBST_FILES.pam=	builddefs.h
 +SUBST_SED.pam+=		-e 's,define VSF_BUILD_PAM,undef VSF_BUILD_PAM,g'
 +SUBST_STAGE.pam=	pre-configure
 +.endif
 +
  .if !empty(PKG_OPTIONS:Mssl)
  .include "../../security/openssl/buildlink3.mk"
  SUBST_CLASSES+=		ssl
 @@ -19,6 +31,10 @@
  SUBST_SED.ssl+=		-e 's,undef VSF_BUILD_SSL,define VSF_BUILD_SSL,g'
  SUBST_SED.ssl+=		-e 's,/usr/share/ssl/certs/vsftpd.pem,${SSLCERTS}/vsftpd.pem,g'
  SUBST_STAGE.ssl=	pre-configure
 +
 +LIBS+=		-L${BUILDLINK_PREFIX.openssl}
 +LIBS+=		${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.openssl}
 +LIBS+=		-lssl -lcrypto
  .endif
  
  .if !empty(PKG_OPTIONS:Mtcpwrappers)
 @@ -27,4 +43,8 @@
  SUBST_FILES.tcpwrappers=	builddefs.h
  SUBST_SED.tcpwrappers+=		-e 's,undef VSF_BUILD_TCPWRAPPERS,define VSF_BUILD_TCPWRAPPERS,g'
  SUBST_STAGE.tcpwrappers=	pre-configure
 +
 +LIBS+=		-L${BUILDLINK_PREFIX.tcp_wrappers}
 +LIBS+=		${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.tcp_wrappers}
 +LIBS+=		-lwrap
  .endif
 Index: patches/patch-aa
 ===================================================================
 RCS file: /cvsroot/pkgsrc/net/vsftpd/patches/patch-aa,v
 retrieving revision 1.3
 diff -u -r1.3 patch-aa
 --- patches/patch-aa	9 May 2003 23:31:40 -0000	1.3
 +++ patches/patch-aa	16 May 2006 16:46:57 -0000
 @@ -1,16 +1,17 @@
 -$NetBSD: patch-aa,v 1.3 2003/05/09 23:31:40 salo Exp $
 +$NetBSD$
  
 ---- Makefile.orig	2002-10-22 01:15:16.000000000 +0200
 -+++ Makefile	2003-05-09 23:46:09.000000000 +0200
 -@@ -1,9 +1,9 @@
 +--- Makefile.orig	2005-06-29 00:24:03.000000000 +0200
 ++++ Makefile
 +@@ -1,12 +1,6 @@
   # Makefile for systems with GNU tools
  -CC 	=	gcc
 -+#CC 	=	gcc
   INSTALL	=	install
   IFLAGS  = -idirafter dummyinc
 - #CFLAGS = -g
 +-#CFLAGS = -g
  -CFLAGS	=	-O2 -Wall -W -Wshadow #-pedantic -Werror -Wconversion
 -+CFLAGS	+=	-O2 -Wall -W -Wshadow #-pedantic -Werror -Wconversion
 +-
 +-LIBS	=	`./vsf_findlibs.sh`
 +-LINK	=	-Wl,-s
   
 - LIBS	=	`./vsf_findlibs.sh`
 - LINK	=	-Wl,-s
 + OBJS	=	main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \
 + 		tunables.o ftpdataio.o secbuf.o ls.o \
 
 --jI8keyz6grp/JLjh--