hasufell-repository/packages/dev-lang/elixir/files/0001-Allow-to-set-BINDIR-for-binaries-and-SHARE_PREFIX-fo.patch

61 lines
2.2 KiB
Diff
Raw Normal View History

From 5d0edf0d560f52c0fce2f8ce7e03c1aea4d1eb38 Mon Sep 17 00:00:00 2001
From: Julian Ospald <hasufell@posteo.de>
Date: Sat, 7 May 2016 02:56:33 +0200
Subject: [PATCH] Allow to set BINDIR for binaries and SHARE_PREFIX for
manpages
Upstream: no
---
Makefile | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 263ea63..3d61721 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
REBAR ?= "$(CURDIR)/rebar"
PREFIX ?= /usr/local
+SHARE_PREFIX ?= $(PREFIX)/share
DOCS := v1.2
CANONICAL := stable
ELIXIRC := bin/elixirc --verbose --ignore-module-conflict
@@ -8,6 +9,7 @@ ERL := erl -I lib/elixir/include -noshell -pa lib/elixir/ebin
VERSION := $(strip $(shell cat VERSION))
Q := @
LIBDIR := lib
+BINDIR := bin
INSTALL = install
INSTALL_DIR = $(INSTALL) -m755 -d
INSTALL_DATA = $(INSTALL) -m644
@@ -104,9 +106,9 @@ install: compile
done
$(Q) $(INSTALL_DIR) "$(DESTDIR)$(PREFIX)/$(LIBDIR)/elixir/bin"
$(Q) $(INSTALL_PROGRAM) $(filter-out %.ps1, $(filter-out %.bat, $(wildcard bin/*))) "$(DESTDIR)$(PREFIX)/$(LIBDIR)/elixir/bin"
- $(Q) $(INSTALL_DIR) "$(DESTDIR)$(PREFIX)/bin"
+ $(Q) $(INSTALL_DIR) "$(DESTDIR)$(PREFIX)/$(BINDIR)"
$(Q) for file in "$(DESTDIR)$(PREFIX)"/$(LIBDIR)/elixir/bin/* ; do \
- ln -sf "../$(LIBDIR)/elixir/bin/$${file##*/}" "$(DESTDIR)$(PREFIX)/bin/" ; \
+ ln -sf "../$(LIBDIR)/elixir/bin/$${file##*/}" "$(DESTDIR)$(PREFIX)/$(BINDIR)/" ; \
done
$(MAKE) install_man
@@ -254,9 +256,9 @@ clean_man:
rm -f man/iex.1
install_man: build_man
- $(Q) mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
- $(Q) $(INSTALL_DATA) man/elixir.1 $(DESTDIR)$(PREFIX)/share/man/man1
- $(Q) $(INSTALL_DATA) man/elixirc.1 $(DESTDIR)$(PREFIX)/share/man/man1
- $(Q) $(INSTALL_DATA) man/iex.1 $(DESTDIR)$(PREFIX)/share/man/man1
- $(Q) $(INSTALL_DATA) man/mix.1 $(DESTDIR)$(PREFIX)/share/man/man1
+ $(Q) mkdir -p $(DESTDIR)$(SHARE_PREFIX)/man/man1
+ $(Q) $(INSTALL_DATA) man/elixir.1 $(DESTDIR)$(SHARE_PREFIX)/man/man1
+ $(Q) $(INSTALL_DATA) man/elixirc.1 $(DESTDIR)$(SHARE_PREFIX)/man/man1
+ $(Q) $(INSTALL_DATA) man/iex.1 $(DESTDIR)$(SHARE_PREFIX)/man/man1
+ $(Q) $(INSTALL_DATA) man/mix.1 $(DESTDIR)$(SHARE_PREFIX)/man/man1
$(MAKE) clean_man
--
2.8.1