Skip to contentSkip to conversation

package/proftpd: add mod_{sql, quotatab} support

PATCH New Jared Bents 2 participants 3 messages Sep 28, 2018 – Oct 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 package/proftpd: add mod_{sql, quotatab} support

- Enables mod_sql which is required for quotatab_sql
- Adds options for enabling mod_quotatab and the sub-component file/LDAP/RADIUS/SQL modules
- Copies over ftpquota script if perl and mod_quotatab are enabled (This script isn't required but is an additional tool for mod_quotatab)

---
Changes
v1 -> v2
- Select BR2_PACKAGE_PROFTPD_MOD_SQL instead of Depend
- Removed install hook and adjusted ftpquota install logic
- Moved ftpasswd to separate patch

---
 package/proftpd/Config.in  | 39 +++++++++++++++++++++++++++++++++++++++
 package/proftpd/proftpd.mk | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)
package/proftpd/Config.in +39 -0
index e7e3c13..b615a5f 100644
@@ -26,4 +26,43 @@ config BR2_PACKAGE_PROFTPD_MOD_SFTP
 	help
 	  Compile ProFTPD with mod_sftp support
 
+config BR2_PACKAGE_PROFTPD_MOD_SQL
+	bool "mod_sql support"
+	help
+	  Compile ProFTPD with mode_sql support.
+
+config BR2_PACKAGE_PROFTPD_MOD_QUOTATAB
+	bool "mod_quotatab support"
+	help
+	  Compile ProFTPD with mode_quotatab support. This module
+	  is required in order to support quota tables:
+	        1. mod_quotatab_file
+	        2. mod_quotatab_ldap
+	        3. mod_quotatab_radius
+	        4. mod_quotatab_sql
+
+if BR2_PACKAGE_PROFTPD_MOD_QUOTATAB
+
+config BR2_PACKAGE_PROFTPD_MOD_QUOTATAB_FILE
+	bool "mod_quotatab_file table support"
+	help
+	  Compile mod_quotatab with mod_quotatab_file table.
+
+config BR2_PACKAGE_PROFTPD_MOD_QUOTATAB_LDAP
+	bool "mod_quotatab_ldap table support"
+	help
+	  Compile mod_quotatab with mod_quotatab_ldap table.
+
+config BR2_PACKAGE_PROFTPD_MOD_QUOTATAB_RADIUS
+	bool "mod_quotatab_radius table support"
+	help
+	  Compile mod_quotatab with mod_quotatab_radius table.
+
+config BR2_PACKAGE_PROFTPD_MOD_QUOTATAB_SQL
+	bool "mod_quotatab_sql table support"
+	select BR2_PACKAGE_PROFTPD_MOD_SQL
+	help
+	  Compile mod_quotatab with mod_quotatab_sql table.
+
+endif
 endif
package/proftpd/proftpd.mk +34 -0
index b02320f..78be759 100644
@@ -42,6 +42,30 @@ else
 PROFTPD_CONF_OPTS += --disable-openssl
 endif
 
+ifeq ($(BR2_PACKAGE_PROFTPD_MOD_SQL),y)
+PROFTPD_MODULES += mod_sql
+endif
+
+ifeq ($(BR2_PACKAGE_PROFTPD_MOD_QUOTATAB),y)
+PROFTPD_MODULES += mod_quotatab
+endif
+
+ifeq ($(BR2_PACKAGE_PROFTPD_MOD_QUOTATAB_FILE),y)
+PROFTPD_MODULES += mod_quotatab_file
+endif
+
+ifeq ($(BR2_PACKAGE_PROFTPD_MOD_QUOTATAB_LDAP),y)
+PROFTPD_MODULES += mod_quotatab_ldap
+endif
+
+ifeq ($(BR2_PACKAGE_PROFTPD_MOD_QUOTATAB_RADIUS),y)
+PROFTPD_MODULES += mod_quotatab_radius
+endif
+
+ifeq ($(BR2_PACKAGE_PROFTPD_MOD_QUOTATAB_SQL),y)
+PROFTPD_MODULES += mod_quotatab_sql
+endif
+
 PROFTPD_CONF_OPTS += --with-modules=$(subst $(space),:,$(PROFTPD_MODULES))
 
 # configure script doesn't handle detection of %llu format string
@@ -62,9 +86,19 @@ PROFTPD_POST_CONFIGURE_HOOKS = PROFTPD_MAKENAMES
 
 PROFTPD_MAKE = $(MAKE1)
 
+#Install Perl based scripts in target
+ifeq ($(BR2_PACKAGE_PERL),y)
+ifeq ($(BR2_PACKAGE_PROFTPD_MOD_QUOTATAB),y)
+define PROFTPD_INSTALL_FTPQUOTA
+	$(INSTALL) -D -m 0755 $(@D)/contrib/ftpquota $(TARGET_DIR)/usr/sbin/ftpquota
+endef
+endif
+endif
+
 define PROFTPD_INSTALL_TARGET_CMDS
 	$(INSTALL) -D -m 0755 $(@D)/proftpd $(TARGET_DIR)/usr/sbin/proftpd
 	$(INSTALL) -m 0644 -D $(@D)/sample-configurations/basic.conf $(TARGET_DIR)/etc/proftpd.conf
+	$(PROFTPD_INSTALL_FTPQUOTA)
 endef
 
 define PROFTPD_USERS
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 2/2 package/proftpd: add ftpasswd

- Copies over ftpasswd if perl is enabled

---
Changes
v1 -> v2
- ftpasswd moved to separate patch as it is not related to the added mod_{sql, quotatab} support

---
 package/proftpd/proftpd.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/proftpd/proftpd.mk +4 -0
index 78be759..12886a2 100644
@@ -93,12 +93,16 @@ define PROFTPD_INSTALL_FTPQUOTA
 	$(INSTALL) -D -m 0755 $(@D)/contrib/ftpquota $(TARGET_DIR)/usr/sbin/ftpquota
 endef
 endif
+define PROFTPD_INSTALL_FTPASSWD
+	$(INSTALL) -D -m 0755 $(@D)/contrib/ftpasswd $(TARGET_DIR)/usr/sbin/ftpasswd
+endef
 endif
 
 define PROFTPD_INSTALL_TARGET_CMDS
 	$(INSTALL) -D -m 0755 $(@D)/proftpd $(TARGET_DIR)/usr/sbin/proftpd
 	$(INSTALL) -m 0644 -D $(@D)/sample-configurations/basic.conf $(TARGET_DIR)/etc/proftpd.conf
 	$(PROFTPD_INSTALL_FTPQUOTA)
+	$(PROFTPD_INSTALL_FTPASSWD)
 endef
 
 define PROFTPD_USERS
Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 1/2 package/proftpd: add mod_{sql, quotatab} support

In reply to Jared Bents

Hello,

Quoted 16 lines · Jared Bents

- Enables mod_sql which is required for quotatab_sql
- Adds options for enabling mod_quotatab and the sub-component file/LDAP/RADIUS/SQL modules
- Copies over ftpquota script if perl and mod_quotatab are enabled (This script isn't required but is an additional tool for mod_quotatab)

---
Changes
v1 -> v2
- Select BR2_PACKAGE_PROFTPD_MOD_SQL instead of Depend
- Removed install hook and adjusted ftpquota install logic
- Moved ftpasswd to separate patch

Quoted 4 lines
---
 package/proftpd/Config.in  | 39 +++++++++++++++++++++++++++++++++++++++
 package/proftpd/proftpd.mk | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)

Both applied. Thanks!

Thomas

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