mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl <post@lespocky.de>
To: ptxdist@pengutronix.de
Cc: Alexander Dahl <ada@thorsis.com>
Subject: [ptxdist] [PATCH v3 4/4] lighttpd: Install mime.conf and remove hardcoded values
Date: Mon, 28 Aug 2017 20:08:18 +0200	[thread overview]
Message-ID: <20170828180818.3489-5-post@lespocky.de> (raw)
In-Reply-To: <20170828180818.3489-1-post@lespocky.de>

From: Alexander Dahl <ada@thorsis.com>

As suggested on the mailing list back in late 2016 this removes the
hardcoded mimetype values from lighttpd.conf and installs mime.conf
provided by upstream instead. You can still have your own mime.conf by
putting it in projectroot/etc/lighttpd/conf.d of course.

Suggested-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Suggested-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
v1 -> v2:
  * use world/install instead of what the outdated documentation says
---
 projectroot/etc/lighttpd/lighttpd.conf | 54 ----------------------------------
 rules/lighttpd.make                    | 12 ++++++++
 2 files changed, 12 insertions(+), 54 deletions(-)

diff --git a/projectroot/etc/lighttpd/lighttpd.conf b/projectroot/etc/lighttpd/lighttpd.conf
index c6f1e64cf..fa2f60e13 100644
--- a/projectroot/etc/lighttpd/lighttpd.conf
+++ b/projectroot/etc/lighttpd/lighttpd.conf
@@ -13,60 +13,6 @@ server.modules		= (
 	@MODULES@
 )
 
-# mimetype mapping
-mimetype.assign		= (
-	".pdf"		=>	"application/pdf",
-	".sig"		=>	"application/pgp-signature",
-	".spl"		=>	"application/futuresplash",
-	".class"	=>	"application/octet-stream",
-	".ps"		=>	"application/postscript",
-	".torrent"	=>	"application/x-bittorrent",
-	".dvi"		=>	"application/x-dvi",
-	".gz"		=>	"application/x-gzip",
-	".pac"		=>	"application/x-ns-proxy-autoconfig",
-	".swf"		=>	"application/x-shockwave-flash",
-	".tar.gz"	=>	"application/x-tgz",
-	".tgz"		=>	"application/x-tgz",
-	".tar"		=>	"application/x-tar",
-	".zip"		=>	"application/zip",
-	".mp3"		=>	"audio/mpeg",
-	".m3u"		=>	"audio/x-mpegurl",
-	".wma"		=>	"audio/x-ms-wma",
-	".wax"		=>	"audio/x-ms-wax",
-	".ogg"		=>	"audio/x-wav",
-	".wav"		=>	"audio/x-wav",
-	".gif"		=>	"image/gif",
-	".jpg"		=>	"image/jpeg",
-	".jpeg"		=>	"image/jpeg",
-	".png"		=>	"image/png",
-	".svg"		=>	"image/svg+xml",
-	".xbm"		=>	"image/x-xbitmap",
-	".xpm"		=>	"image/x-xpixmap",
-	".xwd"		=>	"image/x-xwindowdump",
-	".css"		=>	"text/css",
-	".html"		=>	"text/html",
-	".htm"		=>	"text/html",
-	".js"		=>	"text/javascript",
-	".asc"		=>	"text/plain",
-	".c"		=>	"text/plain",
-	".conf"		=>	"text/plain",
-	".text"		=>	"text/plain",
-	".txt"		=>	"text/plain",
-	".dtd"		=>	"text/xml",
-	".xml"		=>	"text/xml",
-	".mpeg"		=>	"video/mpeg",
-	".mpg"		=>	"video/mpeg",
-	".mov"		=>	"video/quicktime",
-	".qt"		=>	"video/quicktime",
-	".avi"		=>	"video/x-msvideo",
-	".asf"		=>	"video/x-ms-asf",
-	".asx"		=>	"video/x-ms-asf",
-	".wmv"		=>	"video/x-ms-wmv",
-	".bz2"		=>	"application/x-bzip",
-	".tbz"		=>	"application/x-bzip-compressed-tar",
-	".tar.bz2"	=>	"application/x-bzip-compressed-tar"
-)
-
 index-file.names = ( "index.html" )
 
 include "conf.d/*.conf"
diff --git a/rules/lighttpd.make b/rules/lighttpd.make
index 8b522670a..5d1123ee9 100644
--- a/rules/lighttpd.make
+++ b/rules/lighttpd.make
@@ -64,6 +64,16 @@ LIGHTTPD_CONF_OPT	:= \
 	--$(call ptx/wwo, PTXCONF_LIGHTTPD_LUA)-lua
 
 # ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+$(STATEDIR)/lighttpd.install:
+	@$(call targetinfo)
+	@$(call world/install, LIGHTTPD)
+	@install -vD -m 0644 "$(LIGHTTPD_DIR)/doc/config/conf.d/mime.conf" \
+		"$(LIGHTTPD_PKGDIR)/etc/lighttpd/conf.d/mime.conf"
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
 
@@ -118,6 +128,8 @@ endif
 	@$(call install_copy, lighttpd, 0, 0, 0755, /etc/lighttpd/conf.d)
 	@$(call install_replace, lighttpd, /etc/lighttpd/lighttpd.conf, \
 		@MODULES@, $(LIGHTTPD_MODULE_STRING))
+	@$(call install_alternative, lighttpd, 0, 0, 0644, \
+		/etc/lighttpd/conf.d/mime.conf)
 
 ifdef PTXCONF_LIGHTTPD_MOD_FASTCGI_PHP
 	@$(call install_alternative, lighttpd, 0, 0, 0644, \
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

      parent reply	other threads:[~2017-08-28 18:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 18:08 [ptxdist] [PATCH v3 0/4] lighttpd: Update and suggestions from last year Alexander Dahl
2017-08-28 18:08 ` [ptxdist] [PATCH v3 1/4] lighttpd: Ugprade from 1.4.39 to 1.4.45 Alexander Dahl
2017-08-28 18:08 ` [ptxdist] [PATCH v3 2/4] lighttpd: Rename memcache option to memcached Alexander Dahl
2017-08-28 18:08 ` [ptxdist] [PATCH v3 3/4] lighttpd: Simplify additional config include Alexander Dahl
2017-08-28 18:08 ` Alexander Dahl [this message]

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=20170828180818.3489-5-post@lespocky.de \
    --to=post@lespocky.de \
    --cc=ada@thorsis.com \
    --cc=ptxdist@pengutronix.de \
    /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