summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-08-28 11:53:01 +0200
committerDaniel Friesel <derf@finalrewind.org>2016-08-28 11:53:01 +0200
commitd176368fff6c3083378fb1d727cc6f35a15fabd3 (patch)
treee9495df89fc1bb8054572b87b05a5bda01834e4c
parent141e3a8d45e140f9b2b1ea83cfcae13764e203cb (diff)
Only install icons to /usr/share when running make install app=1
-rw-r--r--Makefile2
-rw-r--r--README28
-rw-r--r--config.mk21
3 files changed, 40 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 900fcb0..258461e 100644
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,7 @@ install-icon:
@echo installing icon to ${scalable_icon_dir}
@mkdir -p ${scalable_icon_dir}
@cp share/images/feh.svg ${scalable_icon_dir}
- @if which gtk-update-icon-cache > /dev/null 2>&1; then \
+ @if test "${app}" = 1 && which gtk-update-icon-cache > /dev/null 2>&1; then \
gtk-update-icon-cache ${icon_dir}; \
fi
diff --git a/README b/README
index 9a2b59a..61fdd4d 100644
--- a/README
+++ b/README
@@ -28,20 +28,38 @@ Recommended
Installation
------------
+For end users:
+
+$ make
+$ sudo make install app=1
+
+For package maintainers and users who do not want feh to install its
+icons into /usr/share:
+
$ make
$ sudo make install
+Explanation: feh ships some icons and an X11 desktop entry, which allow it to
+be used from file managers, desktop menus and similar. However, installing
+icons to /usr/local/share/... does not seem to work reliable in all cases.
+Because of this, when using "make install app=1", feh will install its icons
+to /usr/share/..., even though they technically belong into /usr/local.
+
ZSH Completion for feh is available at
<http://git.finalrewind.org/zsh/plain/etc/completions/_feh>
Make flags
----------
-Use "make flag=bool", e.g. "make xinerama=0 debug=1" to disable Xinerama
-support and get a debug build.
+Flags can be used to control the build and installation process, e.g. via "make
+flag=bool", "make install flag=bool", or "export flag=bool; make && make
+install". For example, "make xinerama=0 debug=1" will disable Xinerama support
+and produce a debug build.
Available flags are:
+ * app (default 0) - install icons to /usr/share, regardless of DESTDIR
+ and PREFIX, and call gtk-update-icon-cache afterwards
* cam (default 0) - install deprecated feh-cam und gen-cam-menu scripts
* curl (default 1) - use libcurl to view http:// and similar images
* debug (default 0) - debug build, enables --debug
@@ -52,6 +70,12 @@ Available flags are:
So, by default libcurl and Xinerama are enabled, the rest is disabled.
+Additionally, the standard variables PREFIX and DESTDIR are supported.
+PREFIX (default /usr) controls where the application and its data files
+will be installed. It must be set both during "make" and "make install".
+DESTDIR (default empty) sets the installation root during "make install". It
+is mostly useful for package maintainers.
+
Note: config.mk is designed so that in most cases, you can set environment
variables instead of editing it. E.g.:
CFLAGS='-g -Os' make
diff --git a/config.mk b/config.mk
index c553a47..93bb1c3 100644
--- a/config.mk
+++ b/config.mk
@@ -1,9 +1,21 @@
PACKAGE ?= feh
VERSION ?= ${shell git describe --dirty}
+app ?= 0
+cam ?= 0
+curl ?= 1
+debug ?= 0
+help ?= 0
+xinerama ?= 1
+exif ?= 0
+
# Prefix for all installed files
PREFIX ?= /usr/local
-ICON_PREFIX ?= /usr/share/icons
+ICON_PREFIX ?= ${DESTDIR}${PREFIX}/share/icons
+
+ifeq (${app},1)
+ ICON_PREFIX = /usr/share/icons
+endif
# Directories for manuals, executables, docs, data, etc.
main_dir = ${DESTDIR}${PREFIX}
@@ -22,13 +34,6 @@ scalable_icon_dir = ${icon_dir}/scalable/apps
CFLAGS ?= -g -O2
CFLAGS += -Wall -Wextra -pedantic
-cam ?= 0
-curl ?= 1
-debug ?= 0
-help ?= 0
-xinerama ?= 1
-exif ?= 0
-
ifeq (${curl},1)
CFLAGS += -DHAVE_LIBCURL
LDLIBS += -lcurl