From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] Add package for mongoose web server
Date: Thu, 13 Dec 2012 23:42:44 +0100 [thread overview]
Message-ID: <50CA59E4.5090706@mind.be> (raw)
In-Reply-To: <1355349796-4165-1-git-send-email-cdhmanning@gmail.com>
Hi Charles,
On 12/12/12 23:03, Charles Manning wrote:
> Signed-off-by: Charles Manning<cdhmanning@gmail.com>
[snip]
> diff --git a/package/mongoose/Config.in b/package/mongoose/Config.in
> new file mode 100644
> index 0000000..39806f9
> --- /dev/null
> +++ b/package/mongoose/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_PACKAGE_MONGOOSE
> + bool "mongoose wen server"
All other web servers just give their name, so:
bool "mongoose"
Missing:
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_WCHAR
> + help
> + Mongoose small web server
> +
> + https://github.com/valenok/mongoose
> +
> +config BR2_PACKAGE_MONGOOSE_NO_PUT_AUTH
> + bool "Disable PUT authorization"
> + depends on BR2_PACKAGE_MONGOOSE
> + default n
default n is redundant because it is the default.
I prefer package-specific extra options to be wrapped in a if...endif
instead of using 'depends on'.
> + help
> + Sometimes you don't need PUT authorization.
[snip]
> diff --git a/package/mongoose/mongoose-3.3-no-auth.patch b/package/mongoose/mongoose-3.3-no-auth.patch
> new file mode 100644
> index 0000000..a470f5e
> --- /dev/null
> +++ b/package/mongoose/mongoose-3.3-no-auth.patch
> @@ -0,0 +1,55 @@
> +From db714636f86d79be33ffe8f2408c8731b5969208 Mon Sep 17 00:00:00 2001
> +From: Charles Manning<cdhmanning@gmail.com>
> +Date: Mon, 10 Dec 2012 10:14:20 +1300
> +Subject: [PATCH] Add NO_PUT_AUTH option to allow put with not authorization
> +
> +Sometimes you really don't want the security.
> +
> +Signed-off-by: Charles Manning<cdhmanning@gmail.com>
Although this is a useful addition, it's really a new feature and not
a cross-compilation fix. We normally don't include new features in buildroot
patches.
Could you upstream this patch? Sergey is pretty quick with accepting patches.
[snip]
> diff --git a/package/mongoose/mongoose.mk b/package/mongoose/mongoose.mk
> new file mode 100644
> index 0000000..ef06f41
> --- /dev/null
> +++ b/package/mongoose/mongoose.mk
> @@ -0,0 +1,38 @@
> +# Package for mongoose web server.
> +# This has been patched with an extension to allow PUT with no authorization.
> +#
Although on the last buildroot developer meeting some doubts were voices
about its usefulness, the rule is still that the .mk file should have the
following header:
#############################################################
#
# mongoose
#
#############################################################
> +MONGOOSE_VERSION = 3.3
> +MONGOOSE_SITE = http://github.com/valenok/mongoose/tarball/master
> +MONGOOSE_LICENSE = MIT
> +MONGOOSE_LICENSE_FILES = COPYING
> +MONGOOSE_INSTALL_STAGING = YES
Why install in staging? You're not installing libraries or headers.
That said, mongoose is often used as an embedded web server, so it
would be useful to have the option to:
- install the library and include file in staging;
- not install the executable and init script to target.
But it's OK if you're not ready to do this; in that case, just
remove the INSTALL_STAGING line.
> +MONGOOSE_INSTALL_TARGET = YES
This is the default.
> +
> +MONGOOSE_OPTIONAL_DEFINES = -DNO_SSL
Ideally, SSL should be enabled if BR2_PACKAGE_OPENSSL is y.
Adding support for HAVE_MD5, NDEBUG, NO_CGI and USE_LUA would also be
nice.
> +ifeq ($(BR2_PACKAGE_MONGOOSE_NO_PUT_AUTH),y)
> +MONGOOSE_OPTIONAL_DEFINES += -DNO_PUT_AUTH
If the patch is removed then obviously this should also be removed.
> +endif
> +
> +define MONGOOSE_BUILD_CMDS
> + $(MAKE) CC="$(TARGET_CC)" LD="$TARGETLD)" -C $(@D) linux COPT="$(MONGOOSE_OPTIONAL_DEFINES)"
Missing ( in $(TARGET_LD). But the Makefile doesn't use LD so it's
redundant.
TARGET_CFLAGS and TARGET_LDFLAGS should also be passed - but mongoose's
Makefile doesn't support that. Your options are:
- Patch the Makefile to use CFLAGS += instead of CFLAGS =; if you do that,
also rename LINFLAGS to LDFLAGS, and use += instead of = for that as well.
And of course upstream this patch.
- Add TARGET_CFLAGS to COPT. You could also ad TARGET_LDFLAGS because
there is anyway no object file compilation, but it's not ideal. If you
leave out TARGET_LDFLAGS it's not such a big deal anyway because it's
not often used.
- Don't use the Makefile, but just run:
cd $(@D); $(TARGET_CC) $(TARGET_CFLAGS) mongoose.c main.c \
$(TARGET_LDFLAGS) -ldl -pthread
> +endef
> +
> +define MONGOOSE_INSTALL_STAGING_CMDS
> + $(INSTALL) -d $(STAGING_DIR)/sbin
> + $(INSTALL) -d $(STAGING_DIR)/etc
> + $(INSTALL) -d $(STAGING_DIR)/etc/init.d
> + $(INSTALL) -D -m 755 $(@D)/mongoose $(STAGING_DIR)/sbin/mongoose
> + $(INSTALL) -D -m 755 $(@D)/mongoose.init $(STAGING_DIR)/etc/init.d/mongoose
Neither of these should be installed in staging. As I said earlier, it does
make sense to install the header and the .so.
> +endef
> +
> +define MONGOOSE_INSTALL_TARGET_CMDS
> + $(INSTALL) -d $(TARGET_DIR)/sbin
> + $(INSTALL) -d $(TARGET_DIR)/etc
> + $(INSTALL) -d $(TARGET_DIR)/etc/init.d
The install -D below already creates the directories, so these three are redundant.
> + $(INSTALL) -D -m 755 $(@D)/mongoose $(TARGET_DIR)/sbin/mongoose
> + $(INSTALL) -D -m 755 $(@D)/mongoose.init $(TARGET_DIR)/etc/init.d/mongoose
> +endef
> +
> +
> +$(eval $(generic-package))
> +
Redundant empty line.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
next prev parent reply other threads:[~2012-12-13 22:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-12 22:03 [Buildroot] [PATCH] Add package for mongoose web server Charles Manning
2012-12-13 22:42 ` Arnout Vandecappelle [this message]
2013-05-02 21:03 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50CA59E4.5090706@mind.be \
--to=arnout@mind.be \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox