diff --git a/Changelog b/ChangeLog similarity index 94% rename from Changelog rename to ChangeLog index b2f00ca2..fe21f802 100644 --- a/Changelog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1.2 (20120927) + - Fix installation paths encoded in finit binary + - Update README with section on building and enviroment variables + 1.1 (20120927) - Build fixes for ARM eabi/uClibc - Rename signal.[ch]-->sig.[ch] to avoid name clash w/ system headers diff --git a/Makefile b/Makefile index 21314ed5..a1c389a8 100644 --- a/Makefile +++ b/Makefile @@ -25,11 +25,18 @@ # Top directory for building complete system, fall back to this directory ROOTDIR ?= $(shell pwd) + +# Installation paths, always prepended with DESTDIR if set +prefix ?= /usr/local +sysconfdir ?= /etc +datadir = $(prefix)/share/doc/finit +mandir = $(prefix)/share/man/man8 + # Plugin directory, fall back to this directory if unset in environment -PLUGIN_DIR ?= /lib/finit/plugins +PLUGIN_DIR ?= $(prefix)/lib/finit/plugins #VERSION ?= $(shell git tag -l | tail -1) -VERSION ?= 1.1 +VERSION ?= 1.2 EXEC = finit PKG = $(EXEC)-$(VERSION) ARCHIVE = $(PKG).tar.xz @@ -46,11 +53,6 @@ CPPFLAGS += -DPLUGIN_PATH=\"$(PLUGIN_DIR)\" LDFLAGS += -rdynamic LDLIBS += -ldl -prefix ?= /usr/local -sysconfdir ?= /etc -datadir = $(prefix)/share/doc/finit -mandir = $(prefix)/share/man/man8 - include common.mk export PLUGIN_DIR ROOTDIR CPPFLAGS diff --git a/README.rst b/README.rst index 4481d054..511d897a 100644 --- a/README.rst +++ b/README.rst @@ -66,6 +66,84 @@ Finit handles SIGUSR1 and SIGUSR2 for reboot and halt, and listens to /dev/initctl so standard Linux reboot and halt commands should also work. +Building +-------- + +The finit build system does not employ the GNU Configure and Build System, +instead standard makefiles are used. The user is encouraged to make source +code changes, using defines and conditionally building plugins instead to +alter the behavior of finit. + +The following environment variables are checked by the makefiles and control +what is built and where resulting binaries are installed. + +**ROOTDIR=** + Top directory for building complete system, used in pretty printing + +**PLUGINS=** + List of stock finit plugins to build and install. + +**PLUGIN_DIR=** + Absolute path to where finit should look for dynamically loadable plugins + at runtime. At installation prepended by ''DESTDIR'' and ''prefix''- + +**VERSION=** + Defaults to the currently released version of finit, e.g., 1.2 but can + be overridden by packages to add a suffix or completely alter the version. + +**CFLAGS=** + Standard CFLAGS are inherited from the build enviornmant. + +**CPPFLAGS=** + Standard CPPFLAGS are inherited from the build enviornmant. + +**LDFLAGS=** + Standard LDFLAGS are inherited from the build enviornmant. + +**LDLIBS=** + Standard LIBLIBS are inherited from the build enviornmant. + +**prefix=** + Path to where resulting binaries should install to. Used in concert + with the ''DESTDIR'' variable. Defaults to /usr/local + +**sysconfdir=** + Used after ''prefix'' to create the path to finit.conf configuration + file. Defaults to /etc + +**DESTDIR=** + Used by packagers and distributions when building a relocatable + bundle of files. Alwawys prepended to the ''prefix'' destination + directory. + +**Example**:: + + $ tar xfJ finit-1.2.tar.xz + $ PLUGINS="initctl.so hwclock.so" prefix= DESTDIR=/tmp/finit/dst \ + make -C finit-1.2/ clean install + make: Entering directory `/home/troglobit/finit-1.2' + CC finit.o + CC conf.o + CC helpers.o + CC sig.o + CC svc.o + CC plugin.o + CC strlcpy.o + LINK finit + CC plugins/initctl.o + PLUGIN plugins/initctl.so + CC plugins/hwclock.o + PLUGIN plugins/hwclock.so + INSTALL /tmp/finit/dst/sbin/finit + INSTALL /tmp/finit/dst/lib/finit/plugins/initctl.so + INSTALL /tmp/finit/dst/lib/finit/plugins/hwclock.so + make: Leaving directory `/home/troglobit/finit-1.2' + +In this example the finit-1.2.tar.xz archive is unpacked to the user's +home directory, built and installed to a temporary staging directory. +The enviroment variables ''prefix'', ''DESTDIR'' and ''PLUGINS'' are all +changed to suit this particular build. + Debugging --------- diff --git a/plugins/Makefile b/plugins/Makefile index cf03d2ef..e6216b92 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -2,7 +2,7 @@ CFLAGS = -fPIC -g -Os CPPFLAGS += -I.. LDFLAGS = -shared -PLUGINS = initctl.so alsa-utils.so bootmisc.so dbus.so hwclock.so \ +PLUGINS ?= initctl.so alsa-utils.so bootmisc.so dbus.so hwclock.so \ resolvconf.so urandom.so x11-common.so DEPS = $(addprefix .,$(PLUGINS:.so=.d))