Hi, I'm the maintainer of GSRC (GNU Source Release Collection), which uses Makefile trickery to install GNU software from source, usually to a non-standard location (i.e. /gnu or ~/gnu instead of /usr).
I've attached a patch for the LibreJS Makefile to better support installing to non-standard locations through the addition of the DESTDIR, prefix and libdir variables. It also replaces the calls to mkdir with install -d, for the odd occasion in which the user is installing the plugin when the $(libdir)/mozilla directory doesn't exist due to the user not having a Mozilla-based browser installed yet. I've tested this against the just-released librejs 4.9, but since it's not really interfering with the code, I can't imagine that it will fail on the latest repo trunk. Nevertheless, if you would prefer that I patch against that, let me know. Cheers, Brandon Invergo ps - I'm not subscribed to the list so please CC me in your response pps - Thanks for this great plugin!
diff -x config.log -x config.status -ru librejs-4.9/Makefile work/librejs-4.9/Makefile --- librejs-4.9/Makefile 2012-11-01 04:07:38.000000000 +0000 +++ librejs-4.9/Makefile 2012-11-01 10:46:44.837509858 +0000 @@ -15,7 +15,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. - +DESTDIR = +prefix = $(DESTDIR)/usr/ +libdir = $(prefix)/lib all: cfx xpi @@ -25,30 +27,30 @@ doinstall: @echo "Creating Mozilla directories for system-wide add-ons and extensions"; - if test ! -d "/usr/lib/mozilla"; then \ + if test ! -d "$(libdir)/mozilla"; then \ echo "Creating Mozilla directory"; \ - mkdir "/usr/lib/mozilla";\ + install -d "$(libdir)/mozilla";\ fi; - if test ! -d "/usr/lib/mozilla/extensions"; then \ + if test ! -d "$(libdir)/mozilla/extensions"; then \ echo "Creating extensions directory"; \ - mkdir "/usr/lib/mozilla/extensions";\ + install -d "$(libdir)/mozilla/extensions";\ fi; - if test ! -d "/usr/lib/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; then \ + if test ! -d "$(libdir)/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; then \ echo "Creating Mozilla-browser uuid directory"; \ - mkdir "/usr/lib/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; \ + install -d "$(libdir)/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; \ fi; @echo "Installing LibreJS"; - cp librejs.xpi "/usr/lib/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/[email protected]"; + cp librejs.xpi "$(libdir)/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/[email protected]"; @echo "Depending on your version of the Mozilla-browser, if LibreJS is not enabled already, you may, inside your Mozilla-browser, need to go in the menu in Tools > Add-ons and click enable where you see LibreJS."; uninstall: - rm "/usr/lib/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/[email protected]"; + rm "$(libdir)/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/[email protected]"; clean: rm "librejs.xpi";
