Browse Source

vsftpd: fix musl compatibility

Make vsftpd to compile with musl, while preserving uclibc compatibility.

When using musl:
* disable UTMPX functionality
* disable -lnsl option in upstream Makefile

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Hannu Nyman 9 years ago
parent
commit
bc7c3799d4
2 changed files with 23 additions and 2 deletions
  1. 10
    2
      net/vsftpd/Makefile
  2. 13
    0
      net/vsftpd/patches/006-musl-compatibility.patch

+ 10
- 2
net/vsftpd/Makefile View File

1
 #
1
 #
2
-# Copyright (C) 2006-2014 OpenWrt.org
2
+# Copyright (C) 2006-2015 OpenWrt.org
3
 #
3
 #
4
 # This is free software, licensed under the GNU General Public License v2.
4
 # This is free software, licensed under the GNU General Public License v2.
5
 # See /LICENSE for more information.
5
 # See /LICENSE for more information.
9
 
9
 
10
 PKG_NAME:=vsftpd
10
 PKG_NAME:=vsftpd
11
 PKG_VERSION:=3.0.2
11
 PKG_VERSION:=3.0.2
12
-PKG_RELEASE:=4
12
+PKG_RELEASE:=5
13
 
13
 
14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
 PKG_SOURCE_URL:=https://security.appspot.com/downloads/
15
 PKG_SOURCE_URL:=https://security.appspot.com/downloads/
49
 
49
 
50
 Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
50
 Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
51
 
51
 
52
+ifneq ($(CONFIG_USE_MUSL),)
53
+  NLSSTRING:=-lcrypt
54
+else
55
+  NLSSTRING:=-lcrypt -lnsl
56
+endif
57
+
52
 ifeq ($(BUILD_VARIANT),notls)
58
 ifeq ($(BUILD_VARIANT),notls)
53
  define Build/Compile
59
  define Build/Compile
60
+	$(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
54
 	$(MAKE) -C $(PKG_BUILD_DIR) \
61
 	$(MAKE) -C $(PKG_BUILD_DIR) \
55
 		CC="$(TARGET_CC)" \
62
 		CC="$(TARGET_CC)" \
56
 		CFLAGS="$(TARGET_CFLAGS)" \
63
 		CFLAGS="$(TARGET_CFLAGS)" \
63
  define Build/Compile
70
  define Build/Compile
64
 	$(SED) 's/#undef VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(PKG_BUILD_DIR)/builddefs.h
71
 	$(SED) 's/#undef VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(PKG_BUILD_DIR)/builddefs.h
65
 	$(SED) 's/-lcrypt -lnsl/-lcrypt -lnsl -lssl -lcrypto/' $(PKG_BUILD_DIR)/Makefile
72
 	$(SED) 's/-lcrypt -lnsl/-lcrypt -lnsl -lssl -lcrypto/' $(PKG_BUILD_DIR)/Makefile
73
+	$(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
66
 	$(MAKE) -C $(PKG_BUILD_DIR) \
74
 	$(MAKE) -C $(PKG_BUILD_DIR) \
67
 		CC="$(TARGET_CC)" \
75
 		CC="$(TARGET_CC)" \
68
 		CFLAGS="$(TARGET_CFLAGS)" \
76
 		CFLAGS="$(TARGET_CFLAGS)" \

+ 13
- 0
net/vsftpd/patches/006-musl-compatibility.patch View File

1
+--- a/sysdeputil.c
2
++++ b/sysdeputil.c
3
+@@ -58,7 +58,9 @@
4
+ #define VSF_SYSDEP_HAVE_SHADOW
5
+ #define VSF_SYSDEP_HAVE_USERSHELL
6
+ #define VSF_SYSDEP_HAVE_LIBCAP
7
+-#define VSF_SYSDEP_HAVE_UTMPX
8
++#if defined(__GLIBC__) || defined(__UCLIBC__)
9
++  #define VSF_SYSDEP_HAVE_UTMPX
10
++#endif
11
+ 
12
+ #define __USE_GNU
13
+ #include <utmpx.h>