mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Install fixes, $prefix supported better, strip binaries and .so files
- Makefile fixes for installation, paths encoded wrong - Strip binaries + .so files, support for $(CROSS) toolchain strip - Default install is now to /sbin/finit and /usr/ - Use the 'plugindir' environemnt variable instead of 'PLUGIN_DIR' Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -6,6 +6,13 @@
|
||||
- Make finit.h daemon internal, only
|
||||
- Move defines of FIFO, conf and rcS.d to Makefile => correct paths
|
||||
- Add support for installing required headers in system include dir
|
||||
- Better support for distributions and packagers with install-exec,
|
||||
install-data, and install-dev targets in Makefile. Useful if you
|
||||
want to call targets with different $DESTDIR!
|
||||
- Makefile fixes for installation, paths encoded wrong
|
||||
- Strip binaries + .so files, support for $(CROSS) toolchain strip
|
||||
- Default install is now to /sbin/finit and /usr/
|
||||
- Note change in $PLUGIN_DIR environemnt variable to $plugindir
|
||||
|
||||
1.2 (20120927)
|
||||
- Fix installation paths encoded in finit binary
|
||||
|
||||
@@ -34,21 +34,21 @@ EXEC = finit
|
||||
PKG = $(EXEC)-$(VERSION)
|
||||
ARCHIVE = $(PKG).tar.xz
|
||||
HEADERS = plugin.h svc.h helpers.h
|
||||
DISTFILES = LICENSE README ChangeLog finit.conf services
|
||||
OBJS = finit.o conf.o helpers.o sig.o svc.o plugin.o
|
||||
OBJS += strlcpy.o
|
||||
SRCS = $(OBJS:.o=.c)
|
||||
DEPS = $(addprefix .,$(SRCS:.c=.d))
|
||||
|
||||
# Installation paths, always prepended with DESTDIR if set
|
||||
prefix ?= /usr/local
|
||||
prefix ?= /usr
|
||||
sysconfdir ?= /etc
|
||||
sbindir ?= /sbin
|
||||
plugindir ?= /lib/finit/plugins
|
||||
incdir = $(prefix)/include/finit
|
||||
sbindir = $(prefix)/sbin
|
||||
datadir = $(prefix)/share/doc/finit
|
||||
mandir = $(prefix)/share/man/man8
|
||||
|
||||
# Plugin directory, fall back to this directory if unset in environment
|
||||
PLUGIN_DIR ?= $(prefix)/lib/finit/plugins
|
||||
# The initctl FIFO, should probably be in /run, not /dev
|
||||
FINIT_FIFO ?= /dev/initctl
|
||||
FINIT_CONF ?= $(sysconfdir)/finit.conf
|
||||
@@ -60,12 +60,12 @@ CPPFLAGS += -U_FORTIFY_SOURCE
|
||||
CPPFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE
|
||||
CPPFLAGS += -DVERSION=\"$(VERSION)\" -DWHOAMI=\"`whoami`@`hostname`\"
|
||||
CPPFLAGS += -DFINIT_FIFO=\"$(FINIT_FIFO)\" -DFINIT_CONF=\"$(FINIT_CONF)\"
|
||||
CPPFLAGS += -DFINIT_RCSD=\"$(FINIT_RCSD)\" -DPLUGIN_PATH=\"$(PLUGIN_DIR)\"
|
||||
CPPFLAGS += -DFINIT_RCSD=\"$(FINIT_RCSD)\" -DPLUGIN_PATH=\"$(plugindir)\"
|
||||
LDFLAGS += -rdynamic
|
||||
LDLIBS += -ldl
|
||||
|
||||
include common.mk
|
||||
export PLUGIN_DIR ROOTDIR CPPFLAGS
|
||||
export plugindir ROOTDIR CPPFLAGS
|
||||
|
||||
all: Makefile $(EXEC)
|
||||
$(MAKE) -C plugins $@
|
||||
@@ -74,26 +74,28 @@ $(OBJS): Makefile
|
||||
|
||||
$(EXEC): $(OBJS)
|
||||
|
||||
# @ln -sf /sbin/finit /sbin/init
|
||||
install-exec: all
|
||||
@install -d $(DESTDIR)$(prefix)/sbin
|
||||
@install -d $(DESTDIR)$(sysconfdir)
|
||||
@install -d $(DESTDIR)$(sbindir)
|
||||
@$(INSTALL) -d $(DESTDIR)$(sysconfdir)
|
||||
@$(INSTALL) -d $(DESTDIR)$(sbindir)
|
||||
@for file in $(EXEC); do \
|
||||
printf " INSTALL $(DESTDIR)$(sbindir)/$$file\n"; \
|
||||
install -m 0755 $$file $(DESTDIR)$(sbindir)/$$file; \
|
||||
$(STRIPINST) $$file $(DESTDIR)$(sbindir)/$$file; \
|
||||
done
|
||||
$(MAKE) -C plugins all
|
||||
$(MAKE) -C plugins install
|
||||
|
||||
install-data:
|
||||
@install -d $(DESTDIR)$(datadir)
|
||||
@install -d $(DESTDIR)$(mandir)
|
||||
@$(INSTALL) -d $(DESTDIR)$(datadir)
|
||||
@$(INSTALL) -d $(DESTDIR)$(mandir)
|
||||
@for file in $(DISTFILES); do \
|
||||
printf " INSTALL $(DESTDIR)$(datadir)/$$file\n"; \
|
||||
$(INSTALL) -m 0644 $$file $(DESTDIR)$(datadir)/$$file; \
|
||||
done
|
||||
|
||||
install-dev:
|
||||
@install -d $(DESTDIR)$(incdir)
|
||||
@$(INSTALL) -d $(DESTDIR)$(incdir)
|
||||
@for file in $(HEADERS); do \
|
||||
printf " INSTALL $(DESTDIR)$(incdir)/$$file\n"; \
|
||||
install -m 0644 $$file $(DESTDIR)$(incdir)/$$file; \
|
||||
$(INSTALL) -m 0644 $$file $(DESTDIR)$(incdir)/$$file; \
|
||||
done
|
||||
|
||||
install: install-exec install-data install-dev
|
||||
@@ -103,15 +105,24 @@ uninstall-exec:
|
||||
printf " REMOVE $(DESTDIR)$(sbindir)/$$file\n"; \
|
||||
rm $(DESTDIR)$(sbindir)/$$file 2>/dev/null; \
|
||||
done
|
||||
-@rmdir $(DESTDIR)$(sbindir) 2>/dev/null
|
||||
-@rmdir $(DESTDIR)$(sysconfdir) 2>/dev/null
|
||||
$(MAKE) -C plugins uninstall
|
||||
|
||||
uninstall-data:
|
||||
@for file in $(DISTFILES); do \
|
||||
printf " REMOVE $(DESTDIR)$(datadir)/$$file\n"; \
|
||||
rm $(DESTDIR)$(datadir)/$$file 2>/dev/null; \
|
||||
done
|
||||
-@rmdir $(DESTDIR)$(mandir)
|
||||
-@rmdir $(DESTDIR)$(datadir)
|
||||
|
||||
uninstall-dev:
|
||||
-@for file in $(HEADERS); do \
|
||||
printf " REMOVE $(DESTDIR)$(incdir)/$$file\n"; \
|
||||
rm $(DESTDIR)$(incdir)/$$file 2>/dev/null; \
|
||||
done
|
||||
-@rmdir $(DESTDIR)$(incdir)
|
||||
|
||||
uninstall: uninstall-exec uninstall-data uninstall-dev
|
||||
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
* Look at how to support a standard SysV init runlevel mechanism
|
||||
* Arguments to finit, like to SysV init "init q" to reload finit.conf at runtime, etc.
|
||||
* Implement initctl stop|start|reload <SVC> and service <SVC> stop|start|reload on top
|
||||
* Write man pages for finit and finit.conf, steal from pimd man pages...
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# Some junk files we always want to be removed when doing a make clean.
|
||||
JUNK = *~ *.bak *.aux *.dvi *.idx *.ind *.log *.ps *.map .*.d DEADJOE semantic.cache *.gdb *.elf core core.*
|
||||
MAKE := @$(MAKE)
|
||||
MAKEFLAGS = --no-print-directory
|
||||
MAKEFLAGS = --no-print-directory --silent
|
||||
INSTALL := install -b
|
||||
STRIPINST := $(INSTALL) -s --strip-program=$(CROSS)strip -m 0755
|
||||
|
||||
# Smart autodependecy generation via GCC -M.
|
||||
.%.d: %.c
|
||||
|
||||
+6
-6
@@ -17,18 +17,18 @@ distclean: clean
|
||||
-@$(RM) $(JUNK) $(DEPS)
|
||||
|
||||
install: all
|
||||
@install -d $(DESTDIR)$(prefix)$(PLUGIN_DIR)
|
||||
@install -d $(DESTDIR)$(plugindir)
|
||||
@for plugin in $(PLUGINS); do \
|
||||
echo " INSTALL $(DESTDIR)$(prefix)$(PLUGIN_DIR)/$$plugin"; \
|
||||
cp $$plugin $(DESTDIR)$(prefix)$(PLUGIN_DIR); \
|
||||
echo " INSTALL $(DESTDIR)$(plugindir)/$$plugin"; \
|
||||
$(STRIPINST) $$plugin $(DESTDIR)$(plugindir)/$$plugin; \
|
||||
done
|
||||
|
||||
uninstall:
|
||||
-@for plugin in $(PLUGINS); do \
|
||||
echo " RM $(PLUGIN_DIR)/$$plugin"; \
|
||||
rm $(DESTDIR)$(prefix)$(PLUGIN_DIR)/$$plugin 2>/dev/null; \
|
||||
echo " RM $(DESTDIR)$(plugindir)/$$plugin"; \
|
||||
rm $(DESTDIR)$(plugindir)/$$plugin 2>/dev/null; \
|
||||
done
|
||||
-@rmdir $(DESTDIR)$(prefix)$(PLUGIN_DIR) 2>/dev/null
|
||||
-@rmdir $(DESTDIR)$(plugindir) 2>/dev/null
|
||||
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
-include $(DEPS)
|
||||
|
||||
Reference in New Issue
Block a user