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:
7
src/poweroff/meson.build
Normal file
7
src/poweroff/meson.build
Normal 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
|
||||
28
src/poweroff/poweroff.in
Normal file
28
src/poweroff/poweroff.in
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
option_arg=
|
||||
poweroff_arg=
|
||||
while getopts :nwdfiph opt; do
|
||||
case "$opt" in
|
||||
n) ;;
|
||||
w) poweroff_arg=--write-only ;;
|
||||
d) option_arg=--no-write ;;
|
||||
f) ;;
|
||||
i) ;;
|
||||
[?]) printf "%s\n" "${0##*/}: invalid command line option" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
if [ -z "${poweroff_arg}" ]; then
|
||||
poweroff_arg=--poweroff
|
||||
fi
|
||||
|
||||
script_args="$@"
|
||||
if [ -z "${script_args}" ]; then
|
||||
script_args=now
|
||||
fi
|
||||
|
||||
exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "${script_args}"
|
||||
Reference in New Issue
Block a user