diff options
author | Andrew Cady <d@jerkface.net> | 2018-12-23 12:31:44 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2018-12-23 12:31:44 -0500 |
commit | fa7cdc79a21bfac7da4ba591e9507d9b69d5f04a (patch) | |
tree | e0d44ca5b9f9df4da900ddab0e5c0feb490342dd | |
parent | 0c4ea701a4221bfd0baac8aa211e31e99e5b9ab1 (diff) |
fixes for non-root install
-rwxr-xr-x | Makefile | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -17,13 +17,18 @@ endif | |||
17 | endif | 17 | endif |
18 | endif | 18 | endif |
19 | 19 | ||
20 | ifneq (0,$(shell id -u)) | 20 | ifeq (0,$(shell id -u)) |
21 | optdir=/opt | ||
22 | bindir=/usr/local/bin | ||
23 | applications_dir=/usr/share/applications | ||
24 | alternatives=alternatives | ||
25 | else | ||
21 | optdir=$(HOME)/.local/opt | 26 | optdir=$(HOME)/.local/opt |
27 | bindir=$(HOME)/.local/bin | ||
22 | applications_dir=$(HOME)/.local/share/applications | 28 | applications_dir=$(HOME)/.local/share/applications |
29 | alternatives= | ||
30 | |||
23 | $(warning Warning: You are not root. Installing into $(optdir)) | 31 | $(warning Warning: You are not root. Installing into $(optdir)) |
24 | else | ||
25 | optdir=/opt | ||
26 | applications_dir=/usr/share/applications | ||
27 | endif | 32 | endif |
28 | 33 | ||
29 | os=linux64 | 34 | os=linux64 |
@@ -42,13 +47,13 @@ tempdir=$(destdir)~tmp | |||
42 | 47 | ||
43 | symlink=$(optdir)/firefox | 48 | symlink=$(optdir)/firefox |
44 | desktop_file=$(applications_dir)/firefox.desktop | 49 | desktop_file=$(applications_dir)/firefox.desktop |
45 | global_symlink=/usr/local/bin/firefox | 50 | global_symlink=$(bindir)/firefox |
46 | 51 | ||
47 | .DEFAULT_GOAL = install | 52 | .DEFAULT_GOAL = install |
48 | 53 | ||
49 | .PHONY: install $(desktop_file) $(global_symlink) alternatives beta nightly stable $(symlink) | 54 | .PHONY: install $(desktop_file) $(global_symlink) alternatives beta nightly stable $(symlink) |
50 | 55 | ||
51 | install: $(symlink) $(desktop_file) $(global_symlink) alternatives | 56 | install: $(symlink) $(desktop_file) $(global_symlink) $(alternatives) |
52 | 57 | ||
53 | $(global_symlink): | 58 | $(global_symlink): |
54 | mkdir -p $(dir $@) | 59 | mkdir -p $(dir $@) |