Skip to contentSkip to conversation

civetweb: new package

PATCH Superseded Thomas Davis 2 participants 4 messages Aug 27, 2013 – Aug 28, 2013 1 message not in the archive

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover civetweb: new package

Submission #3 with recommended changes.

1. Changed make file ifdef's to ifeq correctly.
2. Made openssl and ipv6 support automatic.
3. Moved html directory to /var/www
4. Fixed formatting and code convention issues.
5. largefile support is required by LUA AND Sqlite3. I was able to work this out for Sqlite3, but LUA less trivial.
6. posix_fallocate() has not been present in any of my test builds, and I cannot seem to find out how to enable it. However, I did find several projects that automatically disable use of the function via patches. I effectly did the same using a define HAVE_POSIX_FALLOCATE=0.
7. Simplified configuration options.

Thank you,
Thomas Davis

Thomas Davis (1):
civetweb: new package

 package/Config.in            |    1 +
 package/civetweb/Config.in   |   26 ++++++++++++++++++++
 package/civetweb/civetweb.mk |   53 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 package/civetweb/Config.in
 create mode 100644 package/civetweb/civetweb.mk
Signature · 1 line
1.7.8.3
#1 lore raw

PATCH v3 1/1 civetweb: new package

---
 package/Config.in            |    1 +
 package/civetweb/Config.in   |   26 ++++++++++++++++++++
 package/civetweb/civetweb.mk |   53 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 package/civetweb/Config.in
 create mode 100644 package/civetweb/civetweb.mk
package/Config.in +1 -0
index 7069d77..25433b6 100644
@@ -719,6 +719,7 @@ source "package/bridge-utils/Config.in"
 source "package/bwm-ng/Config.in"
 source "package/can-utils/Config.in"
 source "package/chrony/Config.in"
+source "package/civetweb/Config.in"
 source "package/connman/Config.in"
 source "package/crda/Config.in"
 source "package/ctorrent/Config.in"
package/civetweb/Config.in new file +26 -0
new file mode 100644
index 0000000..8ca587b
@@ -0,0 +1,26 @@
+config BR2_PACKAGE_CIVETWEB
+	bool "civetweb"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Full featured embedded web server with LUA support.
+	  
+	  https://sourceforge.net/projects/civetweb
+
+if BR2_PACKAGE_CIVETWEB
+
+config BR2_CIVETWEB_WITH_LUA
+	bool "enable LUA support"
+	# required by the bundled sqlite and lua code
+	depends on BR2_LARGEFILE
+	help
+	  Enable Lua support in Civetweb. Note that this will use a
+	  version of Lua and Sqlite bundled within the Civetweb
+	  sources, and not the packages from Buildroot.
+
+comment "lua support requires largefile support in toolchain"
+	depends on !BR2_LARGEFILE
+
+endif
+
+comment "civetweb requires a toolchain with PTHREAD support"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/civetweb/civetweb.mk new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
1.7.8.3
#2 lore raw

PATCH v3 1/1 civetweb: new package

Thomas,

Op 28-aug.-2013 01:34 schreef "Thomas Davis" <[email protected]> het volgende:

Quoted 7 lines
---
 package/Config.in            |    1 +
 package/civetweb/Config.in   |   26 ++++++++++++++++++++
 package/civetweb/civetweb.mk |   53

++++++++++++++++++++++++++++++++++++++++++

Quoted 22 lines
 3 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 package/civetweb/Config.in
 create mode 100644 package/civetweb/civetweb.mk
package/Config.in +1 -0
index 7069d77..25433b6 100644
@@ -719,6 +719,7 @@ source "package/bridge-utils/Config.in"
 source "package/bwm-ng/Config.in"
 source "package/can-utils/Config.in"
 source "package/chrony/Config.in"
+source "package/civetweb/Config.in"
 source "package/connman/Config.in"
 source "package/crda/Config.in"
 source "package/ctorrent/Config.in"
package/civetweb/Config.in new file +0 -0
new file mode 100644
index 0000000..8ca587b

package/civetweb/Config.in line 5

Quoted 5 lines
package/civetweb/Config.in new file +5 -0
@@ -0,0 +1,26 @@
+config BR2_PACKAGE_CIVETWEB
+       bool "civetweb"
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       help
+         Full featured embedded web server with LUA support.

Sorry that I didn't spot this earlier. The Lua website explicitly asks not to write LUA but rather Lua.
http://www.lua.org/about.html

package/civetweb/Config.in line 12

Quoted 7 lines
package/civetweb/Config.in new file +7 -0
+
+         https://sourceforge.net/projects/civetweb
+
+if BR2_PACKAGE_CIVETWEB
+
+config BR2_CIVETWEB_WITH_LUA
+       bool "enable LUA support"

Same here.

package/civetweb/Config.in line 20

Quoted 8 lines
package/civetweb/Config.in new file +8 -0
+       # required by the bundled sqlite and lua code
+       depends on BR2_LARGEFILE
+       help
+         Enable Lua support in Civetweb. Note that this will use a
+         version of Lua and Sqlite bundled within the Civetweb
+         sources, and not the packages from Buildroot.
+
+comment "lua support requires largefile support in toolchain"

I would tend to also write Lua here, although we sometimes wrote such comments in all-lowercase.

package/civetweb/civetweb.mk

Quoted 13 lines
package/civetweb/Config.in new file +6 -0
+       depends on !BR2_LARGEFILE
+
+endif
+
+comment "civetweb requires a toolchain with PTHREAD support"
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
package/civetweb/civetweb.mk new file +0 -0
new file mode 100644
index 0000000..17b02fb
@@ -0,0 +1,53 @@

+################################################################################

package/civetweb/civetweb.mk line 4

Quoted 4 lines
package/civetweb/civetweb.mk new file +3 -0
+#
+# civetweb
+#

+################################################################################

package/civetweb/civetweb.mk line 8

Quoted 3 lines
package/civetweb/civetweb.mk new file +3 -0
+
+CIVETWEB_VERSION = 1.3
+CIVETWEB_SOURCE = civetweb-$(CIVETWEB_VERSION).tar.gz

This is the default for FOO_SOURCE, so you can remove this line.

package/civetweb/civetweb.mk line 7

Quoted 1 line
package/civetweb/civetweb.mk new file +1 -0
+CIVETWEB_SITE =

http://github.com/sunsetbrew/civetweb/tarball/v$(CIVETWEB_VERSION)

Quoted 28 lines
package/civetweb/civetweb.mk new file +28 -0
+CIVETWEB_LICENSE = MIT
+CIVETWEB_LICENSE_FILES = LICENSE.md
+
+CIVETWEB_COPT = $(TARGET_CFLAGS) -DHAVE_POSIX_FALLOCATE=0
+CIVETWEB_CONF_OPT = TARGET_OS=LINUX
+CIVETWEB_LDFLAGS = $(TARGET_LDFLAGS)
+CIVETWEB_HTMLDIR = /var/www
+
+ifneq ($(BR2_LARGEFILE),y)
+       CIVETWEB_COPT += -DSQLITE_DISABLE_LFS
+endif
+
+ifeq ($(BR2_INET_IPV6),y)
+       CIVETWEB_CONF_OPT += WITH_IPV6=1
+endif
+
+ifeq ($(BR2_CIVETWEB_WITH_LUA),y)
+       CIVETWEB_CONF_OPT += WITH_LUA=1
+endif
+
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+       CIVETWEB_COPT += -DNO_SSL_DL -lcrypt -lssl
+       CIVETWEB_DEPENDENCIES += openssl
+else
+       CIVETWEB_COPT += -DNO_SSL
+endif
+
+define CIVETWEB_BUILD_CMDS

package/civetweb/civetweb.mk line 47

Quoted 10 lines
package/civetweb/civetweb.mk new file +10 -0
+       $(MAKE) CC="$(TARGET_CC)" -C $(@D) build \
+               $(CIVETWEB_CONF_OPT) \
+               COPT="$(CIVETWEB_COPT)"
+endef
+
+define CIVETWEB_INSTALL_TARGET_CMDS
+       $(MAKE) CC="$(TARGET_CC)" -C $(@D) install \
+               DOCUMENT_ROOT="$(CIVETWEB_HTMLDIR)" \
+               HTMLDIR="$(TARGET_DIR)$(CIVETWEB_HTMLDIR)" \
+               PREFIX="$(TARGET_DIR)/usr/local" \

The prefix should be usr/ instead of usr/local/.

package/civetweb/civetweb.mk

Quoted 7 lines
package/civetweb/civetweb.mk new file +6 -1
+               $(CIVETWEB_CONF_OPT) \
+               COPT='$(CIVETWEB_COPT)'
+endef
+
+$(eval $(generic-package))
+
--

Best regards,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130828/0f99969d/attachment.html>

A message that is not in the archive (sent off-list or not yet received): CAAXf6LUf4agKh3bQgDysHmBXrDC=Hk8jA7i_XDE7tofNHhC2bQ@mail.gmail.com

#4 lore raw

PATCH v3 1/1 civetweb: new package

Will fix, thanks for the tip. I had probably had better check other repo things for the non-camel case Lua.

Quoted 152 lines · Thomas De Schampheleire

Thomas,

Op 28-aug.-2013 01:34 schreef "Thomas Davis" <[email protected]> het volgende:

Quoted 30 lines
---
 package/Config.in            |    1 +
 package/civetweb/Config.in   |   26 ++++++++++++++++++++
 package/civetweb/civetweb.mk |   53
++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 package/civetweb/Config.in
 create mode 100644 package/civetweb/civetweb.mk
package/Config.in +1 -0
index 7069d77..25433b6 100644
@@ -719,6 +719,7 @@ source "package/bridge-utils/Config.in"
 source "package/bwm-ng/Config.in"
 source "package/can-utils/Config.in"
 source "package/chrony/Config.in"
+source "package/civetweb/Config.in"
 source "package/connman/Config.in"
 source "package/crda/Config.in"
 source "package/ctorrent/Config.in"
package/civetweb/Config.in new file +0 -0
new file mode 100644
index 0000000..8ca587b

package/civetweb/Config.in line 5

Quoted 5 lines
package/civetweb/Config.in new file +5 -0
@@ -0,0 +1,26 @@
+config BR2_PACKAGE_CIVETWEB
+       bool "civetweb"
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       help
+         Full featured embedded web server with LUA support.

Sorry that I didn't spot this earlier. The Lua website explicitly asks not to write LUA but rather Lua.
http://www.lua.org/about.html

package/civetweb/Config.in line 12

Quoted 9 lines
package/civetweb/Config.in new file +7 -0
+
 
 
+         https://sourceforge.net/projects/civetweb
+
+if BR2_PACKAGE_CIVETWEB
+
+config BR2_CIVETWEB_WITH_LUA
+       bool "enable LUA support"

Same here.

package/civetweb/Config.in line 20

Quoted 8 lines
package/civetweb/Config.in new file +8 -0
+       # required by the bundled sqlite and lua code
+       depends on BR2_LARGEFILE
+       help
+         Enable Lua support in Civetweb. Note that this will use a
+         version of Lua and Sqlite bundled within the Civetweb
+         sources, and not the packages from Buildroot.
+
+comment "lua support requires largefile support in toolchain"

I would tend to also write Lua here, although we sometimes wrote such comments in all-lowercase.

Quoted 14 lines
package/civetweb/Config.in new file +6 -0
+       depends on !BR2_LARGEFILE
 
 
+
+endif
+
+comment "civetweb requires a toolchain with PTHREAD support"
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
package/civetweb/civetweb.mk new file +0 -0
new file mode 100644
index 0000000..17b02fb

package/civetweb/civetweb.mk line 8

Quoted 10 lines
package/civetweb/civetweb.mk new file +8 -0
@@ -0,0 +1,53 @@
 
+################################################################################
+#
+# civetweb
+#
 
+################################################################################
+
+CIVETWEB_VERSION = 1.3
+CIVETWEB_SOURCE = civetweb-$(CIVETWEB_VERSION).tar.gz

This is the default for FOO_SOURCE, so you can remove this line.

Quoted 32 lines

+CIVETWEB_SITE =
http://github.com/sunsetbrew/civetweb/tarball/v$(CIVETWEB_VERSION)

package/civetweb/civetweb.mk new file +28 -0
+CIVETWEB_LICENSE = MIT
+CIVETWEB_LICENSE_FILES = LICENSE.md
+
+CIVETWEB_COPT = $(TARGET_CFLAGS) -DHAVE_POSIX_FALLOCATE=0
+CIVETWEB_CONF_OPT = TARGET_OS=LINUX
+CIVETWEB_LDFLAGS = $(TARGET_LDFLAGS)
+CIVETWEB_HTMLDIR = /var/www
+
+ifneq ($(BR2_LARGEFILE),y)
+       CIVETWEB_COPT += -DSQLITE_DISABLE_LFS
+endif
+
+ifeq ($(BR2_INET_IPV6),y)
+       CIVETWEB_CONF_OPT += WITH_IPV6=1
+endif
+
+ifeq ($(BR2_CIVETWEB_WITH_LUA),y)
+       CIVETWEB_CONF_OPT += WITH_LUA=1
+endif
+
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+       CIVETWEB_COPT += -DNO_SSL_DL -lcrypt -lssl
+       CIVETWEB_DEPENDENCIES += openssl
+else
+       CIVETWEB_COPT += -DNO_SSL
+endif
+
+define CIVETWEB_BUILD_CMDS

package/civetweb/civetweb.mk line 47

Quoted 10 lines
package/civetweb/civetweb.mk new file +10 -0
+       $(MAKE) CC="$(TARGET_CC)" -C $(@D) build \
+               $(CIVETWEB_CONF_OPT) \
+               COPT="$(CIVETWEB_COPT)"
+endef
+
+define CIVETWEB_INSTALL_TARGET_CMDS
+       $(MAKE) CC="$(TARGET_CC)" -C $(@D) install \
+               DOCUMENT_ROOT="$(CIVETWEB_HTMLDIR)" \
+               HTMLDIR="$(TARGET_DIR)$(CIVETWEB_HTMLDIR)" \
+               PREFIX="$(TARGET_DIR)/usr/local" \

The prefix should be usr/ instead of usr/local/.

package/civetweb/civetweb.mk

Quoted 9 lines
package/civetweb/civetweb.mk new file +6 -1
+               $(CIVETWEB_CONF_OPT) \
 
 
+               COPT='$(CIVETWEB_COPT)'
+endef
+
+$(eval $(generic-package))
+
--

Best regards,
Thomas