Skip to contentSkip to conversation

jquery: allow custom install location

PATCH New spdawson at gmail.com 2 participants 3 messages Jun 14, 2012 – Jun 17, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jquery: allow custom install location

From: Simon Dawson <[email protected]>

Allow the JavaScript install path to be customised. By default, JavaScript files are installed to /var/www under the target root directory.

---
 package/jquery/Config.in |    7 +++++++
 package/jquery/jquery.mk |    4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)
package/jquery/Config.in +7 -0
index 92f5604..e811d48 100644
@@ -6,3 +6,10 @@ config BR2_PACKAGE_JQUERY
 	  animating, and Ajax interactions for rapid web development.
 
 	  http://jquery.com
+
+config BR2_PACKAGE_JQUERY_JAVASCRIPT_PATH
+	string "Target install path for JavaScript"
+	default "/var/www"
+	depends on BR2_PACKAGE_JQUERY
+	help
+	  Specify a target install path for JavaScript files
package/jquery/jquery.mk +2 -2
index 08dd4a3..a4c31a8 100644
@@ -8,11 +8,11 @@ endef
 
 define JQUERY_INSTALL_TARGET_CMDS
 	$(INSTALL) -m 0644 -D $(@D)/$(JQUERY_SOURCE) \
-		$(TARGET_DIR)/var/www/jquery.js
+		$(TARGET_DIR)/$(BR2_PACKAGE_JQUERY_JAVASCRIPT_PATH)/jquery.js
 endef
 
 define JQUERY_UNINSTALL_TARGET_CMDS
-	rm -f $(TARGET_DIR)/var/www/jquery.js
+	rm -f $(TARGET_DIR)/$(BR2_PACKAGE_JQUERY_JAVASCRIPT_PATH)/jquery.js
 endef
 
 $(eval $(call GENTARGETS))
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 jquery: allow custom install location

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"spdawson" == spdawson <[email protected]> writes:

spdawson> From: Simon Dawson <[email protected]>

spdawson> Allow the JavaScript install path to be customised. By spdawson> default, JavaScript files are installed to /var/www under the spdawson> target root directory.

What's the use case for this? If we need it, wouldn't it then make more sense to have a BR-wide setting for this instead of for each webrelated package?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 jquery: allow custom install location

Quoted 3 lines

What's the use case for this? If we need it, wouldn't it then make more sense to have a BR-wide setting for this instead of for each webrelated package?

Installing JavaScript files into the hard-coded /var/www directory isn't always appropriate. For example, I am working on a project at the moment where /var is mounted as tmpfs, and I don't want any persistent data there. It's also not uncommon to structure things so that JavaScript files are in a subdirectory of the main /www or /var/www "web root" directory.

Does that make sense?

I totally agree with you about adding a Buildroot-wide configuration item for this, and probably also a similar configuration item to allow for a custom css install path.