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.
This commit is contained in:
William Hubbs 2022-04-06 10:51:55 -05:00
parent 0efc1b133e
commit 391d12db48
154 changed files with 430 additions and 2027 deletions

6
.gitignore vendored
View File

@ -9,8 +9,4 @@ core
.gdb_history .gdb_history
.gdbinit .gdbinit
.depend build
*.a
*.o
*.So
lib*.so

View File

@ -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

View File

@ -1,3 +0,0 @@
NAME= openrc
VERSION= 0.44
PKG= ${NAME}-${VERSION}

View File

@ -4,6 +4,10 @@ OpenRC NEWS
This file will contain a list of notable changes for each release. Note This file will contain a list of notable changes for each release. Note
the information in this file is in reverse order. 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 ## OpenRC 0.44
This version is the first to use a meson-based build system. This version is the first to use a meson-based build system.

View File

@ -9,72 +9,16 @@ system-provided init program, normally `/sbin/init`.
OpenRC uses the [meson](http://mesonbuild.com) build system, so use the OpenRC uses the [meson](http://mesonbuild.com) build system, so use the
usual methods for this build system to build and install. 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 ## Notes
We don't support building a static OpenRC with PAM. 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. `PKG_PREFIX` should be set to where packages install to by default.
`LOCAL_PREFIX` should be set to where user maintained packages are. `LOCAL_PREFIX` should be set to where user maintained packages are.
Only set `LOCAL_PREFIX` if different from `PKG_PREFIX`. Only set `LOCAL_PREFIX` if different from `PKG_PREFIX`.
`PREFIX` should be set when OpenRC is not installed to /. `ROOTPREFIX` should be set when the root path is different from '/'.
If any of the following files exist then we do not overwrite them
```
/etc/devd.conf
/etc/rc
/etc/rc.shutdown
/etc/conf.d/*
```
`rc` and `rc.shutdown` are the hooks from the BSD init into OpenRC. `rc` and `rc.shutdown` are the hooks from the BSD init into OpenRC.

View File

@ -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

View File

@ -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

2
etc/.gitignore vendored
View File

@ -1,2 +0,0 @@
rc
rc.shutdown

View File

@ -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

51
init.d/.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -1,6 +0,0 @@
DIR= ${LOCALDIR}
CONF= README
MK= ../mk
include ${MK}/os.mk
include ${MK}/scripts.mk

View File

@ -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:

View File

@ -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] cc_flags = [cc_debug_flags, cc_os_flags, cc_warning_flags]
add_project_arguments(cc_flags, language : 'c') add_project_arguments(cc_flags, language : 'c')
incdir = include_directories('src/includes') incdir = include_directories('src/shared')
einfo_incdir = include_directories('src/libeinfo') einfo_incdir = include_directories('src/libeinfo')
rc_incdir = include_directories('src/librc') rc_incdir = include_directories('src/librc')
@ -201,7 +201,6 @@ subdir('init.d')
subdir('local.d') subdir('local.d')
subdir('man') subdir('man')
subdir('pkgconfig') subdir('pkgconfig')
subdir('scripts')
subdir('sh') subdir('sh')
subdir('src') subdir('src')
subdir('support') subdir('support')

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -1 +0,0 @@
MKNET?= yes

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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?=

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -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

View File

@ -1,2 +0,0 @@
einfo.pc
openrc.pc

View File

@ -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

View File

@ -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:

5
scripts/.gitignore vendored
View File

@ -1,5 +0,0 @@
halt
poweroff
rc-sstat
reboot
shutdown

View File

@ -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

View File

@ -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)

View File

@ -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

7
sh/.gitignore vendored
View File

@ -1,7 +0,0 @@
functions.sh
gendepends.sh
openrc-run.sh
cgroup-release-agent.sh
init.sh
init-early.sh
binfmt.sh

View File

@ -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::

View File

@ -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

View File

@ -33,8 +33,8 @@
#include "einfo.h" #include "einfo.h"
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
#include "rc-selinux.h" #include "selinux.h"
#include "_usage.h" #include "_usage.h"
typedef enum { typedef enum {

View File

@ -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)

View File

@ -1,6 +0,0 @@
version_h = vcs_tag(
input : 'version.h.in',
output : 'version.h')
version_f = vcs_tag(
input : 'version.in',
output : 'version')

32
src/einfo/meson.build Normal file
View File

@ -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

View File

@ -58,7 +58,7 @@
#include "einfo.h" #include "einfo.h"
#include "queue.h" #include "queue.h"
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
#include "_usage.h" #include "_usage.h"
const char *applet = NULL; const char *applet = NULL;

View File

@ -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)

7
src/halt/meson.build Normal file
View File

@ -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

View File

@ -16,7 +16,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
int main(int argc, char **argv) int main(int argc, char **argv)
{ {

View File

@ -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)

View File

@ -16,7 +16,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
int main(int argc, char **argv) int main(int argc, char **argv)
{ {

View File

@ -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)

View File

@ -31,7 +31,7 @@
#include "einfo.h" #include "einfo.h"
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
#include "_usage.h" #include "_usage.h"
const char *applet = NULL; const char *applet = NULL;

9
src/kill_all/meson.build Normal file
View File

@ -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

View File

@ -1 +0,0 @@
libeinfo.so.1

View File

@ -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

View File

@ -1,2 +0,0 @@
librc.so.1
rc.h

View File

@ -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

View File

@ -54,6 +54,6 @@
#endif #endif
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
#endif #endif

View File

@ -27,7 +27,7 @@
#include "einfo.h" #include "einfo.h"
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
const char *applet = NULL; const char *applet = NULL;

View File

@ -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

View File

@ -1,4 +1,36 @@
subdir('common') script_conf_data = configuration_data()
script_conf_data.set('SBINDIR', sbindir)
subdir('shared')
subdir('libeinfo') subdir('libeinfo')
subdir('librc') 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')

View File

@ -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)

View File

@ -42,7 +42,7 @@
#include "einfo.h" #include "einfo.h"
#include "queue.h" #include "queue.h"
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
#include "_usage.h" #include "_usage.h"
const char *applet = NULL; const char *applet = NULL;

View File

@ -0,0 +1,3 @@
install_data('on_ac_power',
install_dir : rc_bindir,
install_mode: 'rwxr-xr-x')

0
scripts/on_ac_power → src/on_ac_power/on_ac_power Executable file → Normal file
View File

View File

@ -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

View File

@ -38,8 +38,8 @@
#include "helpers.h" #include "helpers.h"
#include "rc.h" #include "rc.h"
#include "rc-plugin.h" #include "plugin.h"
#include "rc-wtmp.h" #include "wtmp.h"
#include "version.h" #include "version.h"
static const char *path_default = "/sbin:/usr/sbin:/bin:/usr/bin"; static const char *path_default = "/sbin:/usr/sbin:/bin:/usr/bin";

View File

@ -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)

View File

@ -50,9 +50,9 @@
#include "einfo.h" #include "einfo.h"
#include "queue.h" #include "queue.h"
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
#include "rc-plugin.h" #include "plugin.h"
#include "rc-selinux.h" #include "selinux.h"
#include "_usage.h" #include "_usage.h"
#define PREFIX_LOCK RC_SVCDIR "/prefix.lock" #define PREFIX_LOCK RC_SVCDIR "/prefix.lock"

View File

@ -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

View File

@ -34,9 +34,9 @@
#include "einfo.h" #include "einfo.h"
#include "rc.h" #include "rc.h"
#include "helpers.h" #include "helpers.h"
#include "rc-misc.h" #include "misc.h"
#include "rc-sysvinit.h" #include "rc-sysvinit.h"
#include "rc-wtmp.h" #include "wtmp.h"
#include "_usage.h" #include "_usage.h"
const char *applet = NULL; const char *applet = NULL;

17
src/openrc/meson.build Normal file
View File

@ -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)

View File

@ -44,7 +44,7 @@
#include "rc-logger.h" #include "rc-logger.h"
#include "queue.h" #include "queue.h"
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
#define TMPLOG RC_SVCDIR "/rc.log" #define TMPLOG RC_SVCDIR "/rc.log"
#define DEFAULTLOG "/var/log/rc.log" #define DEFAULTLOG "/var/log/rc.log"

View File

@ -47,8 +47,8 @@
#include "queue.h" #include "queue.h"
#include "rc.h" #include "rc.h"
#include "rc-logger.h" #include "rc-logger.h"
#include "rc-misc.h" #include "misc.h"
#include "rc-plugin.h" #include "plugin.h"
#include "version.h" #include "version.h"
#include "_usage.h" #include "_usage.h"

7
src/poweroff/meson.build Normal file
View File

@ -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

6
src/rc-abort/meson.build Normal file
View File

@ -0,0 +1,6 @@
executable('rc-abort',
'rc-abort.c',
include_directories: [einfo_incdir],
link_with: [libeinfo],
install: true,
install_dir: rc_sbindir)

View File

@ -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)

View File

@ -34,7 +34,7 @@
#include "einfo.h" #include "einfo.h"
#include "queue.h" #include "queue.h"
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
#include "_usage.h" #include "_usage.h"
const char *applet = NULL; const char *applet = NULL;

View File

@ -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)

View File

@ -24,7 +24,7 @@
#include "einfo.h" #include "einfo.h"
#include "queue.h" #include "queue.h"
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
#include "_usage.h" #include "_usage.h"
const char *applet = NULL; const char *applet = NULL;

5
src/rc-sstat/meson.build Normal file
View File

@ -0,0 +1,5 @@
if os == 'Linux'
install_data('rc-sstat',
install_dir: sbindir,
install_mode: 'rwxr-xr-x')
endif

View File

@ -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)

View File

@ -25,7 +25,7 @@
#include "einfo.h" #include "einfo.h"
#include "queue.h" #include "queue.h"
#include "rc.h" #include "rc.h"
#include "rc-misc.h" #include "misc.h"
#include "_usage.h" #include "_usage.h"
enum format_t { enum format_t {

Some files were not shown because too many files have changed in this diff Show More