Skip to contentSkip to conversation

package/proftpd: add BR2_PACKAGE_PROFTPD_MOD_SFTP

PATCH New Matt Weber 2 participants 2 messages Aug 14, 2018

lore
Share & tools
lore

Matt Weber

author
#0 lore raw

PATCH v2 1/1 package/proftpd: add BR2_PACKAGE_PROFTPD_MOD_SFTP

From: Paresh Chaudhary <[email protected]>

This patch adds BR2_PACKAGE_PROFTPD_MOD_SFTP support and also changes the .mk file to add required modules as a list in a separate variable. This new variable will help in future to add more module support in proftpd package.

---
Changes
v1 ->v2
- Added a disable condition for the BR2_PACKAGE_PROFTPD_MOD_SFTP conditional in the .mk
[Baruch
- Added dependency on openssl and did testpkg runs on libopenssl and libressl as the backend
[Thomas P
- Cleaned up final --with-modules using Thomas's makeish approach

---
 package/proftpd/Config.in  |  6 ++++++
 package/proftpd/proftpd.mk | 15 ++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
package/proftpd/Config.in +6 -0
index e979d40..e7e3c13 100644
@@ -20,4 +20,10 @@ config BR2_PACKAGE_PROFTPD_MOD_REDIS
 	  The mod_redis module enables ProFTPD support for caching
 	  data in Redis servers, using the hiredis client library.
 
+config BR2_PACKAGE_PROFTPD_MOD_SFTP
+	bool "mod_sftp support"
+	select BR2_PACKAGE_OPENSSL
+	help
+	  Compile ProFTPD with mod_sftp support
+
 endif
package/proftpd/proftpd.mk +14 -1
index 3e165c6..873ccf2 100644
@@ -23,8 +23,11 @@ PROFTPD_CONF_OPTS = \
 	--enable-shadow \
 	--with-gnu-ld
 
+#Append all required modules in PROFTPD_MODULES variable
+#Use 'space' seperator for more than one module
+#e.g. PROFTPD_MODULES += mod_readme mod_ifsession
 ifeq ($(BR2_PACKAGE_PROFTPD_MOD_REWRITE),y)
-PROFTPD_CONF_OPTS += --with-modules=mod_rewrite
+PROFTPD_MODULES = mod_rewrite
 endif
 
 ifeq ($(BR2_PACKAGE_PROFTPD_MOD_REDIS),y)
@@ -34,6 +37,16 @@ else
 PROFTPD_CONF_OPTS += --disable-redis
 endif
 
+ifeq ($(BR2_PACKAGE_PROFTPD_MOD_SFTP),y)
+PROFTPD_CONF_OPTS += --enable-openssl
+PROFTPD_MODULES += mod_sftp
+PROFTPD_DEPENDENCIES += openssl
+else
+PROFTPD_CONF_OPTS += --disable-openssl
+endif
+
+PROFTPD_CONF_OPTS += --with-modules=$(subst $(space),:,$(PROFTPD_MODULES))
+
 # configure script doesn't handle detection of %llu format string
 # support for printing the file size when cross compiling, breaking
 # access for large files.
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 package/proftpd: add BR2_PACKAGE_PROFTPD_MOD_SFTP

Hello,

package/proftpd/proftpd.mk PROFTPD_CONF_OPTS = \ · line 28

Quoted 3 lines · Matt Weber
package/proftpd/proftpd.mk +3 -0
+#Append all required modules in PROFTPD_MODULES variable
+#Use 'space' seperator for more than one module
+#e.g. PROFTPD_MODULES += mod_readme mod_ifsession

This comment really wasn't necessary, that's how we do things everywhere in Buildroot, for all variables.

package/proftpd/proftpd.mk PROFTPD_CONF_OPTS = \ · line 30

Quoted 3 lines

ifeq ($(BR2_PACKAGE_PROFTPD_MOD_REWRITE),y)

package/proftpd/proftpd.mk +1 -1
-PROFTPD_CONF_OPTS += --with-modules=mod_rewrite
+PROFTPD_MODULES = mod_rewrite

I changed the "=" here to a "+=" to avoid potential mistakes in the future.

Applied to next with those changes. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com