mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00: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:
1 parent
149ed0e81c
commit
b373e199a8
7 files changed
+44
-23
No files matched your search
@@ -6,6 +6,13 @@
|
|||||||
- Make finit.h daemon internal, only
|
- Make finit.h daemon internal, only
|
||||||
- Move defines of FIFO, conf and rcS.d to Makefile => correct paths
|
- Move defines of FIFO, conf and rcS.d to Makefile => correct paths
|
||||||
- Add support for installing required headers in system include dir
|
- 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)
|
1.2 (20120927)
|
||||||
- Fix installation paths encoded in finit binary
|
- Fix installation paths encoded in finit binary
|
||||||
|
|||||||
@@ -34,21 +34,21 @@ EXEC = finit
|
|||||||
PKG = $(EXEC)-$(VERSION)
|
PKG = $(EXEC)-$(VERSION)
|
||||||
ARCHIVE = $(PKG).tar.xz
|
ARCHIVE = $(PKG).tar.xz
|
||||||
HEADERS = plugin.h svc.h helpers.h
|
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 = finit.o conf.o helpers.o sig.o svc.o plugin.o
|
||||||
OBJS += strlcpy.o
|
OBJS += strlcpy.o
|
||||||
SRCS = $(OBJS:.o=.c)
|
SRCS = $(OBJS:.o=.c)
|
||||||
DEPS = $(addprefix .,$(SRCS:.c=.d))
|
DEPS = $(addprefix .,$(SRCS:.c=.d))
|
||||||
|
|
||||||
# Installation paths, always prepended with DESTDIR if set
|
# Installation paths, always prepended with DESTDIR if set
|
||||||
prefix ?= /usr/local
|
prefix ?= /usr
|
||||||
sysconfdir ?= /etc
|
sysconfdir ?= /etc
|
||||||
|
sbindir ?= /sbin
|
||||||
|
plugindir ?= /lib/finit/plugins
|
||||||
incdir = $(prefix)/include/finit
|
incdir = $(prefix)/include/finit
|
||||||
sbindir = $(prefix)/sbin
|
|
||||||
datadir = $(prefix)/share/doc/finit
|
datadir = $(prefix)/share/doc/finit
|
||||||
mandir = $(prefix)/share/man/man8
|
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
|
# The initctl FIFO, should probably be in /run, not /dev
|
||||||
FINIT_FIFO ?= /dev/initctl
|
FINIT_FIFO ?= /dev/initctl
|
||||||
FINIT_CONF ?= $(sysconfdir)/finit.conf
|
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 += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE
|
||||||
CPPFLAGS += -DVERSION=\"$(VERSION)\" -DWHOAMI=\"`whoami`@`hostname`\"
|
CPPFLAGS += -DVERSION=\"$(VERSION)\" -DWHOAMI=\"`whoami`@`hostname`\"
|
||||||
CPPFLAGS += -DFINIT_FIFO=\"$(FINIT_FIFO)\" -DFINIT_CONF=\"$(FINIT_CONF)\"
|
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
|
LDFLAGS += -rdynamic
|
||||||
LDLIBS += -ldl
|
LDLIBS += -ldl
|
||||||
|
|
||||||
include common.mk
|
include common.mk
|
||||||
export PLUGIN_DIR ROOTDIR CPPFLAGS
|
export plugindir ROOTDIR CPPFLAGS
|
||||||
|
|
||||||
all: Makefile $(EXEC)
|
all: Makefile $(EXEC)
|
||||||
$(MAKE) -C plugins $@
|
$(MAKE) -C plugins $@
|
||||||
@@ -74,26 +74,28 @@ $(OBJS): Makefile
|
|||||||
|
|
||||||
$(EXEC): $(OBJS)
|
$(EXEC): $(OBJS)
|
||||||
|
|
||||||
# @ln -sf /sbin/finit /sbin/init
|
|
||||||
install-exec: all
|
install-exec: all
|
||||||
@install -d $(DESTDIR)$(prefix)/sbin
|
@$(INSTALL) -d $(DESTDIR)$(sysconfdir)
|
||||||
@install -d $(DESTDIR)$(sysconfdir)
|
@$(INSTALL) -d $(DESTDIR)$(sbindir)
|
||||||
@install -d $(DESTDIR)$(sbindir)
|
|
||||||
@for file in $(EXEC); do \
|
@for file in $(EXEC); do \
|
||||||
printf " INSTALL $(DESTDIR)$(sbindir)/$$file\n"; \
|
printf " INSTALL $(DESTDIR)$(sbindir)/$$file\n"; \
|
||||||
install -m 0755 $$file $(DESTDIR)$(sbindir)/$$file; \
|
$(STRIPINST) $$file $(DESTDIR)$(sbindir)/$$file; \
|
||||||
done
|
done
|
||||||
$(MAKE) -C plugins all
|
$(MAKE) -C plugins install
|
||||||
|
|
||||||
install-data:
|
install-data:
|
||||||
@install -d $(DESTDIR)$(datadir)
|
@$(INSTALL) -d $(DESTDIR)$(datadir)
|
||||||
@install -d $(DESTDIR)$(mandir)
|
@$(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-dev:
|
||||||
@install -d $(DESTDIR)$(incdir)
|
@$(INSTALL) -d $(DESTDIR)$(incdir)
|
||||||
@for file in $(HEADERS); do \
|
@for file in $(HEADERS); do \
|
||||||
printf " INSTALL $(DESTDIR)$(incdir)/$$file\n"; \
|
printf " INSTALL $(DESTDIR)$(incdir)/$$file\n"; \
|
||||||
install -m 0644 $$file $(DESTDIR)$(incdir)/$$file; \
|
$(INSTALL) -m 0644 $$file $(DESTDIR)$(incdir)/$$file; \
|
||||||
done
|
done
|
||||||
|
|
||||||
install: install-exec install-data install-dev
|
install: install-exec install-data install-dev
|
||||||
@@ -103,15 +105,24 @@ uninstall-exec:
|
|||||||
printf " REMOVE $(DESTDIR)$(sbindir)/$$file\n"; \
|
printf " REMOVE $(DESTDIR)$(sbindir)/$$file\n"; \
|
||||||
rm $(DESTDIR)$(sbindir)/$$file 2>/dev/null; \
|
rm $(DESTDIR)$(sbindir)/$$file 2>/dev/null; \
|
||||||
done
|
done
|
||||||
|
-@rmdir $(DESTDIR)$(sbindir) 2>/dev/null
|
||||||
|
-@rmdir $(DESTDIR)$(sysconfdir) 2>/dev/null
|
||||||
$(MAKE) -C plugins uninstall
|
$(MAKE) -C plugins uninstall
|
||||||
|
|
||||||
uninstall-data:
|
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:
|
uninstall-dev:
|
||||||
-@for file in $(HEADERS); do \
|
-@for file in $(HEADERS); do \
|
||||||
printf " REMOVE $(DESTDIR)$(incdir)/$$file\n"; \
|
printf " REMOVE $(DESTDIR)$(incdir)/$$file\n"; \
|
||||||
rm $(DESTDIR)$(incdir)/$$file 2>/dev/null; \
|
rm $(DESTDIR)$(incdir)/$$file 2>/dev/null; \
|
||||||
done
|
done
|
||||||
|
-@rmdir $(DESTDIR)$(incdir)
|
||||||
|
|
||||||
uninstall: uninstall-exec uninstall-data uninstall-dev
|
uninstall: uninstall-exec uninstall-data uninstall-dev
|
||||||
|
|
||||||
|
|||||||
@@ -3,3 +3,4 @@
|
|||||||
* Look at how to support a standard SysV init runlevel mechanism
|
* 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.
|
* 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
|
* 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.
|
# 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.*
|
JUNK = *~ *.bak *.aux *.dvi *.idx *.ind *.log *.ps *.map .*.d DEADJOE semantic.cache *.gdb *.elf core core.*
|
||||||
MAKE := @$(MAKE)
|
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.
|
# Smart autodependecy generation via GCC -M.
|
||||||
.%.d: %.c
|
.%.d: %.c
|
||||||
|
|||||||
File renamed without changes.
+6
-6
@@ -17,18 +17,18 @@ distclean: clean
|
|||||||
-@$(RM) $(JUNK) $(DEPS)
|
-@$(RM) $(JUNK) $(DEPS)
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
@install -d $(DESTDIR)$(prefix)$(PLUGIN_DIR)
|
@install -d $(DESTDIR)$(plugindir)
|
||||||
@for plugin in $(PLUGINS); do \
|
@for plugin in $(PLUGINS); do \
|
||||||
echo " INSTALL $(DESTDIR)$(prefix)$(PLUGIN_DIR)/$$plugin"; \
|
echo " INSTALL $(DESTDIR)$(plugindir)/$$plugin"; \
|
||||||
cp $$plugin $(DESTDIR)$(prefix)$(PLUGIN_DIR); \
|
$(STRIPINST) $$plugin $(DESTDIR)$(plugindir)/$$plugin; \
|
||||||
done
|
done
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
-@for plugin in $(PLUGINS); do \
|
-@for plugin in $(PLUGINS); do \
|
||||||
echo " RM $(PLUGIN_DIR)/$$plugin"; \
|
echo " RM $(DESTDIR)$(plugindir)/$$plugin"; \
|
||||||
rm $(DESTDIR)$(prefix)$(PLUGIN_DIR)/$$plugin 2>/dev/null; \
|
rm $(DESTDIR)$(plugindir)/$$plugin 2>/dev/null; \
|
||||||
done
|
done
|
||||||
-@rmdir $(DESTDIR)$(prefix)$(PLUGIN_DIR) 2>/dev/null
|
-@rmdir $(DESTDIR)$(plugindir) 2>/dev/null
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
|||||||
File renamed without changes.
Reference in new issue
Block a user