Subject: pkg/33494: net/vsftpd doesn't build on Solaris
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <dreamind@dreamind.de>
List: pkgsrc-bugs
Date: 05/16/2006 14:30:01
>Number:         33494
>Category:       pkg
>Synopsis:       net/vsftpd doesn't build on Solaris
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 16 14:30:00 +0000 2006
>Originator:     Stefan Pfetzing
>Release:        - pkgsrc (current) on solaris
>Organization:
AP-WDSL
>Environment:
SunOS blackbox 5.11 snv_38 i86pc i386 i86pc
>Description:
Hello,

vsftpd 2.0.4 does not build on Solaris.

(first it didn't compile because of problems with the timezone offset, and afterwards it didn't link.)

I already fixed that problem with a quite small patch.

If the pasted patch does not work in this way, I can put it on my website too.

thanks

Stefan
>How-To-Repeat:

>Fix:
diff -uraN ../net/vsftpd/distinfo vsftpd/distinfo
--- ../net/vsftpd/distinfo      2006-01-28 03:42:02.887916689 +0100
+++ vsftpd/distinfo     2006-05-16 15:33:24.667136138 +0200
@@ -9,3 +9,4 @@
 SHA1 (patch-ad) = dd22f355216685fe0089addc5b1acf3b11490b06
 SHA1 (patch-ae) = 373edb952206871b0b5c3e06fd5b90e25000f284
 SHA1 (patch-af) = 895496296cfa867653f05c6f475fd5d69f21811b
+SHA1 (patch-ag) = 7ebcf246d19a04eab57de42184975e53711ed300
diff -uraN ../net/vsftpd/Makefile vsftpd/Makefile
--- ../net/vsftpd/Makefile      2006-04-23 20:11:49.809006262 +0200
+++ vsftpd/Makefile     2006-05-16 16:05:59.206507877 +0200
@@ -1,8 +1,10 @@
 # $NetBSD: Makefile,v 1.22 2006/04/23 00:12:41 jlam Exp $
 #
+#
+.include "../../mk/bsd.prefs.mk"
 
 DISTNAME=      vsftpd-2.0.4
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    net
 MASTER_SITES=  ftp://vsftpd.beasts.org/users/cevans/
 
@@ -35,6 +37,9 @@
 SUBST_FILES.paths=     vsftpd.8 vsftpd.conf.5 vsftpd.conf
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
 SUBST_STAGE.paths=     post-patch
+.if (${OPSYS} == "SunOS")
+BUILD_MAKE_FLAGS+=     LDFLAGS="-L/usr/pkg/lib -Wl,-R/usr/pkg/lib:/usr/lib -lcrypto -lwrap -lrt -lssl -lpam"
+.endif
 
 .include "options.mk"
 
diff -uraN ../net/vsftpd/patches/patch-ag vsftpd/patches/patch-ag
--- ../net/vsftpd/patches/patch-ag      1970-01-01 01:00:00.000000000 +0100
+++ vsftpd/patches/patch-ag     2006-05-16 15:29:37.022652000 +0200
@@ -0,0 +1,21 @@
+--- sysutil.c.orig     2006-05-16 14:50:01.756061293 +0200
++++ sysutil.c  2006-05-16 15:29:33.564923203 +0200
+@@ -2475,10 +2475,18 @@
+ {
+   time_t the_time = 0;
+   struct tm* p_tm;
++#if defined (__SVR4) && defined (__sun) 
++  struct tm* gm_tm;
++#endif
+   tzset();
+   the_time = time(NULL);
+   p_tm = localtime(&the_time);
++#if defined (__SVR4) && defined (__sun) 
++  gm_tm = gmtime(&the_time);
++  s_timezone = mktime(p_tm) - mktime(gm_tm);
++#else
+   s_timezone = -p_tm->tm_gmtoff;
++#endif
+ }
+ 
+ const char*