Re: [ptxdist] [PATCH 4/4] lighttpd: Install mime.conf and remove hardcoded values
On Fri, Aug 11, 2017 at 12:00:26PM +0200, Alexander Dahl wrote: > Hi, > > Am Freitag, 11. August 2017, 10:04:02 schrieb Alexander Dahl: > > + @$(call targetinfo) > > + @cd $(LIGHTTPD_DIR) && \ > > + $(LIGHTTPD_PATH) $(LIGHTTPD_MAKE_ENV) \ > > + $(MAKE) $(LIGHTTPD_INSTALL_OPT) > > + install -D -m 644 "$(LIGHTTPD_DIR)/doc/config/conf.d/mime.conf" \ > > + "$(LIGHTTPD_PKGDIR)/etc/lighttpd/conf.d/mime.conf" > > + @$(call touch) > > This does not work as expected. I took this from the > documentation/ref_manual. This needs updating. :-/ > Removing the @ before cd I get this: > > cd /home/adahl/Work/bsp/foo/platform-bar/build-target/lighttpd-1.4.45 && > \ > \ > make This only works if the variables are actually set to something useful... > Seems like those note in the documentation is misleading? When playing > with ptxdist print I get something for LIGHTTPD_DIR, which is defined in > rules/lighttpd.make and for LIGHTTPD_PKGDIR, which is probably defined > somewhere outside. LIGHTTPD_PATH, LIGHTTPD_MAKE_ENV, and > LIGHTTPD_INSTALL_OPT however are empty, so no `make install` is called > here. > > I tried to find out how other rules do this, and could just find usb- > modeswitch.make and qt4.make doing something like this: > > @$(call install, QT4) This should be world/install too... > or > > @$(call world/install, USB_MODESWITCH) This is correct. > I assume this can be used to replace the failing three lines, but what's > the difference? This is not in the manual, is it? Some other packages > use $(call install, …) and yet other packages $(call world/install, …) > but none of those autoconf and @package@_INSTALL_OPT? 'install' should not be used. That's old compatibility stuff. 'world/install' uses @package@_INSTALL_OPT if set. If not, "install" is used as make argument. > If somebody points me to a solution, I'll send a v2. Make sure 'world/install' is the first command. It will remove the pkgdir. Michael -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [PATCH 4/4] lighttpd: Install mime.conf and remove hardcoded values
Hi, Am Freitag, 11. August 2017, 10:04:02 schrieb Alexander Dahl: > + @$(call targetinfo) > + @cd $(LIGHTTPD_DIR) && \ > + $(LIGHTTPD_PATH) $(LIGHTTPD_MAKE_ENV) \ > + $(MAKE) $(LIGHTTPD_INSTALL_OPT) > + install -D -m 644 "$(LIGHTTPD_DIR)/doc/config/conf.d/mime.conf" \ > + "$(LIGHTTPD_PKGDIR)/etc/lighttpd/conf.d/mime.conf" > + @$(call touch) This does not work as expected. I took this from the documentation/ref_manual. Removing the @ before cd I get this: cd /home/adahl/Work/bsp/foo/platform-bar/build-target/lighttpd-1.4.45 && \ \ make Seems like those note in the documentation is misleading? When playing with ptxdist print I get something for LIGHTTPD_DIR, which is defined in rules/lighttpd.make and for LIGHTTPD_PKGDIR, which is probably defined somewhere outside. LIGHTTPD_PATH, LIGHTTPD_MAKE_ENV, and LIGHTTPD_INSTALL_OPT however are empty, so no `make install` is called here. I tried to find out how other rules do this, and could just find usb- modeswitch.make and qt4.make doing something like this: @$(call install, QT4) or @$(call world/install, USB_MODESWITCH) I assume this can be used to replace the failing three lines, but what's the difference? This is not in the manual, is it? Some other packages use $(call install, …) and yet other packages $(call world/install, …) but none of those autoconf and @package@_INSTALL_OPT? If somebody points me to a solution, I'll send a v2. Greets Alex ___ ptxdist mailing list ptxdist@pengutronix.de
[ptxdist] [PATCH 4/4] lighttpd: Install mime.conf and remove hardcoded values
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 GruberSuggested-by: Michael Olbrich Signed-off-by: Alexander Dahl --- projectroot/etc/lighttpd/lighttpd.conf | 54 -- rules/lighttpd.make| 14 + 2 files changed, 14 insertions(+), 54 deletions(-) diff --git a/projectroot/etc/lighttpd/lighttpd.conf b/projectroot/etc/lighttpd/lighttpd.conf index c6f1e64..fa2f60e 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 8b52267..0e3f20d 100644 --- a/rules/lighttpd.make +++ b/rules/lighttpd.make @@ -64,6 +64,18 @@ LIGHTTPD_CONF_OPT:= \ --$(call ptx/wwo, PTXCONF_LIGHTTPD_LUA)-lua # +# Install +# +$(STATEDIR)/lighttpd.install: + @$(call targetinfo) + @cd $(LIGHTTPD_DIR) && \ + $(LIGHTTPD_PATH) $(LIGHTTPD_MAKE_ENV) \ + $(MAKE) $(LIGHTTPD_INSTALL_OPT) + install -D -m 644 "$(LIGHTTPD_DIR)/doc/config/conf.d/mime.conf" \ + "$(LIGHTTPD_PKGDIR)/etc/lighttpd/conf.d/mime.conf" + @$(call touch) + +# # Target-Install # @@ -118,6 +130,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, \ --