diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2022-04-06 10:51:55 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2022-04-06 10:51:55 -0500 |
commit | 391d12db48754861b5cecac92ee3321597ee02c1 (patch) | |
tree | b42fad5a31ca342de7b7ecf1fb78784194c1400c | |
parent | 0efc1b133e4182bd53cde78153bd8b5cc2e99448 (diff) |
migrate fully to meson build system
- drop old build system
- move shared include and source files to common directory
- drop "rc-" prefix from shared include and source files
- move executable-specific code to individual directories under src
- adjust top-level .gitignore file for new build system
This closes #489.
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | Makefile | 55 | ||||
-rw-r--r-- | Makefile.inc | 3 | ||||
-rw-r--r-- | NEWS.md | 4 | ||||
-rw-r--r-- | README.md | 58 | ||||
-rw-r--r-- | bash-completion/Makefile | 11 | ||||
-rw-r--r-- | conf.d/Makefile | 20 | ||||
-rw-r--r-- | etc/.gitignore | 2 | ||||
-rw-r--r-- | etc/Makefile | 23 | ||||
-rw-r--r-- | init.d/.gitignore | 51 | ||||
-rw-r--r-- | init.d/Makefile | 37 | ||||
-rw-r--r-- | local.d/Makefile | 6 | ||||
-rw-r--r-- | man/Makefile | 45 | ||||
-rw-r--r-- | meson.build | 3 | ||||
-rw-r--r-- | mk/cc.mk | 44 | ||||
-rw-r--r-- | mk/debug.mk | 23 | ||||
-rw-r--r-- | mk/depend.mk | 21 | ||||
-rw-r--r-- | mk/dist.mk | 50 | ||||
-rw-r--r-- | mk/gitignore.mk | 22 | ||||
-rw-r--r-- | mk/gitver.mk | 8 | ||||
-rw-r--r-- | mk/lib.mk | 77 | ||||
-rw-r--r-- | mk/net.mk | 1 | ||||
-rw-r--r-- | mk/os-BSD.mk | 16 | ||||
-rw-r--r-- | mk/os-DragonFly.mk | 13 | ||||
-rw-r--r-- | mk/os-FreeBSD.mk | 15 | ||||
-rw-r--r-- | mk/os-GNU-kFreeBSD.mk | 18 | ||||
-rw-r--r-- | mk/os-GNU.mk | 15 | ||||
-rw-r--r-- | mk/os-Linux.mk | 40 | ||||
-rw-r--r-- | mk/os-NetBSD.mk | 14 | ||||
-rw-r--r-- | mk/os-prefix.mk | 8 | ||||
-rw-r--r-- | mk/os.mk | 19 | ||||
-rw-r--r-- | mk/pam.mk | 16 | ||||
-rw-r--r-- | mk/prog.mk | 48 | ||||
-rw-r--r-- | mk/scripts.mk | 64 | ||||
-rw-r--r-- | mk/subdir.mk | 38 | ||||
-rw-r--r-- | mk/sys.mk | 71 | ||||
-rw-r--r-- | mk/termcap.mk | 17 | ||||
-rw-r--r-- | pkgconfig/.gitignore | 2 | ||||
-rw-r--r-- | pkgconfig/Makefile | 12 | ||||
-rw-r--r-- | runlevels/Makefile | 102 | ||||
-rw-r--r-- | scripts/.gitignore | 5 | ||||
-rw-r--r-- | scripts/Makefile | 30 | ||||
-rw-r--r-- | scripts/meson.build | 45 | ||||
-rwxr-xr-x | scripts/meson_script_links.sh | 19 | ||||
-rw-r--r-- | sh/.gitignore | 7 | ||||
-rw-r--r-- | sh/Makefile | 33 | ||||
-rw-r--r-- | src/Makefile | 7 | ||||
-rw-r--r-- | src/checkpath/checkpath.c (renamed from src/rc/checkpath.c) | 4 | ||||
-rw-r--r-- | src/checkpath/meson.build | 9 | ||||
-rw-r--r-- | src/common/meson.build | 6 | ||||
-rw-r--r-- | src/einfo/einfo.c (renamed from src/rc/do_e.c) | 0 | ||||
-rw-r--r-- | src/einfo/meson.build | 32 | ||||
-rw-r--r-- | src/fstabinfo/fstabinfo.c (renamed from src/rc/fstabinfo.c) | 2 | ||||
-rw-r--r-- | src/fstabinfo/meson.build | 7 | ||||
-rw-r--r-- | src/halt/halt.in (renamed from scripts/halt.in) | 0 | ||||
-rw-r--r-- | src/halt/meson.build | 7 | ||||
-rw-r--r-- | src/is_newer_than/is_newer_than.c (renamed from src/rc/is_newer_than.c) | 2 | ||||
-rw-r--r-- | src/is_newer_than/meson.build | 6 | ||||
-rw-r--r-- | src/is_older_than/is_older_than.c (renamed from src/rc/is_older_than.c) | 2 | ||||
-rw-r--r-- | src/is_older_than/meson.build | 6 | ||||
-rw-r--r-- | src/kill_all/kill_all.c (renamed from src/rc/kill_all.c) | 2 | ||||
-rw-r--r-- | src/kill_all/meson.build | 9 | ||||
-rw-r--r-- | src/libeinfo/.gitignore | 1 | ||||
-rw-r--r-- | src/libeinfo/Makefile | 12 | ||||
-rw-r--r-- | src/librc/.gitignore | 2 | ||||
-rw-r--r-- | src/librc/Makefile | 48 | ||||
-rw-r--r-- | src/librc/librc.h | 2 | ||||
-rw-r--r-- | src/mark_service/mark_service.c (renamed from src/rc/do_mark_service.c) | 2 | ||||
-rw-r--r-- | src/mark_service/meson.build | 20 | ||||
-rw-r--r-- | src/meson.build | 36 | ||||
-rw-r--r-- | src/mountinfo/meson.build | 7 | ||||
-rw-r--r-- | src/mountinfo/mountinfo.c (renamed from src/rc/mountinfo.c) | 2 | ||||
-rw-r--r-- | src/on_ac_power/meson.build | 3 | ||||
-rw-r--r--[-rwxr-xr-x] | src/on_ac_power/on_ac_power (renamed from scripts/on_ac_power) | 0 | ||||
-rw-r--r-- | src/openrc-init/meson.build | 10 | ||||
-rw-r--r-- | src/openrc-init/openrc-init.c (renamed from src/rc/openrc-init.c) | 4 | ||||
-rw-r--r-- | src/openrc-run/meson.build | 17 | ||||
-rw-r--r-- | src/openrc-run/openrc-run.c (renamed from src/rc/openrc-run.c) | 6 | ||||
-rw-r--r-- | src/openrc-shutdown/broadcast.c (renamed from src/rc/broadcast.c) | 0 | ||||
-rw-r--r-- | src/openrc-shutdown/broadcast.h (renamed from src/rc/broadcast.h) | 0 | ||||
-rw-r--r-- | src/openrc-shutdown/meson.build | 10 | ||||
-rw-r--r-- | src/openrc-shutdown/openrc-shutdown.c (renamed from src/rc/openrc-shutdown.c) | 4 | ||||
-rw-r--r-- | src/openrc-shutdown/rc-sysvinit.c (renamed from src/rc/rc-sysvinit.c) | 0 | ||||
-rw-r--r-- | src/openrc-shutdown/rc-sysvinit.h (renamed from src/rc/rc-sysvinit.h) | 0 | ||||
-rw-r--r-- | src/openrc/meson.build | 17 | ||||
-rw-r--r-- | src/openrc/rc-logger.c (renamed from src/rc/rc-logger.c) | 2 | ||||
-rw-r--r-- | src/openrc/rc-logger.h (renamed from src/rc/rc-logger.h) | 0 | ||||
-rw-r--r-- | src/openrc/rc.c (renamed from src/rc/rc.c) | 4 | ||||
-rw-r--r-- | src/poweroff/meson.build | 7 | ||||
-rw-r--r-- | src/poweroff/poweroff.in (renamed from scripts/poweroff.in) | 0 | ||||
-rw-r--r-- | src/rc-abort/meson.build | 6 | ||||
-rw-r--r-- | src/rc-abort/rc-abort.c (renamed from src/rc/rc-abort.c) | 0 | ||||
-rw-r--r-- | src/rc-depend/meson.build | 7 | ||||
-rw-r--r-- | src/rc-depend/rc-depend.c (renamed from src/rc/rc-depend.c) | 2 | ||||
-rw-r--r-- | src/rc-service/meson.build | 7 | ||||
-rw-r--r-- | src/rc-service/rc-service.c (renamed from src/rc/rc-service.c) | 2 | ||||
-rw-r--r-- | src/rc-sstat/meson.build | 5 | ||||
-rw-r--r-- | src/rc-sstat/rc-sstat (renamed from scripts/rc-sstat.in) | 0 | ||||
-rw-r--r-- | src/rc-status/meson.build | 8 | ||||
-rw-r--r-- | src/rc-status/rc-status.c (renamed from src/rc/rc-status.c) | 2 | ||||
-rw-r--r-- | src/rc-update/meson.build | 7 | ||||
-rw-r--r-- | src/rc-update/rc-update.c (renamed from src/rc/rc-update.c) | 2 | ||||
-rw-r--r-- | src/rc/.gitignore | 66 | ||||
-rw-r--r-- | src/rc/Makefile | 186 | ||||
-rw-r--r-- | src/rc/meson.build | 320 | ||||
-rw-r--r-- | src/reboot/meson.build | 7 | ||||
-rw-r--r-- | src/reboot/reboot.in (renamed from scripts/reboot.in) | 0 | ||||
-rw-r--r-- | src/seedrng/meson.build | 9 | ||||
-rw-r--r-- | src/seedrng/seedrng.c (renamed from src/rc/seedrng.c) | 0 | ||||
-rw-r--r-- | src/service/meson.build | 20 | ||||
-rw-r--r-- | src/service/service.c (renamed from src/rc/do_service.c) | 2 | ||||
-rw-r--r-- | src/shared/_usage.c (renamed from src/rc/_usage.c) | 2 | ||||
-rw-r--r-- | src/shared/_usage.h (renamed from src/rc/_usage.h) | 0 | ||||
-rw-r--r-- | src/shared/helpers.h (renamed from src/includes/helpers.h) | 0 | ||||
-rw-r--r-- | src/shared/meson.build | 35 | ||||
-rw-r--r-- | src/shared/misc.c (renamed from src/rc/rc-misc.c) | 6 | ||||
-rw-r--r-- | src/shared/misc.h (renamed from src/includes/rc-misc.h) | 2 | ||||
-rw-r--r-- | src/shared/plugin.c (renamed from src/rc/rc-plugin.c) | 6 | ||||
-rw-r--r-- | src/shared/plugin.h (renamed from src/rc/rc-plugin.h) | 2 | ||||
-rw-r--r-- | src/shared/queue.h (renamed from src/includes/queue.h) | 0 | ||||
-rw-r--r-- | src/shared/schedules.c (renamed from src/rc/rc-schedules.c) | 4 | ||||
-rw-r--r-- | src/shared/schedules.h (renamed from src/rc/rc-schedules.h) | 0 | ||||
-rw-r--r-- | src/shared/selinux.c (renamed from src/rc/rc-selinux.c) | 8 | ||||
-rw-r--r-- | src/shared/selinux.h (renamed from src/rc/rc-selinux.h) | 0 | ||||
-rw-r--r-- | src/shared/version.h.in (renamed from src/common/version.h.in) | 0 | ||||
-rw-r--r-- | src/shared/version.in (renamed from src/common/version.in) | 0 | ||||
-rw-r--r-- | src/shared/wtmp.c (renamed from src/rc/rc-wtmp.c) | 4 | ||||
-rw-r--r-- | src/shared/wtmp.h (renamed from src/includes/rc-wtmp.h) | 0 | ||||
-rw-r--r-- | src/shell_var/meson.build | 4 | ||||
-rw-r--r-- | src/shell_var/shell_var.c (renamed from src/rc/shell_var.c) | 0 | ||||
-rw-r--r-- | src/shutdown/meson.build | 7 | ||||
-rw-r--r-- | src/shutdown/shutdown.in (renamed from scripts/shutdown.in) | 0 | ||||
-rw-r--r-- | src/start-stop-daemon/meson.build | 15 | ||||
-rw-r--r-- | src/start-stop-daemon/rc-pipes.c (renamed from src/rc/rc-pipes.c) | 0 | ||||
-rw-r--r-- | src/start-stop-daemon/rc-pipes.h (renamed from src/rc/rc-pipes.h) | 0 | ||||
-rw-r--r-- | src/start-stop-daemon/start-stop-daemon.c (renamed from src/rc/start-stop-daemon.c) | 4 | ||||
-rw-r--r-- | src/start-stop-daemon/start-stop-daemon.pam (renamed from src/rc/start-stop-daemon.pam) | 0 | ||||
-rw-r--r-- | src/supervise-daemon/meson.build | 14 | ||||
-rw-r--r-- | src/supervise-daemon/supervise-daemon.c (renamed from src/rc/supervise-daemon.c) | 6 | ||||
-rw-r--r-- | src/supervise-daemon/supervise-daemon.pam (renamed from src/rc/supervise-daemon.pam) | 0 | ||||
-rw-r--r-- | src/swclock/meson.build | 7 | ||||
-rw-r--r-- | src/swclock/swclock.c (renamed from src/rc/swclock.c) | 2 | ||||
-rw-r--r-- | src/value/meson.build | 15 | ||||
-rw-r--r-- | src/value/value.c (renamed from src/rc/do_value.c) | 2 | ||||
-rw-r--r-- | support/Makefile | 20 | ||||
-rw-r--r-- | support/deptree2dot/Makefile | 9 | ||||
-rw-r--r-- | support/init.d.examples/.gitignore | 11 | ||||
-rw-r--r-- | support/init.d.examples/Makefile | 11 | ||||
-rw-r--r-- | support/openvpn/Makefile | 9 | ||||
-rw-r--r-- | support/sysvinit/Makefile | 8 | ||||
-rw-r--r-- | sysctl.d/Makefile | 6 | ||||
-rw-r--r-- | test/Makefile | 14 | ||||
-rwxr-xr-x | tools/meson_final.sh | 2 | ||||
-rw-r--r-- | zsh-completion/Makefile | 10 |
154 files changed, 430 insertions, 2027 deletions
@@ -9,8 +9,4 @@ core .gdb_history .gdbinit -.depend -*.a -*.o -*.So -lib*.so +build diff --git a/Makefile b/Makefile deleted file mode 100644 index b9ff839c..00000000 --- a/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2007-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -TOP:= ${dir ${realpath ${firstword ${MAKEFILE_LIST}}}} -MK= ${TOP}/mk - -include ${TOP}/Makefile.inc - -SUBDIR= conf.d etc init.d local.d man scripts sh src support sysctl.d - -# Build bash completion or not -MKBASHCOMP?= no -ifeq (${MKBASHCOMP},yes) -SUBDIR+= bash-completion -endif - -# Build pkgconfig or not -MKPKGCONFIG?= yes -ifeq (${MKPKGCONFIG},yes) -SUBDIR+= pkgconfig -endif - -# Build zsh completion or not -MKZSHCOMP?= no -ifeq (${MKZSHCOMP},yes) -SUBDIR+= zsh-completion -endif - -# We need to ensure that runlevels is done last other than test -SUBDIR+= runlevels -SUBDIR+= test - -INSTALLAFTER= _installafter - -include ${MK}/sys.mk -include ${MK}/os.mk -include ${MK}/subdir.mk -include ${MK}/dist.mk -include ${MK}/gitver.mk - -_installafter: -ifeq (${MKPREFIX},yes) - ${INSTALL} -d ${DESTDIR}/${LIBEXECDIR}/init.d -else ifneq (${OS},Linux) - ${INSTALL} -d ${DESTDIR}/${LIBEXECDIR}/init.d -endif - ${INSTALL} -d ${DESTDIR}/${LIBEXECDIR}/tmp - ${ECHO} "${VERSION}${GITVER}" > ${DESTDIR}/${LIBEXECDIR}/version diff --git a/Makefile.inc b/Makefile.inc deleted file mode 100644 index 931b42ac..00000000 --- a/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -NAME= openrc -VERSION= 0.44 -PKG= ${NAME}-${VERSION} @@ -4,6 +4,10 @@ OpenRC NEWS This file will contain a list of notable changes for each release. Note the information in this file is in reverse order. +## OpenRC 0.45 + +The old make-based build system is removed in this release. + ## OpenRC 0.44 This version is the first to use a meson-based build system. @@ -9,72 +9,16 @@ system-provided init program, normally `/sbin/init`. OpenRC uses the [meson](http://mesonbuild.com) build system, so use the usual methods for this build system to build and install. -The old build system is still available for the 0.44.x branch, but it is -considered deprecated and will be removed. The previous documentation is -below. - -## Installation (historical) - -OpenRC requires GNU make. - -Once you have GNU Make installed, the default OpenRC installation can be -executed using this command: - -`make install` - -## Configuration (historical) - -You may wish to configure the installation by passing one or more of the -below arguments to the make command - -``` -PROGLDFLAGS=-static -LIBNAME=lib64 -DESTDIR=/tmp/openrc-image -MKBASHCOMP=no -MKNET=no -MKPAM=pam -MKCAP=yes -MKPREFIX=yes -MKPKGCONFIG=no -MKSELINUX=yes -MKSTATICLIBS=no -MKSYSVINIT=yes -MKTERMCAP=ncurses -MKTERMCAP=termcap -MKZSHCOMP=no -PKG_PREFIX=/usr/pkg -LOCAL_PREFIX=/usr/local -PREFIX=/usr/local -BRANDING=\"Gentoo/$(uname -s)\" -SH=/bin/sh -``` - ## Notes We don't support building a static OpenRC with PAM. -You may need to use `PROGLDFLAGS=-Wl,-Bstatic` on glibc instead of just `-static` -(This is now handled by the meson build system). - -If you are building OpenRC for a Gentoo Prefix installation, add `MKPREFIX=yes` -(this is not supported in the meson build currently, but patches are welcome). - `PKG_PREFIX` should be set to where packages install to by default. `LOCAL_PREFIX` should be set to where user maintained packages are. Only set `LOCAL_PREFIX` if different from `PKG_PREFIX`. -`PREFIX` should be set when OpenRC is not installed to /. - -If any of the following files exist then we do not overwrite them - -``` -/etc/devd.conf -/etc/rc -/etc/rc.shutdown -/etc/conf.d/* -``` +`ROOTPREFIX` should be set when the root path is different from '/'. `rc` and `rc.shutdown` are the hooks from the BSD init into OpenRC. diff --git a/bash-completion/Makefile b/bash-completion/Makefile deleted file mode 100644 index 3d9d886a..00000000 --- a/bash-completion/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -DIR= ${BASHCOMPDIR} -CONF= openrc \ - openrc-service-script \ - rc-service \ - rc-status \ - rc-update \ - -MK= ../mk -include ${MK}/os.mk - -include ${MK}/scripts.mk diff --git a/conf.d/Makefile b/conf.d/Makefile deleted file mode 100644 index 6d2e7de1..00000000 --- a/conf.d/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -include ../mk/net.mk - -DIR= ${CONFDIR} -CONF= bootmisc fsck hostname localmount netmount swap ${CONF-${OS}} - -ifeq (${MKNET},yes) -CONF+= network staticroute -endif - -MK= ../mk -include ${MK}/os.mk - -CONF-FreeBSD= ipfw modules moused powerd rarpd savecore syscons urandom - -CONF-Linux= agetty consolefont devfs dmesg hwclock keymaps killprocs modules \ - mtab net-online - -CONF-NetBSD= moused rarpd savecore urandom - -include ${MK}/scripts.mk diff --git a/etc/.gitignore b/etc/.gitignore deleted file mode 100644 index fe38bc1f..00000000 --- a/etc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -rc -rc.shutdown diff --git a/etc/Makefile b/etc/Makefile deleted file mode 100644 index 1695dee5..00000000 --- a/etc/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -DIR= ${SYSCONFDIR} -SRCS= rc.in rc.shutdown.in -BIN= ${BIN-${OS}} -CONF= rc.conf ${BIN-${OS}} - -MK= ../mk -include ${MK}/os.mk - -SED_EXTRA-FreeBSD= -e 's:@TERM@:cons25:g' -BIN-FreeBSD= rc rc.shutdown rc.devd -CONF-FreeBSD= devd.conf - -SED_EXTRA-Linux= -e 's:@TERM@:wsvt25:g' -BIN-Linux= -CONF-Linux= - -SED_EXTRA-NetBSD= -e 's:@TERM@:wsvt25:g' -BIN-NetBSD= rc rc.shutdown -CONF-NetBSD= - -SED_EXTRA= ${SED_EXTRA-${OS}} - -include ${MK}/scripts.mk diff --git a/init.d/.gitignore b/init.d/.gitignore deleted file mode 100644 index 8e03e3b9..00000000 --- a/init.d/.gitignore +++ /dev/null @@ -1,51 +0,0 @@ -agetty -binfmt -cgroups -modules-load -bootmisc -fsck -hostname -local -localmount -loopback -moused -netmount -network -root -savecache -swap -sysctl -urandom -devfs -dmesg -hwclock -consolefont -keymaps -killprocs -modules -mount-ro -mtab -net-online -numlock -osclock -procfs -s6-svscan -staticroute -sysfs -devdb -hostid -newsyslog -pf -rarpd -rc-enabled -rpcbind -runsvdir -savecore -save-keymaps -save-termencoding -swap-blk -swclock -syslogd -termencoding -ttys -wscons diff --git a/init.d/Makefile b/init.d/Makefile deleted file mode 100644 index ee227f43..00000000 --- a/init.d/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -include ../mk/net.mk - -DIR= ${INITDIR} -SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in loopback.in \ - netmount.in osclock.in root.in savecache.in swap.in swclock.in \ - sysctl.in runsvdir.in s6-svscan.in ${SRCS-${OS}} -BIN= ${OBJS} - -# Are we installing our network scripts? -ifeq (${MKNET},yes) -SRCS+= network.in staticroute.in -endif - -MK= ../mk -include ${MK}/os.mk - -# Generic BSD scripts -SRCS-FreeBSD= hostid.in modules.in moused.in newsyslog.in pf.in rarpd.in \ - rc-enabled.in rpcbind.in savecore.in syslogd.in urandom.in -# These are FreeBSD specific -SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in encswap.in ipfw.in \ - mixer.in nscd.in powerd.in syscons.in - -SRCS-Linux= agetty.in binfmt.in devfs.in cgroups.in dmesg.in hwclock.in \ - consolefont.in keymaps.in killprocs.in modules.in \ - mount-ro.in mtab.in numlock.in procfs.in net-online.in save-keymaps.in \ - save-termencoding.in seedrng.in sysfs.in termencoding.in - -# Generic BSD scripts -SRCS-NetBSD= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \ - rpcbind.in savecore.in syslogd.in urandom.in -# These are NetBSD specific -SRCS-NetBSD+= devdb.in swap-blk.in ttys.in wscons.in - -include ${MK}/scripts.mk - -_installafter_: realinstall diff --git a/local.d/Makefile b/local.d/Makefile deleted file mode 100644 index 7a7d31dd..00000000 --- a/local.d/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -DIR= ${LOCALDIR} -CONF= README - -MK= ../mk -include ${MK}/os.mk -include ${MK}/scripts.mk diff --git a/man/Makefile b/man/Makefile deleted file mode 100644 index 006c8d16..00000000 --- a/man/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -MK= ../mk -include ${MK}/sys.mk -include ${MK}/os.mk - -MAN3= einfo.3 \ - rc_config.3 rc_deptree.3 rc_find_pids.3 rc_plugin_hook.3 \ - rc_runlevel.3 rc_service.3 rc_stringlist.3 -MAN8= rc-service.8 rc-status.8 rc-update.8 openrc.8 openrc-run.8 \ - start-stop-daemon.8 supervise-daemon.8 - -ifeq (${OS},Linux) -MAN8 += rc-sstat.8 openrc-init.8 openrc-shutdown.8 -endif - -# Handy macro to create symlinks -# This does rely on correctly formatting our manpages! -MAKE_LINKS= suffix=$${man\#*.}; \ - prefix=$${man%%.*}; \ - for link in `sed -e 's/ ,//g' \ - -n -e '/^\.Sh NAME$$/,/\.Sh/ s/\.Nm //p' $${man}`; do \ - if test "$${link}" != "$${prefix}" ; then \ - ln -sf $${man} \ - ${DESTDIR}/${MANDIR}/man$${suffix}/$${link}.$${suffix} ; \ - fi; \ - done; - -include ${MK}/gitignore.mk - -all: - -install: - ${INSTALL} -d ${DESTDIR}/${MANDIR}/man3 - for man in ${MAN3}; do \ - ${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}/man3 || exit $$?; \ - ${MAKE_LINKS} \ - done - ${INSTALL} -d ${DESTDIR}/${MANDIR}/man8 - for man in ${MAN8}; do \ - ${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}/man8 || exit $$?; \ - ${MAKE_LINKS} \ - done - -check test:: - -clean: diff --git a/meson.build b/meson.build index e104b7d7..d37910c3 100644 --- a/meson.build +++ b/meson.build @@ -182,7 +182,7 @@ cc_warning_flags = cc.get_supported_arguments(cc_warning_flags_test) cc_flags = [cc_debug_flags, cc_os_flags, cc_warning_flags] add_project_arguments(cc_flags, language : 'c') -incdir = include_directories('src/includes') +incdir = include_directories('src/shared') einfo_incdir = include_directories('src/libeinfo') rc_incdir = include_directories('src/librc') @@ -201,7 +201,6 @@ subdir('init.d') subdir('local.d') subdir('man') subdir('pkgconfig') -subdir('scripts') subdir('sh') subdir('src') subdir('support') diff --git a/mk/cc.mk b/mk/cc.mk deleted file mode 100644 index 5efd5ad8..00000000 --- a/mk/cc.mk +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -# Setup some good default CFLAGS -CFLAGS?= -O2 -g - -# Default to using the C99 standard -CSTD?= c99 -ifneq (${CSTD},) -CFLAGS+= -std=${CSTD} -endif - -# Try and use some good cc flags if we're building from git -# We don't use -pedantic as it will warn about our perfectly valid -# use of %m in our logger. -_CCFLAGS= -Wall -Wextra -Wimplicit -Wshadow -Wformat=2 \ - -Wmissing-prototypes -Wmissing-declarations \ - -Wmissing-noreturn -Wmissing-format-attribute \ - -Wnested-externs \ - -Winline -Wwrite-strings -Wcast-align -Wcast-qual \ - -Wpointer-arith \ - -Wdeclaration-after-statement -Wsequence-point \ - -Werror=implicit-function-declaration - -# We should be using -Wredundant-decls, but our library hidden proto stuff -# gives loads of warnings. I don't fully understand it (the hidden proto, -# not the warning) so we just silence the warning. - -_CC_FLAGS_SH= for f in ${_CCFLAGS}; do \ - if echo "int main(void) { return 0;} " | \ - ${CC} $$f -S -xc -o /dev/null - ; \ - then printf "%s" "$$f "; fi \ - done; -_CC_FLAGS:= $(shell ${_CC_FLAGS_SH}) -CFLAGS+= ${_CC_FLAGS} - -include ${MK}/debug.mk diff --git a/mk/debug.mk b/mk/debug.mk deleted file mode 100644 index c7cbe9e8..00000000 --- a/mk/debug.mk +++ /dev/null @@ -1,23 +0,0 @@ -# rules to enable debugging support -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -_RC_DEBUG_SH= case "${DEBUG}" in "") echo "";; *) echo "-DRC_DEBUG";; esac -_RC_DEBUG:= $(shell ${_RC_DEBUG_SH}) -CPPFLAGS+= ${_RC_DEBUG} - -# Should we enable this with a different flag? -_LD_DEBUG_SH= case "${DEBUG}" in "") echo "";; *) echo "-Wl,--rpath=../librc -Wl,--rpath=../libeinfo";; esac -_LD_DEBUG:= $(shell ${_LD_DEBUG_SH}) -LDFLAGS+= ${_LD_DEBUG} - -_GGDB_SH= case "${DEBUG}" in "") echo "";; *) echo "-ggdb";; esac -_GGDB:= $(shell ${_GGDB_SH}) -CFLAGS+= ${_GGDB} diff --git a/mk/depend.mk b/mk/depend.mk deleted file mode 100644 index 187592dd..00000000 --- a/mk/depend.mk +++ /dev/null @@ -1,21 +0,0 @@ -# Generate .depend -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -CLEANFILES+= .depend -IGNOREFILES+= .depend - -.depend: ${SRCS} - rm -f .depend - ${CC} ${LOCAL_CPPFLAGS} ${CPPFLAGS} -MM ${SRCS} > .depend - -depend: .depend extra_depend - --include .depend diff --git a/mk/dist.mk b/mk/dist.mk deleted file mode 100644 index c1e94a59..00000000 --- a/mk/dist.mk +++ /dev/null @@ -1,50 +0,0 @@ -# rules to make a distribution tarball from a git repo -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -GITREF?= ${VERSION} -DISTPREFIX?= ${NAME}-${VERSION} -DISTFILE?= ${DISTPREFIX}.tar.gz - -CLEANFILES+= ${NAME}-*.tar.gz - -CHANGELOG_LIMIT?= --after="1 year ago" - -_SNAP_SH= date -u +%Y%m%d%H%M -_SNAP:= $(shell ${_SNAP_SH}) -SNAP= ${_SNAP} -SNAPDIR= ${DISTPREFIX}-${SNAP} -SNAPFILE= ${SNAPDIR}.tar.gz - -changelog: - git log ${CHANGELOG_LIMIT} --format=full > ChangeLog - -dist: - git archive --prefix=${DISTPREFIX}/ ${GITREF} --output=${DISTFILE} - -distcheck: dist - rm -rf ${DISTPREFIX} - tar xf ${DISTFILE} - MAKEFLAGS= $(MAKE) -C ${DISTPREFIX} - MAKEFLAGS= $(MAKE) -C ${DISTPREFIX} check - rm -rf ${DISTPREFIX} - -snapshot: - rm -rf /tmp/${SNAPDIR} - mkdir /tmp/${SNAPDIR} - cp -RPp * /tmp/${SNAPDIR} - (cd /tmp/${SNAPDIR}; make clean) - rm -rf /tmp/${SNAPDIR}/.git 2>/dev/null || true - tar -cvzpf ${SNAPFILE} -C /tmp ${SNAPDIR} - rm -rf /tmp/${SNAPDIR} - ls -l ${SNAPFILE} - -snap: snapshot - diff --git a/mk/gitignore.mk b/mk/gitignore.mk deleted file mode 100644 index a0b24cb7..00000000 --- a/mk/gitignore.mk +++ /dev/null @@ -1,22 +0,0 @@ -# rules to make .gitignore files -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -IGNOREFILES+= ${CLEANFILES} - -.PHONY: .gitignore - -.gitignore: - @if test -n "${IGNOREFILES}"; then \ - echo "Ignoring ${IGNOREFILES}"; \ - echo ${IGNOREFILES} | tr ' ' '\n' > .gitignore; \ - fi - -ignore: .gitignore diff --git a/mk/gitver.mk b/mk/gitver.mk deleted file mode 100644 index 62cae5a4..00000000 --- a/mk/gitver.mk +++ /dev/null @@ -1,8 +0,0 @@ -_GITVER_SH= if git rev-parse --short HEAD >/dev/null 2>&1; then \ - printf "."; \ - git rev-parse --short HEAD; \ - else \ - echo ""; \ - fi -_GITVER:= $(shell ${_GITVER_SH}) -GITVER= ${_GITVER} diff --git a/mk/lib.mk b/mk/lib.mk deleted file mode 100644 index eb6fcf4b..00000000 --- a/mk/lib.mk +++ /dev/null @@ -1,77 +0,0 @@ -# rules to build a library -# based on FreeBSD's bsd.lib.mk - -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -SHLIB_NAME= lib${LIB}.so.${SHLIB_MAJOR} -SHLIB_LINK= lib${LIB}.so -SONAME?= ${SHLIB_NAME} - -SOBJS+= ${SRCS:.c=.So} - -MKSTATICLIBS?= yes -ifeq (${MKSTATICLIBS},yes) -OBJS+= ${SRCS:.c=.o} -_LIBS+= lib${LIB}.a -endif - -_LIBS+= ${SHLIB_NAME} - -CLEANFILES+= ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK} - -%.o: %.c - ${CC} ${LOCAL_CFLAGS} ${LOCAL_CPPFLAGS} ${CFLAGS} ${CPPFLAGS} -c $< -o $@ - -%.So: %.c - ${CC} ${PICFLAG} -DPIC ${LOCAL_CFLAGS} ${LOCAL_CPPFLAGS} ${CPPFLAGS} ${CFLAGS} -c $< -o $@ - -all: depend ${_LIBS} - -lib${LIB}.a: ${OBJS} ${STATICOBJS} - @${ECHO} building static library $@ - ${AR} rc $@ $^ - ${RANLIB} $@ - -${SHLIB_NAME}: ${VERSION_MAP} -LDFLAGS+= -Wl,--version-script=${VERSION_MAP} - -${SHLIB_NAME}: ${SOBJS} - @${ECHO} building shared library $@ - @rm -f $@ ${SHLIB_LINK} - @ln -fs $@ ${SHLIB_LINK} - ${CC} ${LOCAL_CFLAGS} ${CFLAGS} ${LOCAL_LDFLAGS} ${LDFLAGS} -shared -Wl,-x \ - -o $@ -Wl,-soname,${SONAME} \ - ${SOBJS} ${LDADD} - -install: all - ${INSTALL} -d ${DESTDIR}${LIBDIR} -ifeq (${MKSTATICLIBS},yes) - ${INSTALL} -m ${LIBMODE} lib${LIB}.a ${DESTDIR}${LIBDIR} -endif - ${INSTALL} -m ${LIBMODE} ${SHLIB_NAME} ${DESTDIR}${LIBDIR} - ln -fs ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK} - ${INSTALL} -d ${DESTDIR}${INCDIR} - for x in ${INCS}; do ${INSTALL} -m ${INCMODE} $$x ${DESTDIR}${INCDIR}; done - -check test:: - -clean: - rm -f ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK} ${CLEANFILES} - -extra_depend: - @TMP=depend.$$$$; \ - ${SED} -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.So:/' .depend > $${TMP}; \ - mv $${TMP} .depend - -include ${MK}/sys.mk -include ${MK}/os.mk -include ${MK}/depend.mk -include ${MK}/gitignore.mk diff --git a/mk/net.mk b/mk/net.mk deleted file mode 100644 index abc198c6..00000000 --- a/mk/net.mk +++ /dev/null @@ -1 +0,0 @@ -MKNET?= yes diff --git a/mk/os-BSD.mk b/mk/os-BSD.mk deleted file mode 100644 index 43db4d59..00000000 --- a/mk/os-BSD.mk +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -# Generic definitions - -PKG_PREFIX?= /usr/local -SFX= .BSD.in - -LIBKVM?= -lkvm diff --git a/mk/os-DragonFly.mk b/mk/os-DragonFly.mk deleted file mode 100644 index 6bd9c29c..00000000 --- a/mk/os-DragonFly.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2013-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -# Generic definitions - -include ${MK}/os-BSD.mk diff --git a/mk/os-FreeBSD.mk b/mk/os-FreeBSD.mk deleted file mode 100644 index 1025921f..00000000 --- a/mk/os-FreeBSD.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -# Generic definitions - -include ${MK}/os-BSD.mk - -CPPFLAGS+= -D_BSD_SOURCE diff --git a/mk/os-GNU-kFreeBSD.mk b/mk/os-GNU-kFreeBSD.mk deleted file mode 100644 index 8d25a19d..00000000 --- a/mk/os-GNU-kFreeBSD.mk +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2013-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -# Generic definitions - -SFX= .GNU-kFreeBSD.in -PKG_PREFIX?= /usr - -CPPFLAGS+= -D_BSD_SOURCE -LIBDL= -Wl,-Bdynamic -ldl -LIBKVM?= diff --git a/mk/os-GNU.mk b/mk/os-GNU.mk deleted file mode 100644 index ea22b2fc..00000000 --- a/mk/os-GNU.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2007-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -SFX= .GNU.in -PKG_PREFIX?= /usr - -CPPFLAGS+= -D_DEFAULT_SOURCE -DMAXPATHLEN=4096 -DPATH_MAX=4096 -LIBDL= -Wl,-Bdynamic -ldl diff --git a/mk/os-Linux.mk b/mk/os-Linux.mk deleted file mode 100644 index 00521c80..00000000 --- a/mk/os-Linux.mk +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -SFX= .Linux.in -PKG_PREFIX?= /usr - -CPPFLAGS+= -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_XOPEN_SOURCE -LIBDL= -Wl,-Bdynamic -ldl - -ifeq (${MKSELINUX},yes) -CPPFLAGS+= -DHAVE_SELINUX -LIBSELINUX?= -lselinux -LDADD += $(LIBSELINUX) - -ifneq (${MKPAM},pam) -# if using selinux but not pam then we need crypt -LIBCRYPT?= -lcrypt -LDADD += $(LIBCRYPT) -endif - -endif - -ifeq (${MKCAP},yes) -CPPFLAGS+= -DHAVE_CAP -LIBCAP?= -lcap -LDADD += $(LIBCAP) -endif - -ifeq (${MKAUDIT},yes) -LIBAUDIT?= -laudit -CPPFLAGS+= -DHAVE_AUDIT -LDADD+= ${LIBAUDIT} -endif diff --git a/mk/os-NetBSD.mk b/mk/os-NetBSD.mk deleted file mode 100644 index 240949aa..00000000 --- a/mk/os-NetBSD.mk +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -# Generic definitions - -PKG_PREFIX?= /usr/pkg -include ${MK}/os-BSD.mk diff --git a/mk/os-prefix.mk b/mk/os-prefix.mk deleted file mode 100644 index af08c99e..00000000 --- a/mk/os-prefix.mk +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2012 William Hubbs <w.d.hubbs@gmail.com> -# Released under the 2-clause BSD license. - -ifeq (${MKPREFIX},yes) -CPPFLAGS+= -DPREFIX -PKG_PREFIX?= $(PREFIX)/usr -SED_EXTRA= -e '/_PATH=.*usr.bin/d' -endif diff --git a/mk/os.mk b/mk/os.mk deleted file mode 100644 index 1ce94152..00000000 --- a/mk/os.mk +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -# Generic definitions - -_OS_SH= uname -s | tr '/' '-' -_OS:= $(shell ${_OS_SH}) -OS?= ${_OS} -include ${MK}/os-prefix.mk -include ${MK}/os-${OS}.mk - -RC_LIB= /$(LIBNAME)/rc diff --git a/mk/pam.mk b/mk/pam.mk deleted file mode 100644 index 199896cc..00000000 --- a/mk/pam.mk +++ /dev/null @@ -1,16 +0,0 @@ -ifeq (${MKPAM},pam) -LIBPAM?= -lpam -CPPFLAGS+= -DHAVE_PAM -LDADD+= ${LIBPAM} - -ifeq (${MKSELINUX},yes) -# with selinux, pam_misc is needed too -LIBPAM_MISC?= -lpam_misc -LDADD+= ${LIBPAM_MISC} -endif - -PAMDIR?= /etc/pam.d -PAMMODE?= 0644 -else ifneq (${MKPAM},) -$(error if MKPAM is defined, it must be "pam") -endif diff --git a/mk/prog.mk b/mk/prog.mk deleted file mode 100644 index 463a9508..00000000 --- a/mk/prog.mk +++ /dev/null @@ -1,48 +0,0 @@ -# rules to build a program -# based on FreeBSD's bsd.prog.mk - -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -OBJS+= ${SRCS:.c=.o} - -# Some systems don't include /lib in their standard link path -# so we should embed it if different -# This is currently hardcoded for NetBSD which has two dynamic linkers -# and we need to use the one in /libexec instead of /usr/libexec -_DYNLINK_SH= if test "${PREFIX}" = "" && test -e /libexec/ld.elf_so; then \ - echo "-Wl,-dynamic-linker=/libexec/ld.elf_so"; \ - else \ - echo ""; \ - fi -_DYNLINK:= $(shell ${_DYNLINK_SH}) -LDFLAGS+= ${_DYNLINK} -LDFLAGS+= -Wl,-rpath=${PREFIX}/${LIBNAME} -LDFLAGS+= ${PROGLDFLAGS} - -CLEANFILES+= ${OBJS} ${PROG} - -all: depend ${PROG} - -%.o: %.c - ${CC} ${LOCAL_CFLAGS} ${LOCAL_CPPFLAGS} ${CFLAGS} ${CPPFLAGS} -c $< -o $@ - -${PROG}: ${SCRIPTS} ${OBJS} - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} ${LDADD} - -clean: - rm -f ${CLEANFILES} - -extra_depend: - -include ${MK}/sys.mk -include ${MK}/os.mk -include ${MK}/depend.mk -include ${MK}/gitignore.mk diff --git a/mk/scripts.mk b/mk/scripts.mk deleted file mode 100644 index 14220916..00000000 --- a/mk/scripts.mk +++ /dev/null @@ -1,64 +0,0 @@ -# Install rules for our scripts -# Copyright (c) 2007-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -include ${MK}/sys.mk -include ${MK}/os.mk - -OBJS+= ${SRCS:.in=} - -_PKG_SED_SH= if test "${PREFIX}" = "${PKG_PREFIX}"; then echo "-e 's:@PKG_PREFIX@::g'"; else echo "-e 's:@PKG_PREFIX@:${PKG_PREFIX}:g'"; fi -_PKG_SED:= $(shell ${_PKG_SED_SH}) -_LCL_SED_SH= if test "${PREFIX}" = "${LOCAL_PREFIX}"; then echo "-e 's:@LOCAL_PREFIX@::g'"; else echo "-e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'"; fi -_LCL_SED:= $(shell ${_LCL_SED_SH}) - -SED_REPLACE= -e 's:@SHELL@:${SH}:' -e 's:@LIB@:${LIBNAME}:g' -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' -e 's:@PREFIX@:${PREFIX}:g' -e 's:@BINDIR@:${BINDIR}:g' -e 's:@SBINDIR@:${SBINDIR}:g' ${_PKG_SED} ${_LCL_SED} - -# Tweak our shell scripts -%.sh: %.sh.in - ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@ - -%: %.in - ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@ - -all: ${OBJS} ${TARGETS} - -realinstall: ${BIN} ${CONF} ${INC} - @if test -n "${DIR}"; then \ - ${ECHO} ${INSTALL} -d ${DESTDIR}/${DIR}; \ - ${INSTALL} -d ${DESTDIR}/${DIR} || exit $$?; \ - fi - @if test -n "${BIN}"; then \ - ${ECHO} ${INSTALL} -m ${BINMODE} ${BIN} ${DESTDIR}/${DIR}; \ - ${INSTALL} -m ${BINMODE} ${BIN} ${DESTDIR}/${DIR} || exit $$?; \ - fi - @if test -n "${INC}"; then \ - ${ECHO} ${INSTALL} -m ${INCMODE} ${INC} ${DESTDIR}/${DIR}; \ - ${INSTALL} -m ${INCMODE} ${INC} ${DESTDIR}/${DIR} || exit $$?; \ - fi - @for x in ${CONF}; do \ - if ! test -e ${DESTDIR}/${PREFIX}${DIR}/$$x; then \ - ${ECHO} ${INSTALL} -m ${CONFMODE} $$x ${DESTDIR}/${DIR}; \ - ${INSTALL} -m ${CONFMODE} $$x ${DESTDIR}/${DIR} || exit $$?; \ - fi; \ - done - -install: all realinstall ${INSTALLAFTER} - -check test:: - -# A lot of scripts don't have anything to clean -# Also, some rm implentation require a file argument regardless of error -# so we ensure that it has a bogus argument -CLEANFILES+= ${OBJS} -clean: - @if test -n "${CLEANFILES}"; then echo "rm -f ${CLEANFILES}"; rm -f ${CLEANFILES}; fi - -include ${MK}/gitignore.mk diff --git a/mk/subdir.mk b/mk/subdir.mk deleted file mode 100644 index 6d8ecd98..00000000 --- a/mk/subdir.mk +++ /dev/null @@ -1,38 +0,0 @@ -# Recursive rules -# Adapted from FreeBSDs bsd.subdir.mk -# Copyright (c) 2007-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -_+_ ?= + -ECHODIR ?= echo -_SUBDIR = @${_+_}for x in ${SUBDIR}; do \ - if test -d $$x; then \ - ${ECHODIR} "===> ${DIRPRFX}$$x (${@:realinstall=install})"; \ - cd $$x; \ - ${MAKE} ${@:realinstall=install} \ - DIRPRFX=${DIRPRFX}$$x/ || exit $$?; \ - cd ..; \ - fi; \ -done - -all: - ${_SUBDIR} -clean: - @if test -n "${CLEANFILES}"; then echo "rm -f ${CLEANFILES}"; rm -f ${CLEANFILES}; fi - ${_SUBDIR} -realinstall: - ${_SUBDIR} -install: realinstall ${INSTALLAFTER} -check test:: - ${_SUBDIR} -depend: - ${_SUBDIR} -ignore: - ${_SUBDIR} diff --git a/mk/sys.mk b/mk/sys.mk deleted file mode 100644 index 777b60d9..00000000 --- a/mk/sys.mk +++ /dev/null @@ -1,71 +0,0 @@ -# Generic system definitions -# Copyright (c) 2008-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -AR?= ar -CP?= cp -PKG_CONFIG?= pkg-config -ECHO?= echo -INSTALL?= install -RANLIB?= ranlib -SED?= sed -SH= /bin/sh - -PREFIX?= -ifeq (${PREFIX},) -UPREFIX= /usr -else -UPREFIX= ${PREFIX} -ifeq (${MKPREFIX},yes) -UPREFIX= ${PREFIX}/usr -endif -endif -LOCAL_PREFIX= $(UPREFIX)/local - -PICFLAG?= -fPIC - -SYSCONFDIR?= ${PREFIX}/etc -INITDIR?= ${SYSCONFDIR}/init.d -CONFDIR?= ${SYSCONFDIR}/conf.d -CONFMODE?= 0644 -LOCALDIR?= ${SYSCONFDIR}/local.d -SYSCTLDIR?= ${SYSCONFDIR}/sysctl.d - -BINDIR?= ${PREFIX}/bin -BINMODE?= 0755 - -SBINDIR?= ${PREFIX}/sbin -SBINMODE?= 0755 - -INCDIR?= ${UPREFIX}/include -INCMODE?= 0644 - -_LIBNAME_SH= case `readlink /lib` in /lib64|lib64) echo "lib64";; *) echo "lib";; esac -_LIBNAME:= $(shell ${_LIBNAME_SH}) -LIBNAME?= ${_LIBNAME} -LIBDIR?= ${UPREFIX}/${LIBNAME} -LIBMODE?= 0644 - -LIBEXECDIR?= ${PREFIX}/libexec/rc -PKGCONFIGDIR?= ${UPREFIX}/${LIBNAME}/pkgconfig - -MANPREFIX?= ${UPREFIX}/share -MANDIR?= ${MANPREFIX}/man -MANMODE?= 0644 - -BASHCOMPDIR?= ${UPREFIX}/share/bash-completion/completions - -DATADIR?= ${UPREFIX}/share/openrc -DATAMODE?= 0644 - -DOCDIR?= ${UPREFIX}/share/doc -DOCMODE?= 0644 - -ZSHCOMPDIR?= ${UPREFIX}/share/zsh/site-functions diff --git a/mk/termcap.mk b/mk/termcap.mk deleted file mode 100644 index 4890e35a..00000000 --- a/mk/termcap.mk +++ /dev/null @@ -1,17 +0,0 @@ -ifeq (${MKTERMCAP},ncurses) -TERMCAP_CFLAGS:= $(shell ${PKG_CONFIG} ncurses --cflags 2> /dev/null) -LTERMCAP:= $(shell ${PKG_CONFIG} ncurses --libs 2> /dev/null) -ifeq ($(LTERMCAP),) -LIBTERMCAP?= -lncurses -else -LIBTERMCAP?= $(LTERMCAP) -endif -CPPFLAGS+= -DHAVE_TERMCAP ${TERMCAP_CFLAGS} -LDADD+= ${LIBTERMCAP} -else ifeq (${MKTERMCAP},termcap) -LIBTERMCAP?= -ltermcap -CPPFLAGS+= -DHAVE_TERMCAP -LDADD+= ${LIBTERMCAP} -else ifneq (${MKTERMCAP},) -$(error If MKTERMCAP is defined, it must be ncurses or termcap) -endif diff --git a/pkgconfig/.gitignore b/pkgconfig/.gitignore deleted file mode 100644 index e50bf9c5..00000000 --- a/pkgconfig/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -einfo.pc -openrc.pc diff --git a/pkgconfig/Makefile b/pkgconfig/Makefile deleted file mode 100644 index 80514d6a..00000000 --- a/pkgconfig/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -DIR= ${PKGCONFIGDIR} -SRCS= einfo.pc.in openrc.pc.in -INC= einfo.pc openrc.pc - -.DEFAULT: - ${SED} -n -e 's/^VERSION=[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1${GITVER}\"/p' ../../Makefile > version.h - -SED_EXTRA= -e 's:@VERSION@:${VERSION}:g' - -MK= ../mk -include ../Makefile.inc -include ${MK}/scripts.mk diff --git a/runlevels/Makefile b/runlevels/Makefile deleted file mode 100644 index 8d8b8e9e..00000000 --- a/runlevels/Makefile +++ /dev/null @@ -1,102 +0,0 @@ -include ../mk/net.mk - -BOOT= bootmisc fsck hostname localmount loopback \ - root swap sysctl ${BOOT-${OS}} -DEFAULT= local netmount -NONETWORK= local -SHUTDOWN= savecache ${SHUTDOWN-${OS}} -SYSINIT= ${SYSINIT-${OS}} - -LEVELDIR= ${DESTDIR}/${SYSCONFDIR}/runlevels -SYSINITDIR= ${LEVELDIR}/sysinit -BOOTDIR= ${LEVELDIR}/boot -DEFAULTDIR= ${LEVELDIR}/default -NONETWORKDIR= ${LEVELDIR}/nonetwork -SHUTDOWNDIR= ${LEVELDIR}/shutdown - -ifeq (${MKNET},yes) -BOOT+= network staticroute -endif - -INITFILES= ../init.d - -MK= ../mk -include ${MK}/sys.mk -include ${MK}/os.mk -include ${MK}/gitignore.mk - -BOOT-${OS}= -SHUTDOWN-${OS}= -SYSINIT-${OS}= - -BOOT-BSD= hostid newsyslog savecore syslogd swap-blk urandom - -# Generic BSD stuff -BOOT-FreeBSD+= hostid modules newsyslog savecore syslogd urandom -# FreeBSD specific stuff -BOOT-FreeBSD+= adjkerntz dumpon syscons - -BOOT-Linux+= binfmt hwclock keymaps modules mtab procfs save-keymaps \ - save-termencoding seedrng termencoding -SHUTDOWN-Linux= killprocs mount-ro -SYSINIT-Linux= devfs cgroups dmesg sysfs - -# Generic BSD stuff -BOOT-NetBSD+= hostid newsyslog savecore syslogd urandom -# NetBSD specific stuff -BOOT-NetBSD+= devdb swap-blk ttys wscons - -all: - -install: - if ! test -d "${SYSINITDIR}"; then \ - ${INSTALL} -d ${SYSINITDIR} || exit $$?; \ - for x in ${SYSINIT}; do \ - if test "${MKPREFIX}" = yes; then \ - grep -q "keyword .*-prefix" ${INITFILES}/"$$x" && continue; \ - fi; \ - ln -snf ${INITDIR}/"$$x" ${SYSINITDIR}/"$$x" || exit $$?; done \ - fi - if ! test -d "${BOOTDIR}"; then \ - ${INSTALL} -d ${BOOTDIR} || exit $$?; \ - for x in ${BOOT}; do \ - if test "${MKPREFIX}" = yes; then \ - grep -q "keyword .*-prefix" ${INITFILES}/"$$x" && continue; \ - fi; \ - ln -snf ${INITDIR}/"$$x" ${BOOTDIR}/"$$x" || exit $$?; \ - done \ - fi - if ! test -d "${DEFAULTDIR}"; then \ - ${INSTALL} -d ${DEFAULTDIR} || exit $$?; \ - for x in ${DEFAULT}; do \ - if test "${MKPREFIX}" = yes; then \ - grep -q "keyword .*-prefix" ${INITFILES}/"$$x" && continue; \ - fi; \ - ln -snf ${INITDIR}/"$$x" ${DEFAULTDIR}/"$$x" || exit $$?; done \ - fi - if ! test -d "${NONETWORKDIR}"; then \ - ${INSTALL} -d ${NONETWORKDIR} || exit $$?; \ - for x in ${NONETWORK}; do \ - if test "${MKPREFIX}" = yes; then \ - grep -q "keyword .*-prefix" ${INITFILES}/"$$x" && continue; \ - fi; \ - ln -snf ${INITDIR}/"$$x" ${NONETWORKDIR}/"$$x" || exit $$?; done \ - fi - if ! test -d "${SHUTDOWNDIR}"; then \ - ${INSTALL} -d ${SHUTDOWNDIR} || exit $$?; \ - for x in ${SHUTDOWN}; do \ - if test "${MKPREFIX}" = yes; then \ - grep -q "keyword .*-prefix" ${INITFILES}/"$$x" && continue; \ - fi; \ - ln -snf ${INITDIR}/"$$x" ${SHUTDOWNDIR}/"$$x" || exit $$?; done \ - fi - if test "${MKSYSVINIT}" = yes && test "${OS}" = Linux; then \ - for x in tty1 tty2 tty3 tty4 tty5 tty6; do \ - ln -snf ${INITDIR}/agetty ${DESTDIR}/${INITDIR}/"agetty.$$x" || exit $$?; \ - ln -snf ${INITDIR}/agetty.$$x ${DEFAULTDIR}/"agetty.$$x" || exit $$?; \ - done; \ - fi - -check test:: - -clean: diff --git a/scripts/.gitignore b/scripts/.gitignore deleted file mode 100644 index e26c51ae..00000000 --- a/scripts/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -halt -poweroff -rc-sstat -reboot -shutdown diff --git a/scripts/Makefile b/scripts/Makefile deleted file mode 100644 index d2215b34..00000000 --- a/scripts/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -MK= ../mk -include ${MK}/os.mk - -DIR= ${LIBEXECDIR}/bin -BIN= on_ac_power -INSTALLAFTER = _installafter - -ifeq (${OS},Linux) -SRCS+= rc-sstat.in -BIN+= rc-sstat -ifeq (${MKSYSVINIT},yes) -SRCS+= halt.in poweroff.in reboot.in shutdown.in -BIN+= halt poweroff reboot shutdown - endif -endif - -_installafter: -ifeq (${OS},Linux) - ${INSTALL} -d ${DESTDIR}${SBINDIR} - ln -sf ${DIR}/rc-sstat ${DESTDIR}/${SBINDIR}/rc-sstat -ifeq (${MKSYSVINIT},yes) - ln -sf ${DIR}/halt ${DESTDIR}/${SBINDIR}/halt - ln -sf ${DIR}/poweroff ${DESTDIR}/${SBINDIR}/poweroff - ln -sf ${DIR}/reboot ${DESTDIR}/${SBINDIR}/reboot - ln -sf ${DIR}/shutdown ${DESTDIR}/${SBINDIR}/shutdown - ln -sf openrc-init ${DESTDIR}/${SBINDIR}/init -endif -endif - -include ${MK}/scripts.mk diff --git a/scripts/meson.build b/scripts/meson.build deleted file mode 100644 index 07d38acc..00000000 --- a/scripts/meson.build +++ /dev/null @@ -1,45 +0,0 @@ -script_conf_data = configuration_data() -script_conf_data.set('SBINDIR', sbindir) - -script_dir = rc_libexecdir / 'bin' - -scripts_internal = [ - 'on_ac_power', - ] - -scripts_Linux = [ - 'rc-sstat.in', - ] - -scripts_sysvinit = [ - 'halt.in', - 'poweroff.in', - 'shutdown.in', - 'reboot.in', - ] - -install_data(scripts_internal, - install_dir : script_dir, - install_mode: 'rwxr-xr-x') - -if os == 'Linux' - foreach file : scripts_Linux - configure_file(input : file, - output : '@BASENAME@', - configuration : script_conf_data, - install_dir: script_dir, - install_mode: 'rwxr-xr-x') - endforeach - if get_option('sysvinit') - foreach file : scripts_sysvinit - configure_file(input : file, - output : '@BASENAME@', - configuration : script_conf_data, - install_dir: script_dir, - install_mode: 'rwxr-xr-x') - endforeach - endif -endif - -meson.add_install_script('meson_script_links.sh', rc_libexecdir, - sbindir) diff --git a/scripts/meson_script_links.sh b/scripts/meson_script_links.sh deleted file mode 100755 index f13e767d..00000000 --- a/scripts/meson_script_links.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -set -e -set -u - -rc_libexecdir="$1" -sbindir="$2" -binaries=" halt poweroff rc-sstat reboot shutdown" -for f in $binaries; do - if [ -x "${DESTDIR}${rc_libexecdir}/bin/${f}" ]; then - ln -snf "${rc_libexecdir}/bin/${f}" \ - "${DESTDIR}${sbindir}/${f}" - fi -done -# sysvinit is active when halt exits -if [ -x "${DESTDIR}${rc_libexecdir}/bin/halt" ]; then - ln -snf "${sbindir}/openrc-init" \ - "${DESTDIR}${sbindir}/init" -fi diff --git a/sh/.gitignore b/sh/.gitignore deleted file mode 100644 index 69e3bd03..00000000 --- a/sh/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -functions.sh -gendepends.sh -openrc-run.sh -cgroup-release-agent.sh -init.sh -init-early.sh -binfmt.sh diff --git a/sh/Makefile b/sh/Makefile deleted file mode 100644 index 7f5dfb21..00000000 --- a/sh/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -DIR= ${LIBEXECDIR}/sh -SRCS= init.sh.in functions.sh.in gendepends.sh.in \ - openrc-run.sh.in ${SRCS-${OS}} -INC= rc-mount.sh functions.sh rc-functions.sh runit.sh s6.sh \ - start-stop-daemon.sh supervise-daemon.sh ${INC-${OS}} -BIN= gendepends.sh init.sh openrc-run.sh ${BIN-${OS}} - -INSTALLAFTER= _installafter - -MK= ../mk -include ${MK}/os.mk - -SRCS-FreeBSD= -BIN-FreeBSD= - -SRCS-Linux= binfmt.sh.in cgroup-release-agent.sh.in init-early.sh.in -BIN-Linux= binfmt.sh cgroup-release-agent.sh init-early.sh -INC-Linux= rc-cgroup.sh - -SRCS-NetBSD= -BIN-NetBSD= - -include ${MK}/scripts.mk - -%.sh: %.sh${SFX} - ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@ - -_installafter: - ${INSTALL} -d ${DESTDIR}/${INITDIR} - @# Put functions.sh into init for backwards compat - ln -snf ${LIBEXECDIR}/sh/functions.sh ${DESTDIR}/${INITDIR} || exit $$? - -check test:: diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index 0148c4d1..00000000 --- a/src/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2007-2008 Roy Marples <roy@marples.name> -# Released under the 2-clause BSD license. - -SUBDIR= libeinfo librc rc - -MK= ../mk -include ${MK}/subdir.mk diff --git a/src/rc/checkpath.c b/src/checkpath/checkpath.c index 550e7cea..34f5c452 100644 --- a/src/rc/checkpath.c +++ b/src/checkpath/checkpath.c @@ -33,8 +33,8 @@ #include "einfo.h" #include "rc.h" -#include "rc-misc.h" -#include "rc-selinux.h" +#include "misc.h" +#include "selinux.h" #include "_usage.h" typedef enum { diff --git a/src/checkpath/meson.build b/src/checkpath/meson.build new file mode 100644 index 00000000..300dcf2f --- /dev/null +++ b/src/checkpath/meson.build @@ -0,0 +1,9 @@ +executable('checkpath', + ['checkpath.c', misc_c, usage_c, selinux_c, + version_h], + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + dependencies: [audit_dep, pam_dep, pam_misc_dep, selinux_dep, crypt_dep], + install: true, + install_dir: rc_bindir) diff --git a/src/common/meson.build b/src/common/meson.build deleted file mode 100644 index 2e421658..00000000 --- a/src/common/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -version_h = vcs_tag( - input : 'version.h.in', - output : 'version.h') -version_f = vcs_tag( - input : 'version.in', - output : 'version') diff --git a/src/rc/do_e.c b/src/einfo/einfo.c index 1778efe4..1778efe4 100644 --- a/src/rc/do_e.c +++ b/src/einfo/einfo.c diff --git a/src/einfo/meson.build b/src/einfo/meson.build new file mode 100644 index 00000000..df11d5fd --- /dev/null +++ b/src/einfo/meson.build @@ -0,0 +1,32 @@ +einfo_execs = [ + 'einfon', + 'einfo', + 'ewarnn', + 'ewarn', + 'eerrorn', + 'eerror', + 'ebegin', + 'eend', + 'ewend', + 'eindent', + 'eoutdent', + 'esyslog', + 'eval_ecolors', + 'ewaitfile', + 'veinfo', + 'vewarn', + 'vebegin', + 'veend', + 'vewend', + 'veindent', + 'veoutdent', + ] + +foreach exec: einfo_execs + executable(exec, + ['einfo.c', version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) +endforeach diff --git a/src/rc/fstabinfo.c b/src/fstabinfo/fstabinfo.c index 2a1a12ea..ef7d0609 100644 --- a/src/rc/fstabinfo.c +++ b/src/fstabinfo/fstabinfo.c @@ -58,7 +58,7 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "_usage.h" const char *applet = NULL; diff --git a/src/fstabinfo/meson.build b/src/fstabinfo/meson.build new file mode 100644 index 00000000..d7b9153a --- /dev/null +++ b/src/fstabinfo/meson.build @@ -0,0 +1,7 @@ +executable('fstabinfo', + ['fstabinfo.c', misc_c, usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) diff --git a/scripts/halt.in b/src/halt/halt.in index 209dc130..209dc130 100644 --- a/scripts/halt.in +++ b/src/halt/halt.in diff --git a/src/halt/meson.build b/src/halt/meson.build new file mode 100644 index 00000000..dde1bca7 --- /dev/null +++ b/src/halt/meson.build @@ -0,0 +1,7 @@ +if os == 'Linux' and get_option('sysvinit') + configure_file(input : 'halt.in', + output : '@BASENAME@', + configuration : script_conf_data, + install_dir: sbindir, + install_mode: 'rwxr-xr-x') +endif diff --git a/src/rc/is_newer_than.c b/src/is_newer_than/is_newer_than.c index 957ecbf4..bd916ec5 100644 --- a/src/rc/is_newer_than.c +++ b/src/is_newer_than/is_newer_than.c @@ -16,7 +16,7 @@ #include <stdlib.h> #include "rc.h" -#include "rc-misc.h" +#include "misc.h" int main(int argc, char **argv) { diff --git a/src/is_newer_than/meson.build b/src/is_newer_than/meson.build new file mode 100644 index 00000000..b20ebf58 --- /dev/null +++ b/src/is_newer_than/meson.build @@ -0,0 +1,6 @@ +executable('is_newer_than', + ['is_newer_than.c', misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) diff --git a/src/rc/is_older_than.c b/src/is_older_than/is_older_than.c index c9e25f30..b3f7072b 100644 --- a/src/rc/is_older_than.c +++ b/src/is_older_than/is_older_than.c @@ -16,7 +16,7 @@ #include <stdlib.h> #include "rc.h" -#include "rc-misc.h" +#include "misc.h" int main(int argc, char **argv) { diff --git a/src/is_older_than/meson.build b/src/is_older_than/meson.build new file mode 100644 index 00000000..cd4c1c43 --- /dev/null +++ b/src/is_older_than/meson.build @@ -0,0 +1,6 @@ +executable('is_older_than', + ['is_older_than.c', misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) diff --git a/src/rc/kill_all.c b/src/kill_all/kill_all.c index 551572b7..704f30b8 100644 --- a/src/rc/kill_all.c +++ b/src/kill_all/kill_all.c @@ -31,7 +31,7 @@ #include "einfo.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "_usage.h" const char *applet = NULL; diff --git a/src/kill_all/meson.build b/src/kill_all/meson.build new file mode 100644 index 00000000..177b537e --- /dev/null +++ b/src/kill_all/meson.build @@ -0,0 +1,9 @@ +if os == 'Linux' + executable('kill_all', + ['kill_all.c', usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo,librc], + install: true, + install_dir: rc_bindir) +endif diff --git a/src/libeinfo/.gitignore b/src/libeinfo/.gitignore deleted file mode 100644 index 373284db..00000000 --- a/src/libeinfo/.gitignore +++ /dev/null @@ -1 +0,0 @@ -libeinfo.so.1 diff --git a/src/libeinfo/Makefile b/src/libeinfo/Makefile deleted file mode 100644 index e6ccb650..00000000 --- a/src/libeinfo/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -LIB= einfo -SHLIB_MAJOR= 1 -SRCS= libeinfo.c -INCS= einfo.h -VERSION_MAP= einfo.map - -LOCAL_CPPFLAGS+= -I../includes - -MK= ../../mk -include ${MK}/lib.mk -include ${MK}/cc.mk -include ${MK}/termcap.mk diff --git a/src/librc/.gitignore b/src/librc/.gitignore deleted file mode 100644 index e7fafe8c..00000000 --- a/src/librc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -librc.so.1 -rc.h diff --git a/src/librc/Makefile b/src/librc/Makefile deleted file mode 100644 index 08c599ef..00000000 --- a/src/librc/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -LIB= rc -SHLIB_MAJOR= 1 -SRCS= librc.c librc-daemon.c librc-depend.c librc-misc.c \ - librc-stringlist.c -INCS= rc.h -VERSION_MAP= rc.map - -LDADD+= ${LIBKVM} - -LOCAL_CPPFLAGS+= -I../includes - -MK= ../../mk -include ${MK}/lib.mk -include ${MK}/cc.mk - -# Massage our header file for our dirs -SED_CMD= -e 's:@PREFIX@:${PREFIX}:g' -SED_CMD+= -e 's:@LIB@:${LIBNAME}:g' -SED_CMD+= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' -SED_CMD+= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' -SED_CMD+= -e 's:@BINDIR@:${BINDIR}:g' -SED_CMD+= -e 's:@SBINDIR@:${SBINDIR}:g' - -_PKG_PREFIX= -e 's:.*@PKG_PREFIX@.*:\#undef RC_PKG_PREFIX:g' -ifneq (${PKG_PREFIX},) -ifneq (${PKG_PREFIX},/) -ifneq (${PKG_PREFIX},${PREFIX}) -_PKG_PREFIX= -e 's:@PKG_PREFIX@:${PKG_PREFIX}:g' -endif -endif -endif -SED_CMD+= ${_PKG_PREFIX} - -_LCL_PREFIX= -e 's:@LOCAL_PREFIX@::g' -ifneq (${LOCAL_PREFIX},) -ifneq (${LOCAL_PREFIX},/) -ifneq (${LOCAL_PREFIX},${PREFIX}) -_LCL_PREFIX= -e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g' -endif -endif -endif -SED_CMD+= ${_LCL_PREFIX} - -%.h: %.h.in - ${SED} ${SED_CMD} $< > $@ -${SRCS}: rc.h - -CLEANFILES+= rc.h diff --git a/src/librc/librc.h b/src/librc/librc.h index 64198b2e..09ab9276 100644 --- a/src/librc/librc.h +++ b/src/librc/librc.h @@ -54,6 +54,6 @@ #endif #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #endif diff --git a/src/rc/do_mark_service.c b/src/mark_service/mark_service.c index d7b2658a..eaab6eed 100644 --- a/src/rc/do_mark_service.c +++ b/src/mark_service/mark_service.c @@ -27,7 +27,7 @@ #include "einfo.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" const char *applet = NULL; diff --git a/src/mark_service/meson.build b/src/mark_service/meson.build new file mode 100644 index 00000000..ba046dcb --- /dev/null +++ b/src/mark_service/meson.build @@ -0,0 +1,20 @@ +mark_service_execs = [ + 'mark_service_starting', + 'mark_service_started', + 'mark_service_stopping', + 'mark_service_stopped', + 'mark_service_inactive', + 'mark_service_wasinactive', + 'mark_service_hotplugged', + 'mark_service_failed', + 'mark_service_crashed', + ] + +foreach exec : mark_service_execs + executable(exec, + ['mark_service.c', misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo,librc], + install: true, + install_dir: rc_sbindir) +endforeach diff --git a/src/meson.build b/src/meson.build index d7390f54..76f6d8a1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,4 +1,36 @@ -subdir('common') +script_conf_data = configuration_data() +script_conf_data.set('SBINDIR', sbindir) + +subdir('shared') subdir('libeinfo') subdir('librc') -subdir('rc') +subdir('checkpath') +subdir('einfo') +subdir('fstabinfo') +subdir('halt') +subdir('is_newer_than') +subdir('is_older_than') +subdir('kill_all') +subdir('mark_service') +subdir('mountinfo') +subdir('on_ac_power') +subdir('openrc') +subdir('openrc-init') +subdir('openrc-run') +subdir('openrc-shutdown') +subdir('poweroff') +subdir('rc-abort') +subdir('rc-depend') +subdir('rc-service') +subdir('rc-sstat') +subdir('rc-status') +subdir('rc-update') +subdir('reboot') +subdir('service') +subdir('seedrng') +subdir('shell_var') +subdir('shutdown') +subdir('start-stop-daemon') +subdir('supervise-daemon') +subdir('swclock') +subdir('value') diff --git a/src/mountinfo/meson.build b/src/mountinfo/meson.build new file mode 100644 index 00000000..71b8a652 --- /dev/null +++ b/src/mountinfo/meson.build @@ -0,0 +1,7 @@ +executable('mountinfo', + ['mountinfo.c', misc_c, usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) diff --git a/src/rc/mountinfo.c b/src/mountinfo/mountinfo.c index 6652760d..c55b12ab 100644 --- a/src/rc/mountinfo.c +++ b/src/mountinfo/mountinfo.c @@ -42,7 +42,7 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "_usage.h" const char *applet = NULL; diff --git a/src/on_ac_power/meson.build b/src/on_ac_power/meson.build new file mode 100644 index 00000000..aedc4daa --- /dev/null +++ b/src/on_ac_power/meson.build @@ -0,0 +1,3 @@ +install_data('on_ac_power', + install_dir : rc_bindir, + install_mode: 'rwxr-xr-x') diff --git a/scripts/on_ac_power b/src/on_ac_power/on_ac_power index a4c1cf9c..a4c1cf9c 100755..100644 --- a/scripts/on_ac_power +++ b/src/on_ac_power/on_ac_power diff --git a/src/openrc-init/meson.build b/src/openrc-init/meson.build new file mode 100644 index 00000000..08cc318d --- /dev/null +++ b/src/openrc-init/meson.build @@ -0,0 +1,10 @@ +if os == 'Linux' + executable('openrc-init', + ['openrc-init.c', plugin_c, wtmp_c, version_h], + c_args : cc_selinux_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + dependencies: [dl_dep, selinux_dep], + install: true, + install_dir: sbindir) +endif diff --git a/src/rc/openrc-init.c b/src/openrc-init/openrc-init.c index 5bc53434..2e6d3677 100644 --- a/src/rc/openrc-init.c +++ b/src/openrc-init/openrc-init.c @@ -38,8 +38,8 @@ #include "helpers.h" #include "rc.h" -#include "rc-plugin.h" -#include "rc-wtmp.h" +#include "plugin.h" +#include "wtmp.h" #include "version.h" static const char *path_default = "/sbin:/usr/sbin:/bin:/usr/bin"; diff --git a/src/openrc-run/meson.build b/src/openrc-run/meson.build new file mode 100644 index 00000000..2e4b29a0 --- /dev/null +++ b/src/openrc-run/meson.build @@ -0,0 +1,17 @@ +executable('openrc-run', + ['openrc-run.c', misc_c, plugin_c, selinux_c, usage_c, version_h], + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], + link_with: [libeinfo, librc], + dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, selinux_dep, util_dep, crypt_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +executable('runscript', + ['openrc-run.c', misc_c, plugin_c, selinux_c, usage_c, version_h], + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], + link_with: [libeinfo, librc], + dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, selinux_dep, util_dep, crypt_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) diff --git a/src/rc/openrc-run.c b/src/openrc-run/openrc-run.c index ff9659a3..f9056110 100644 --- a/src/rc/openrc-run.c +++ b/src/openrc-run/openrc-run.c @@ -50,9 +50,9 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" -#include "rc-plugin.h" -#include "rc-selinux.h" +#include "misc.h" +#include "plugin.h" +#include "selinux.h" #include "_usage.h" #define PREFIX_LOCK RC_SVCDIR "/prefix.lock" diff --git a/src/rc/broadcast.c b/src/openrc-shutdown/broadcast.c index 402a9fb9..402a9fb9 100644 --- a/src/rc/broadcast.c +++ b/src/openrc-shutdown/broadcast.c diff --git a/src/rc/broadcast.h b/src/openrc-shutdown/broadcast.h index 2255fe67..2255fe67 100644 --- a/src/rc/broadcast.h +++ b/src/openrc-shutdown/broadcast.h diff --git a/src/openrc-shutdown/meson.build b/src/openrc-shutdown/meson.build new file mode 100644 index 00000000..bdd58338 --- /dev/null +++ b/src/openrc-shutdown/meson.build @@ -0,0 +1,10 @@ +if os == 'Linux' + executable('openrc-shutdown', + ['openrc-shutdown.c', 'broadcast.c', 'rc-sysvinit.c', misc_c, + usage_c, wtmp_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: sbindir) +endif diff --git a/src/rc/openrc-shutdown.c b/src/openrc-shutdown/openrc-shutdown.c index 750946f5..1234dcfc 100644 --- a/src/rc/openrc-shutdown.c +++ b/src/openrc-shutdown/openrc-shutdown.c @@ -34,9 +34,9 @@ #include "einfo.h" #include "rc.h" #include "helpers.h" -#include "rc-misc.h" +#include "misc.h" #include "rc-sysvinit.h" -#include "rc-wtmp.h" +#include "wtmp.h" #include "_usage.h" const char *applet = NULL; diff --git a/src/rc/rc-sysvinit.c b/src/openrc-shutdown/rc-sysvinit.c index 8d258b63..8d258b63 100644 --- a/src/rc/rc-sysvinit.c +++ b/src/openrc-shutdown/rc-sysvinit.c diff --git a/src/rc/rc-sysvinit.h b/src/openrc-shutdown/rc-sysvinit.h index 6142cdd6..6142cdd6 100644 --- a/src/rc/rc-sysvinit.h +++ b/src/openrc-shutdown/rc-sysvinit.h diff --git a/src/openrc/meson.build b/src/openrc/meson.build new file mode 100644 index 00000000..9ab32ef4 --- /dev/null +++ b/src/openrc/meson.build @@ -0,0 +1,17 @@ +executable('openrc', + ['rc.c', 'rc-logger.c', misc_c, plugin_c, usage_c, version_h], + c_args : cc_branding_flags, + link_with: [libeinfo, librc], + dependencies: [dl_dep, util_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +executable('rc', + ['rc.c', 'rc-logger.c', misc_c, plugin_c, usage_c, version_h], + c_args : cc_branding_flags, + link_with: [libeinfo, librc], + dependencies: [dl_dep, util_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) diff --git a/src/rc/rc-logger.c b/src/openrc/rc-logger.c index 4b1b9189..b00550a7 100644 --- a/src/rc/rc-logger.c +++ b/src/openrc/rc-logger.c @@ -44,7 +44,7 @@ #include "rc-logger.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #define TMPLOG RC_SVCDIR "/rc.log" #define DEFAULTLOG "/var/log/rc.log" diff --git a/src/rc/rc-logger.h b/src/openrc/rc-logger.h index 52ca9717..52ca9717 100644 --- a/src/rc/rc-logger.h +++ b/src/openrc/rc-logger.h diff --git a/src/rc/rc.c b/src/openrc/rc.c index 53c75bb6..bab731ed 100644 --- a/src/rc/rc.c +++ b/src/openrc/rc.c @@ -47,8 +47,8 @@ #include "queue.h" #include "rc.h" #include "rc-logger.h" -#include "rc-misc.h" -#include "rc-plugin.h" +#include "misc.h" +#include "plugin.h" #include "version.h" #include "_usage.h" diff --git a/src/poweroff/meson.build b/src/poweroff/meson.build new file mode 100644 index 00000000..c7da747f --- /dev/null +++ b/src/poweroff/meson.build @@ -0,0 +1,7 @@ +if os == 'Linux' and get_option('sysvinit') + configure_file(input : 'poweroff.in', + output : '@BASENAME@', + configuration : script_conf_data, + install_dir: sbindir, + install_mode: 'rwxr-xr-x') +endif diff --git a/scripts/poweroff.in b/src/poweroff/poweroff.in index 4e944bdc..4e944bdc 100644 --- a/scripts/poweroff.in +++ b/src/poweroff/poweroff.in diff --git a/src/rc-abort/meson.build b/src/rc-abort/meson.build new file mode 100644 index 00000000..137cd028 --- /dev/null +++ b/src/rc-abort/meson.build @@ -0,0 +1,6 @@ +executable('rc-abort', + 'rc-abort.c', + include_directories: [einfo_incdir], + link_with: [libeinfo], + install: true, + install_dir: rc_sbindir) diff --git a/src/rc/rc-abort.c b/src/rc-abort/rc-abort.c index 39a22c94..39a22c94 100644 --- a/src/rc/rc-abort.c +++ b/src/rc-abort/rc-abort.c diff --git a/src/rc-depend/meson.build b/src/rc-depend/meson.build new file mode 100644 index 00000000..6835a36e --- /dev/null +++ b/src/rc-depend/meson.build @@ -0,0 +1,7 @@ +executable('rc-depend', + ['rc-depend.c', misc_c, usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) diff --git a/src/rc/rc-depend.c b/src/rc-depend/rc-depend.c index 80754872..9f833b70 100644 --- a/src/rc/rc-depend.c +++ b/src/rc-depend/rc-depend.c @@ -34,7 +34,7 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "_usage.h" const char *applet = NULL; diff --git a/src/rc-service/meson.build b/src/rc-service/meson.build new file mode 100644 index 00000000..3a109d8e --- /dev/null +++ b/src/rc-service/meson.build @@ -0,0 +1,7 @@ +executable('rc-service', + ['rc-service.c', misc_c, usage_c, version_h], + c_args : cc_branding_flags, + link_with: [libeinfo, librc], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) diff --git a/src/rc/rc-service.c b/src/rc-service/rc-service.c index 44651cc6..69acac19 100644 --- a/src/rc/rc-service.c +++ b/src/rc-service/rc-service.c @@ -24,7 +24,7 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "_usage.h" const char *applet = NULL; diff --git a/src/rc-sstat/meson.build b/src/rc-sstat/meson.build new file mode 100644 index 00000000..85b7a5f0 --- /dev/null +++ b/src/rc-sstat/meson.build @@ -0,0 +1,5 @@ +if os == 'Linux' + install_data('rc-sstat', + install_dir: sbindir, + install_mode: 'rwxr-xr-x') +endif diff --git a/scripts/rc-sstat.in b/src/rc-sstat/rc-sstat index 4811293d..4811293d 100644 --- a/scripts/rc-sstat.in +++ b/src/rc-sstat/rc-sstat diff --git a/src/rc-status/meson.build b/src/rc-status/meson.build new file mode 100644 index 00000000..7377d837 --- /dev/null +++ b/src/rc-status/meson.build @@ -0,0 +1,8 @@ +executable('rc-status', + ['rc-status.c', misc_c, usage_c, version_h], + c_args : cc_branding_flags, + link_with: [libeinfo, librc], + dependencies: [util_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: bindir) diff --git a/src/rc/rc-status.c b/src/rc-status/rc-status.c index 7eb152ec..cb701e24 100644 --- a/src/rc/rc-status.c +++ b/src/rc-status/rc-status.c @@ -25,7 +25,7 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "_usage.h" enum format_t { diff --git a/src/rc-update/meson.build b/src/rc-update/meson.build new file mode 100644 index 00000000..7d284979 --- /dev/null +++ b/src/rc-update/meson.build @@ -0,0 +1,7 @@ +executable('rc-update', + ['rc-update.c', misc_c, usage_c, version_h], + c_args : cc_branding_flags, + link_with: [libeinfo, librc], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) diff --git a/src/rc/rc-update.c b/src/rc-update/rc-update.c index d6dbf240..445db4e8 100644 --- a/src/rc/rc-update.c +++ b/src/rc-update/rc-update.c @@ -27,7 +27,7 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "_usage.h" const char *applet = NULL; diff --git a/src/rc/.gitignore b/src/rc/.gitignore deleted file mode 100644 index a43088aa..00000000 --- a/src/rc/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -version.h -rc-status -rc-service -rc-update -runscript -service -start-stop-daemon -supervise-daemon -einfon -einfo -ewarnn -ewarn -eerrorn -eerror -ebegin -eend -ewend -eindent -eoutdent -esyslog -eval_ecolors -ewaitfile -veinfo -vewarn -vebegin -veend -vewend -veindent -veoutdent -service_starting -service_started -service_stopping -service_stopped -service_inactive -service_wasinactive -service_hotplugged -service_started_daemon -service_crashed -checkpath -fstabinfo -mountinfo -swclock -rc-depend -service_get_value -service_set_value -get_options -save_options -shell_var -is_newer_than -is_older_than -mark_service_starting -mark_service_started -mark_service_stopping -mark_service_stopped -mark_service_inactive -mark_service_wasinactive -mark_service_hotplugged -mark_service_failed -mark_service_crashed -rc-abort -rc -openrc -openrc-init -openrc-run -openrc-shutdown -kill_all diff --git a/src/rc/Makefile b/src/rc/Makefile deleted file mode 100644 index 306f6d8d..00000000 --- a/src/rc/Makefile +++ /dev/null @@ -1,186 +0,0 @@ -include ../../Makefile.inc -MK= ../../mk -include ${MK}/os.mk - -SRCS= checkpath.c do_e.c do_mark_service.c do_service.c \ - do_value.c fstabinfo.c is_newer_than.c is_older_than.c \ - mountinfo.c openrc-run.c rc-abort.c rc.c \ - rc-depend.c rc-logger.c rc-misc.c rc-pipes.c \ - rc-plugin.c rc-service.c rc-status.c rc-update.c \ - shell_var.c start-stop-daemon.c supervise-daemon.c swclock.c _usage.c - -ifeq (${MKSELINUX},yes) -SRCS+= rc-selinux.c -endif - -ifeq (${OS},Linux) -SRCS+= kill_all.c openrc-init.c openrc-shutdown.c rc-sysvinit.c broadcast.c \ - rc-wtmp.c seedrng.c -endif - -CLEANFILES= version.h rc-selinux.o - -BINDIR= ${PREFIX}/bin -SBINDIR= ${PREFIX}/sbin -LINKDIR= ${LIBEXECDIR} - -BINPROGS= rc-status -SBINPROGS = openrc openrc-run rc rc-service rc-update runscript \ - start-stop-daemon supervise-daemon -RC_BINPROGS= einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \ - eindent eoutdent esyslog eval_ecolors ewaitfile \ - veinfo vewarn vebegin veend vewend veindent veoutdent \ - checkpath fstabinfo mountinfo rc-depend \ - is_newer_than is_older_than \ - service_get_value service_set_value get_options save_options \ - service_starting service_started \ - service_stopping service_stopped \ - service_inactive service_wasinactive \ - service_hotplugged service_started_daemon service_crashed \ - shell_var -RC_SBINPROGS= mark_service_starting mark_service_started \ - mark_service_stopping mark_service_stopped \ - mark_service_inactive mark_service_wasinactive \ - mark_service_hotplugged mark_service_failed \ - mark_service_crashed \ - rc-abort swclock - -ifeq (${OS},Linux) -RC_BINPROGS+= kill_all -RC_SBINPROGS+= seedrng -SBINPROGS+= openrc-init openrc-shutdown -endif - -ALL_PROGS= ${BINPROGS} ${SBINPROGS} ${RC_BINPROGS} ${RC_SBINPROGS} -CLEANFILES+= ${ALL_PROGS} - -LOCAL_CPPFLAGS=-I../includes -I../librc -I../libeinfo -LOCAL_LDFLAGS=-L../librc -L../libeinfo -LDADD+= -lutil -lrc -leinfo - -include ${MK}/prog.mk -include ${MK}/gitver.mk -include ${MK}/cc.mk - -include ${MK}/termcap.mk -LDADD+= ${LIBDL} ${LIBKVM} -include ${MK}/pam.mk - -${SRCS}: version.h - -.PHONY: version.h.tmp -version.h.tmp: - echo "#define VERSION \"${VERSION}${GITVER}\"" >$@ - if test -n "${BRANDING}"; then \ - echo "#define BRANDING \"${BRANDING}\"" >> $@; \ - fi - -version.h: version.h.tmp - cmp -s $@.tmp $@ && rm $@.tmp || mv $@.tmp $@ - -install: all - ${INSTALL} -d ${DESTDIR}${SBINDIR} - ${INSTALL} -m ${BINMODE} ${SBINPROGS} ${DESTDIR}${SBINDIR} - ${INSTALL} -d ${DESTDIR}${BINDIR} - ${INSTALL} -m ${BINMODE} ${BINPROGS} ${DESTDIR}${BINDIR} - ${INSTALL} -d ${DESTDIR}${LINKDIR}/bin - ${INSTALL} -m ${BINMODE} ${RC_BINPROGS} ${DESTDIR}${LINKDIR}/bin - ${INSTALL} -d ${DESTDIR}${LINKDIR}/sbin - ${INSTALL} -m ${BINMODE} ${RC_SBINPROGS} ${DESTDIR}${LINKDIR}/sbin - if test "${MKPAM}" = pam; then \ - ${INSTALL} -d ${DESTDIR}${PAMDIR}; \ - ${INSTALL} -m ${PAMMODE} start-stop-daemon.pam ${DESTDIR}${PAMDIR}/start-stop-daemon; \ - ${INSTALL} -m ${PAMMODE} supervise-daemon.pam ${DESTDIR}${PAMDIR}/supervise-daemon; \ - fi - -check test:: - -all: ${ALL_PROGS} - -checkpath: checkpath.o _usage.o rc-misc.o -ifeq (${MKSELINUX},yes) -checkpath: rc-selinux.o -endif - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -kill_all: kill_all.o _usage.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \ -eindent eoutdent esyslog eval_ecolors ewaitfile \ -veinfo vewarn vebegin veend vewend veindent veoutdent: do_e.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -fstabinfo: fstabinfo.o _usage.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -openrc-init: openrc-init.o rc-plugin.o rc-wtmp.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -is_newer_than: is_newer_than.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -is_older_than: is_older_than.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -mark_service_starting mark_service_started \ -mark_service_stopping mark_service_stopped \ -mark_service_inactive mark_service_wasinactive \ -mark_service_hotplugged mark_service_failed \ -mark_service_crashed: do_mark_service.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -mountinfo: mountinfo.o _usage.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -openrc rc: rc.o rc-logger.o rc-misc.o rc-plugin.o _usage.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -openrc-shutdown: openrc-shutdown.o rc-misc.o _usage.o broadcast.o rc-wtmp.o rc-sysvinit.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -openrc-run runscript: openrc-run.o _usage.o rc-misc.o rc-plugin.o -ifeq (${MKSELINUX},yes) -openrc-run runscript: rc-selinux.o -endif - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -rc-abort: rc-abort.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ -leinfo - -rc-depend: rc-depend.o _usage.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -rc-status: rc-status.o _usage.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -rc-service: rc-service.o _usage.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -rc-update: rc-update.o _usage.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -start-stop-daemon: start-stop-daemon.o _usage.o rc-misc.o rc-pipes.o rc-schedules.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -supervise-daemon: supervise-daemon.o _usage.o rc-misc.o rc-plugin.o rc-schedules.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -service_get_value service_set_value get_options save_options: do_value.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -service_starting service_started \ -service_stopping service_stopped \ -service_inactive service_wasinactive \ -service_hotplugged service_started_daemon \ -service_crashed: do_service.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -shell_var: shell_var.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ - -swclock: swclock.o _usage.o rc-misc.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} - -seedrng: seedrng.o _usage.o - ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} diff --git a/src/rc/meson.build b/src/rc/meson.build deleted file mode 100644 index edea4a16..00000000 --- a/src/rc/meson.build +++ /dev/null @@ -1,320 +0,0 @@ -rc_misc_c = files([ - 'rc-misc.c', - ]) - -rc_plugin_c = files([ - 'rc-plugin.c', - ]) - -rc_schedules_c = files([ - 'rc-schedules.c', - ]) - -usage_c = files([ - '_usage.c', - ]) - -if selinux_dep.found() - rc_selinux_c = files([ - 'rc-selinux.c', - ]) -else - rc_selinux_c = [] -endif - -rc_wtmp_c = files([ - 'rc-wtmp.c', - ]) - -executable('rc-status', - ['rc-status.c', rc_misc_c, usage_c, version_h], - c_args : cc_branding_flags, - link_with: [libeinfo, librc], - dependencies: [util_dep], - include_directories: [incdir, einfo_incdir, rc_incdir], - install: true, - install_dir: bindir) - -executable('openrc', - ['rc.c', 'rc-logger.c', rc_misc_c, rc_plugin_c, usage_c, - version_h], - c_args : cc_branding_flags, - link_with: [libeinfo, librc], - dependencies: [dl_dep, util_dep], - include_directories: [incdir, einfo_incdir, rc_incdir], - install: true, - install_dir: sbindir) - -executable('openrc-run', - ['openrc-run.c', rc_misc_c, rc_plugin_c, usage_c, - rc_selinux_c, version_h], - c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], - link_with: [libeinfo, librc], - dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, selinux_dep, util_dep, crypt_dep], - include_directories: [incdir, einfo_incdir, rc_incdir], - install: true, - install_dir: sbindir) - -executable('rc', - ['rc.c', 'rc-logger.c', rc_misc_c, rc_plugin_c, usage_c, version_h], - c_args : cc_branding_flags, - link_with: [libeinfo, librc], - dependencies: [dl_dep, util_dep], - include_directories: [incdir, einfo_incdir, rc_incdir], - install: true, - install_dir: sbindir) - -executable('rc-service', - ['rc-service.c', rc_misc_c, usage_c, version_h], - c_args : cc_branding_flags, - link_with: [libeinfo, librc], - include_directories: [incdir, einfo_incdir, rc_incdir], - install: true, - install_dir: sbindir) - -executable('rc-update', - ['rc-update.c', rc_misc_c, usage_c, version_h], - c_args : cc_branding_flags, - link_with: [libeinfo, librc], - include_directories: [incdir, einfo_incdir, rc_incdir], - install: true, - install_dir: sbindir) - -executable('runscript', - ['openrc-run.c', rc_misc_c, usage_c, 'rc-plugin.c', - rc_selinux_c, version_h], - c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], - link_with: [libeinfo, librc], - dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, util_dep, selinux_dep, crypt_dep], - include_directories: [incdir, einfo_incdir, rc_incdir], - install: true, - install_dir: sbindir) - -executable('start-stop-daemon', - ['start-stop-daemon.c', 'rc-pipes.c', rc_misc_c, rc_schedules_c, - rc_selinux_c, usage_c, version_h], - c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_cap_flags, cc_selinux_flags], - link_with: [libeinfo, librc], - dependencies: [audit_dep, dl_dep, pam_dep, cap_dep, pam_misc_dep, util_dep, selinux_dep, crypt_dep], - include_directories: [incdir, einfo_incdir, rc_incdir], - install: true, - install_dir: sbindir) - -if get_option('pam') - install_data('start-stop-daemon.pam', - rename : 'start-stop-daemon', - install_dir : pamdir) -endif - -executable('supervise-daemon', - ['supervise-daemon.c', rc_misc_c, rc_plugin_c, rc_schedules_c, - usage_c, version_h], - c_args : [cc_branding_flags, cc_pam_flags, cc_cap_flags, cc_selinux_flags], - link_with: [libeinfo, librc], - dependencies: [dl_dep, pam_dep, cap_dep, util_dep, selinux_dep], - include_directories: [incdir, einfo_incdir, rc_incdir], - install: true, - install_dir: sbindir) - -if get_option('pam') - install_data('supervise-daemon.pam', - rename : 'supervise-daemon', - install_dir : pamdir) -endif - -if os == 'Linux' - executable('openrc-init', - ['openrc-init.c', rc_plugin_c, rc_wtmp_c, version_h], - c_args : cc_selinux_flags, - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - dependencies: [dl_dep, selinux_dep], - install: true, - install_dir: sbindir) - - executable('openrc-shutdown', - ['openrc-shutdown.c', 'broadcast.c', 'rc-sysvinit.c', rc_misc_c, - usage_c, rc_wtmp_c, version_h], - c_args : cc_branding_flags, - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - install: true, - install_dir: sbindir) -endif - -einfo_execs = [ - 'einfon', - 'einfo', - 'ewarnn', - 'ewarn', - 'eerrorn', - 'eerror', - 'ebegin', - 'eend', - 'ewend', - 'eindent', - 'eoutdent', - 'esyslog', - 'eval_ecolors', - 'ewaitfile', - 'veinfo', - 'vewarn', - 'vebegin', - 'veend', - 'vewend', - 'veindent', - 'veoutdent', - ] - -foreach exec: einfo_execs - executable(exec, - ['do_e.c', rc_misc_c, version_h], - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - install: true, - install_dir: rc_bindir) -endforeach - -executable('checkpath', - ['checkpath.c', rc_misc_c, usage_c, rc_selinux_c, - version_h], - c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - dependencies: [audit_dep, pam_dep, pam_misc_dep, selinux_dep, crypt_dep], - install: true, - install_dir: rc_bindir) - -executable('fstabinfo', - ['fstabinfo.c', rc_misc_c, usage_c, version_h], - c_args : cc_branding_flags, - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - install: true, - install_dir: rc_bindir) - -executable('mountinfo', - ['mountinfo.c', rc_misc_c, usage_c, version_h], - c_args : cc_branding_flags, - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - install: true, - install_dir: rc_bindir) - -executable('rc-depend', - ['rc-depend.c', rc_misc_c, usage_c, version_h], - c_args : cc_branding_flags, - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - install: true, - install_dir: rc_bindir) - -executable('is_newer_than', - ['is_newer_than.c', rc_misc_c, version_h], - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - install: true, - install_dir: rc_bindir) - -executable('is_older_than', - ['is_older_than.c', rc_misc_c, version_h], - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - install: true, - install_dir: rc_bindir) - -service_execs = [ - 'service_starting', - 'service_started', - 'service_stopping', - 'service_stopped', - 'service_inactive', - 'service_wasinactive', - 'service_hotplugged', - 'service_started_daemon', - 'service_crashed', - ] - -foreach exec : service_execs - executable(exec, - ['do_service.c', rc_misc_c, version_h], - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - install: true, - install_dir: rc_bindir) -endforeach - -value_execs = [ - 'service_get_value', - 'service_set_value', - 'get_options', - 'save_options', - ] - -foreach exec : value_execs - executable(exec, - ['do_value.c', rc_misc_c, version_h], - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - install: true, - install_dir: rc_bindir) -endforeach - -if os == 'Linux' - executable('kill_all', - ['kill_all.c', usage_c, version_h], - c_args : cc_branding_flags, - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo,librc], - install: true, - install_dir: rc_bindir) - - executable('seedrng', - ['seedrng.c', usage_c, version_h], - c_args : cc_branding_flags, - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo, librc], - install: true, - install_dir: rc_sbindir) -endif - -executable('shell_var', - ['shell_var.c'], - install: true, - install_dir: rc_bindir) - -mark_service_execs = [ - 'mark_service_starting', - 'mark_service_started', - 'mark_service_stopping', - 'mark_service_stopped', - 'mark_service_inactive', - 'mark_service_wasinactive', - 'mark_service_hotplugged', - 'mark_service_failed', - 'mark_service_crashed', - ] - -foreach exec : mark_service_execs - executable(exec, - ['do_mark_service.c', rc_misc_c, version_h], - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo,librc], - install: true, - install_dir: rc_sbindir) -endforeach - -executable('rc-abort', - 'rc-abort.c', - include_directories: [einfo_incdir], - link_with: [libeinfo], - install: true, - install_dir: rc_sbindir) - -executable('swclock', - ['swclock.c', rc_misc_c, usage_c, version_h], - c_args : cc_branding_flags, - include_directories: [incdir, einfo_incdir, rc_incdir], - link_with: [libeinfo,librc], - install: true, - install_dir: rc_sbindir) diff --git a/src/reboot/meson.build b/src/reboot/meson.build new file mode 100644 index 00000000..a9a4ca54 --- /dev/null +++ b/src/reboot/meson.build @@ -0,0 +1,7 @@ +if os == 'Linux' and get_option('sysvinit') + configure_file(input : 'reboot.in', + output : '@BASENAME@', + configuration : script_conf_data, + install_dir: sbindir, + install_mode: 'rwxr-xr-x') +endif diff --git a/scripts/reboot.in b/src/reboot/reboot.in index bf50967a..bf50967a 100644 --- a/scripts/reboot.in +++ b/src/reboot/reboot.in diff --git a/src/seedrng/meson.build b/src/seedrng/meson.build new file mode 100644 index 00000000..827c3506 --- /dev/null +++ b/src/seedrng/meson.build @@ -0,0 +1,9 @@ +if os == 'Linux' + executable('seedrng', + ['seedrng.c', usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_sbindir) +endif diff --git a/src/rc/seedrng.c b/src/seedrng/seedrng.c index 95fb947d..95fb947d 100644 --- a/src/rc/seedrng.c +++ b/src/seedrng/seedrng.c diff --git a/src/service/meson.build b/src/service/meson.build new file mode 100644 index 00000000..b3a86f6d --- /dev/null +++ b/src/service/meson.build @@ -0,0 +1,20 @@ +service_execs = [ + 'service_starting', + 'service_started', + 'service_stopping', + 'service_stopped', + 'service_inactive', + 'service_wasinactive', + 'service_hotplugged', + 'service_started_daemon', + 'service_crashed', + ] + +foreach exec : service_execs + executable(exec, + ['service.c', misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) +endforeach diff --git a/src/rc/do_service.c b/src/service/service.c index eca498a6..001d3ad3 100644 --- a/src/rc/do_service.c +++ b/src/service/service.c @@ -27,7 +27,7 @@ #include "einfo.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" const char *applet = NULL; diff --git a/src/rc/_usage.c b/src/shared/_usage.c index ed4c63e0..bba03b92 100644 --- a/src/rc/_usage.c +++ b/src/shared/_usage.c @@ -14,7 +14,7 @@ #include <stdio.h> #include <stdlib.h> #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "_usage.h" #include "version.h" diff --git a/src/rc/_usage.h b/src/shared/_usage.h index 62c131d4..62c131d4 100644 --- a/src/rc/_usage.h +++ b/src/shared/_usage.h diff --git a/src/includes/helpers.h b/src/shared/helpers.h index 44d76552..44d76552 100644 --- a/src/includes/helpers.h +++ b/src/shared/helpers.h diff --git a/src/shared/meson.build b/src/shared/meson.build new file mode 100644 index 00000000..b80b242e --- /dev/null +++ b/src/shared/meson.build @@ -0,0 +1,35 @@ +misc_c = files([ + 'misc.c', + ]) + +plugin_c = files([ + 'plugin.c', + ]) + +schedules_c = files([ + 'schedules.c', + ]) + +if selinux_dep.found() + selinux_c = files([ + 'selinux.c', + ]) +else + selinux_c = [] +endif + +wtmp_c = files([ + 'wtmp.c', + ]) + +usage_c = files([ + '_usage.c', + ]) + +version_h = vcs_tag( + input : 'version.h.in', + output : 'version.h') + +version_f = vcs_tag( + input : 'version.in', + output : 'version') diff --git a/src/rc/rc-misc.c b/src/shared/misc.c index 1ca51e72..d8e4d5e6 100644 --- a/src/rc/rc-misc.c +++ b/src/shared/misc.c @@ -1,6 +1,6 @@ /* - * rc-misc.c - * rc misc functions + * misc.c + * misc functions */ /* @@ -38,7 +38,7 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "version.h" extern char **environ; diff --git a/src/includes/rc-misc.h b/src/shared/misc.h index 8e37608f..6821038d 100644 --- a/src/includes/rc-misc.h +++ b/src/shared/misc.h @@ -1,5 +1,5 @@ /* - * rc-misc.h + * misc.h * This is private to us and not for user consumption */ diff --git a/src/rc/rc-plugin.c b/src/shared/plugin.c index 76995866..cce845fa 100644 --- a/src/rc/rc-plugin.c +++ b/src/shared/plugin.c @@ -1,5 +1,5 @@ /* - * rc-plugin.c + * plugin.c * Simple plugin handler */ @@ -32,8 +32,8 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" -#include "rc-plugin.h" +#include "misc.h" +#include "plugin.h" #define RC_PLUGIN_HOOK "rc_plugin_hook" diff --git a/src/rc/rc-plugin.h b/src/shared/plugin.h index 8422adec..db4b6878 100644 --- a/src/rc/rc-plugin.h +++ b/src/shared/plugin.h @@ -1,5 +1,5 @@ /* - * rc-plugin.h + * plugin.h * Private instructions to use plugins */ diff --git a/src/includes/queue.h b/src/shared/queue.h index 67f801d7..67f801d7 100644 --- a/src/includes/queue.h +++ b/src/shared/queue.h diff --git a/src/rc/rc-schedules.c b/src/shared/schedules.c index 5938086d..b1eb85ad 100644 --- a/src/rc/rc-schedules.c +++ b/src/shared/schedules.c @@ -39,8 +39,8 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" -#include "rc-schedules.h" +#include "misc.h" +#include "schedules.h" #include "helpers.h" typedef struct scheduleitem { diff --git a/src/rc/rc-schedules.h b/src/shared/schedules.h index 5fb9e526..5fb9e526 100644 --- a/src/rc/rc-schedules.h +++ b/src/shared/schedules.h diff --git a/src/rc/rc-selinux.c b/src/shared/selinux.c index 8364a5f0..213a00f1 100644 --- a/src/rc/rc-selinux.c +++ b/src/shared/selinux.c @@ -1,5 +1,5 @@ /* - * rc-selinux.c + * selinux.c * SELinux helpers to get and set contexts. */ @@ -34,9 +34,9 @@ #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" -#include "rc-plugin.h" -#include "rc-selinux.h" +#include "misc.h" +#include "plugin.h" +#include "selinux.h" /* the context files for selinux */ #define INITRC_FILE "initrc_context" diff --git a/src/rc/rc-selinux.h b/src/shared/selinux.h index 627c87bc..627c87bc 100644 --- a/src/rc/rc-selinux.h +++ b/src/shared/selinux.h diff --git a/src/common/version.h.in b/src/shared/version.h.in index 4f228f55..4f228f55 100644 --- a/src/common/version.h.in +++ b/src/shared/version.h.in diff --git a/src/common/version.in b/src/shared/version.in index 42179405..42179405 100644 --- a/src/common/version.in +++ b/src/shared/version.in diff --git a/src/rc/rc-wtmp.c b/src/shared/wtmp.c index 42e228d0..5881aeba 100644 --- a/src/rc/rc-wtmp.c +++ b/src/shared/wtmp.c @@ -1,5 +1,5 @@ /* - * rc-wtmp.c + * wtmp.c * This file contains routines to deal with the wtmp file. */ @@ -24,7 +24,7 @@ #include <sys/types.h> #include <sys/utsname.h> -#include "rc-wtmp.h" +#include "wtmp.h" void log_wtmp(const char *user, const char *id, pid_t pid, int type, const char *line) diff --git a/src/includes/rc-wtmp.h b/src/shared/wtmp.h index edab322c..edab322c 100644 --- a/src/includes/rc-wtmp.h +++ b/src/shared/wtmp.h diff --git a/src/shell_var/meson.build b/src/shell_var/meson.build new file mode 100644 index 00000000..33fc5c2a --- /dev/null +++ b/src/shell_var/meson.build @@ -0,0 +1,4 @@ +executable('shell_var', + ['shell_var.c'], + install: true, + install_dir: rc_bindir) diff --git a/src/rc/shell_var.c b/src/shell_var/shell_var.c index 70750245..70750245 100644 --- a/src/rc/shell_var.c +++ b/src/shell_var/shell_var.c diff --git a/src/shutdown/meson.build b/src/shutdown/meson.build new file mode 100644 index 00000000..2d6f726d --- /dev/null +++ b/src/shutdown/meson.build @@ -0,0 +1,7 @@ +if os == 'Linux' and get_option('sysvinit') + configure_file(input : 'shutdown.in', + output : '@BASENAME@', + configuration : script_conf_data, + install_dir: sbindir, + install_mode: 'rwxr-xr-x') +endif diff --git a/scripts/shutdown.in b/src/shutdown/shutdown.in index 23e5e31d..23e5e31d 100644 --- a/scripts/shutdown.in +++ b/src/shutdown/shutdown.in diff --git a/src/start-stop-daemon/meson.build b/src/start-stop-daemon/meson.build new file mode 100644 index 00000000..39229132 --- /dev/null +++ b/src/start-stop-daemon/meson.build @@ -0,0 +1,15 @@ +executable('start-stop-daemon', + ['start-stop-daemon.c', 'rc-pipes.c', misc_c, schedules_c, + selinux_c, usage_c, version_h], + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_cap_flags, cc_selinux_flags], + link_with: [libeinfo, librc], + dependencies: [audit_dep, dl_dep, pam_dep, cap_dep, pam_misc_dep, util_dep, selinux_dep, crypt_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +if get_option('pam') + install_data('start-stop-daemon.pam', + rename : 'start-stop-daemon', + install_dir : pamdir) +endif diff --git a/src/rc/rc-pipes.c b/src/start-stop-daemon/rc-pipes.c index b4e60e03..b4e60e03 100644 --- a/src/rc/rc-pipes.c +++ b/src/start-stop-daemon/rc-pipes.c diff --git a/src/rc/rc-pipes.h b/src/start-stop-daemon/rc-pipes.h index 861963b7..861963b7 100644 --- a/src/rc/rc-pipes.h +++ b/src/start-stop-daemon/rc-pipes.h diff --git a/src/rc/start-stop-daemon.c b/src/start-stop-daemon/start-stop-daemon.c index db97f3b3..75b9a15c 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/start-stop-daemon/start-stop-daemon.c @@ -70,9 +70,9 @@ static struct pam_conv conv = { NULL, NULL}; #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "rc-pipes.h" -#include "rc-schedules.h" +#include "schedules.h" #include "_usage.h" #include "helpers.h" diff --git a/src/rc/start-stop-daemon.pam b/src/start-stop-daemon/start-stop-daemon.pam index a1bada22..a1bada22 100644 --- a/src/rc/start-stop-daemon.pam +++ b/src/start-stop-daemon/start-stop-daemon.pam diff --git a/src/supervise-daemon/meson.build b/src/supervise-daemon/meson.build new file mode 100644 index 00000000..808114f0 --- /dev/null +++ b/src/supervise-daemon/meson.build @@ -0,0 +1,14 @@ +executable('supervise-daemon', + ['supervise-daemon.c', misc_c, plugin_c, schedules_c, usage_c, version_h], + c_args : [cc_branding_flags, cc_pam_flags, cc_cap_flags, cc_selinux_flags], + link_with: [libeinfo, librc], + dependencies: [dl_dep, pam_dep, cap_dep, util_dep, selinux_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +if get_option('pam') + install_data('supervise-daemon.pam', + rename : 'supervise-daemon', + install_dir : pamdir) +endif diff --git a/src/rc/supervise-daemon.c b/src/supervise-daemon/supervise-daemon.c index 93deedcd..194ef9df 100644 --- a/src/rc/supervise-daemon.c +++ b/src/supervise-daemon/supervise-daemon.c @@ -65,9 +65,9 @@ static struct pam_conv conv = { NULL, NULL}; #include "einfo.h" #include "queue.h" #include "rc.h" -#include "rc-misc.h" -#include "rc-plugin.h" -#include "rc-schedules.h" +#include "misc.h" +#include "plugin.h" +#include "schedules.h" #include "_usage.h" #include "helpers.h" diff --git a/src/rc/supervise-daemon.pam b/src/supervise-daemon/supervise-daemon.pam index a1bada22..a1bada22 100644 --- a/src/rc/supervise-daemon.pam +++ b/src/supervise-daemon/supervise-daemon.pam diff --git a/src/swclock/meson.build b/src/swclock/meson.build new file mode 100644 index 00000000..1a85f115 --- /dev/null +++ b/src/swclock/meson.build @@ -0,0 +1,7 @@ +executable('swclock', + ['swclock.c', misc_c, usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo,librc], + install: true, + install_dir: rc_sbindir) diff --git a/src/rc/swclock.c b/src/swclock/swclock.c index 7f63d680..5fc5d395 100644 --- a/src/rc/swclock.c +++ b/src/swclock/swclock.c @@ -31,7 +31,7 @@ #include "einfo.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" #include "_usage.h" #define RC_SHUTDOWNTIME RC_SVCDIR "/shutdowntime" diff --git a/src/value/meson.build b/src/value/meson.build new file mode 100644 index 00000000..da958f01 --- /dev/null +++ b/src/value/meson.build @@ -0,0 +1,15 @@ +value_execs = [ + 'service_get_value', + 'service_set_value', + 'get_options', + 'save_options', + ] + +foreach exec : value_execs + executable(exec, + ['value.c', misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) +endforeach diff --git a/src/rc/do_value.c b/src/value/value.c index 9ec5facf..f7089de4 100644 --- a/src/rc/do_value.c +++ b/src/value/value.c @@ -29,7 +29,7 @@ #include "einfo.h" #include "rc.h" -#include "rc-misc.h" +#include "misc.h" const char *applet = NULL; diff --git a/support/Makefile b/support/Makefile deleted file mode 100644 index ca27cd7e..00000000 --- a/support/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2017 the OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -MK= ../mk -include ${MK}/os.mk - -SUBDIR= deptree2dot init.d.examples openvpn - -ifeq (${OS},Linux) -SUBDIR+= sysvinit -endif - -include ${MK}/subdir.mk diff --git a/support/deptree2dot/Makefile b/support/deptree2dot/Makefile deleted file mode 100644 index b7f6e392..00000000 --- a/support/deptree2dot/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -MK= ../../mk -include ${MK}/os.mk - -DIR= ${DATADIR}/support/deptree2dot -BIN= deptree2dot -INC= README.md - - -include ${MK}/scripts.mk diff --git a/support/init.d.examples/.gitignore b/support/init.d.examples/.gitignore deleted file mode 100644 index 9f1ce287..00000000 --- a/support/init.d.examples/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -avahi-dnsconfd -avahid -dhcpcd -dbus -hald -named -ntpd -openvpn -polkitd -sshd -wpa_supplicant diff --git a/support/init.d.examples/Makefile b/support/init.d.examples/Makefile deleted file mode 100644 index 0c043251..00000000 --- a/support/init.d.examples/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -DIR= ${DATADIR}/support/init.d.examples -INC= README.md -SRCS= avahi-dnsconfd.in avahid.in dhcpcd.in dbus.in \ - hald.in named.in ntpd.in \ - openvpn.in polkitd.in sshd.in wpa_supplicant.in -BIN= ${OBJS} - -MK= ../../mk - -include ${MK}/os.mk -include ${MK}/scripts.mk diff --git a/support/openvpn/Makefile b/support/openvpn/Makefile deleted file mode 100644 index d836f084..00000000 --- a/support/openvpn/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -MK= ../../mk -include ${MK}/os.mk - -DIR= ${DATADIR}/support/openvpn -BIN= down.sh up.sh -INC= README.md - - -include ${MK}/scripts.mk diff --git a/support/sysvinit/Makefile b/support/sysvinit/Makefile deleted file mode 100644 index 940c9746..00000000 --- a/support/sysvinit/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -MK= ../../mk -include ${MK}/os.mk - -DIR= ${DATADIR}/support/sysvinit -INC= halt.sh inittab README.md - - -include ${MK}/scripts.mk diff --git a/sysctl.d/Makefile b/sysctl.d/Makefile deleted file mode 100644 index feaf9183..00000000 --- a/sysctl.d/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -DIR= ${SYSCTLDIR} -CONF= README - -MK= ../mk -include ${MK}/os.mk -include ${MK}/scripts.mk diff --git a/test/Makefile b/test/Makefile deleted file mode 100644 index b57b8903..00000000 --- a/test/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -all: - -install: - -ignore: - -check test:: - ./runtests.sh - -verbose-test: - VERBOSE=yes ./runtests.sh - -clean: - rm -rf *.out tmp-* diff --git a/tools/meson_final.sh b/tools/meson_final.sh index 4fda3136..92380ede 100755 --- a/tools/meson_final.sh +++ b/tools/meson_final.sh @@ -10,4 +10,4 @@ if [ ${os} != Linux ]; then install -d "${DESTDIR}/${rc_libexecdir}"/init.d fi install -d "${DESTDIR}/${rc_libexecdir}"/tmp -install -m 644 "${MESON_BUILD_ROOT}/src/common/version" "${DESTDIR}/${rc_libexecdir}" +install -m 644 "${MESON_BUILD_ROOT}/src/shared/version" "${DESTDIR}/${rc_libexecdir}" diff --git a/zsh-completion/Makefile b/zsh-completion/Makefile deleted file mode 100644 index 9654dbb4..00000000 --- a/zsh-completion/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -DIR= ${ZSHCOMPDIR} -CONF= _openrc \ - _rc-service \ - _rc-status \ - _rc-update \ - -MK= ../mk -include ${MK}/os.mk - -include ${MK}/scripts.mk |