Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • 66-service/arch/tty
  • ProwlerGr/66-service-tty
2 results
Show changes
Commits on Source (3)
config.mak
#
# This Makefile requires GNU make.
#
# Do not make changes here.
# Use the included .mak files.
#
make_need := 3.81
ifeq "" "$(strip $(filter $(make_need), $(firstword $(sort $(make_need) $(MAKE_VERSION)))))"
fail := $(error Your make ($(MAKE_VERSION)) is too old. You need $(make_need) or newer)
endif
-include config.mak
include package/targets.mak
LOWDOWN := $(shell type -p lowdown)
ifdef LOWDOWN
GENERATE_HTML := $(shell doc/make-html.sh)
GENERATE_MAN := $(shell doc/make-man.sh)
endif
INSTALL_HTML := $(wildcard doc/html/*.html)
INSTALL_MAN := $(wildcard doc/man/*/*)
INSTALL := ./tools/install.sh
clean:
@exec rm -rf $(DESTDIR)
install: install-service install-user-service install-html install-man
install-service: $(SERVICE_TARGET:service/%=$(DESTDIR)$(service_directory)/%)
install-html: $(INSTALL_HTML:doc/html/%.html=$(DESTDIR)$(datarootdir)/doc/$(package_doc)/%.html)
install-man: install-man1
install-man1: $(INSTALL_MAN:doc/man/man1/%.1=$(DESTDIR)$(mandir)/man1/%.1)
$(DESTDIR)$(service_directory)/%: service/%
exec $(INSTALL) -D -m 644 $< $@
exec sed -e "s/%%BINDIR%%/$(subst /,\/,$(bindir))/g" \
-e "s/%%SYSCONFDIR%%/$(subst /,\/,$(sysconfdir))/g" \
-e "s/%%DATAROOTDIR%%/$(subst /,\/,$(datarootdir))/g" \
-e "s/%%LIVEDIR%%/$(subst /,\/,$(livedir))/g" \
-e "s/%%SERVICE_DIRECTORY%%/$(subst /,\/,$(service_directory))/g" \
-e "s/%%SCRIPT_DIRECTORY%%/$(subst /,\/,$(script_directory))/g" \
-e "s/%%SEED_DIRECTORY%%/$(subst /,\/,$(seed_directory))/g" \
-e "s/%%SERVICE_CONF_DIRECTORY%%/$(subst /,\/,$(adm_conf))/g" \
-e "s/%%SKEL_DIRECTORY%%/$(subst /,\/,$(skel_directory))/g" \
-e "s/%%EXECLINE_SHEBANGPREFIX%%/$(subst /,\/,$(shebangdir))/g" \
-e "s/%%VERSION%%/$(subst /,\/,$(version))/g" $< > $@
$(DESTDIR)$(datarootdir)/doc/$(package_doc)/%.html: doc/html/%.html
$(INSTALL) -D -m 644 $< $@ && \
sed -e 's,%%skel_directory%%,$(skel_directory),g' $< > $@
$(DESTDIR)$(mandir)/man1/%.1: doc/man/man1/%.1
$(INSTALL) -D -m 644 $< $@ && \
sed -e 's,%%skel_directory%%,$(skel_directory),g' $< > $@
version:
@echo $(version)
.PHONY: clean install install-service install-user-service version install-html install-man
.DELETE_ON_ERROR:
Build Instructions
------------------
# Requirements
- GNU make version 3.81 or later
This software will install on any operating system that implements POSIX.1-2008, available at [opengroup](http://pubs.opengroup.org/onlinepubs/9699919799/).
## Standard usage
`./configure && sudo make install` will work for most users.
Note: the man and html documentation pages will always be generated if *lowdown* is installed on your system. However, if you don't ask to build the documentation the final `DESTDIR` directory will do not contains any documentation at all.
## Customization
You can customize paths via flags given to configure. See `./configure --help` for a list of all available configure options.
## Runtime dependencies
- execline version 2.9.6.1 or later: http://skarnet.org/software/execline/
- s6 version 2.13.1.0 or later: http://skarnet.org/software/s6/
- 66 version 0.8.0.0 or later: https://git.obarun.org/Obarun/66/
- 66-tools version 0.1.1.0 or later: https://git.obarun.org/Obarun/66-tools/
- s6-linux-utils version 2.6.2.1 or later: http://skarnet.org/software/s6-linux-utils/
- s6-portable-utils version 2.3.0.4 or later: http://skarnet.org/software/s6-portable-utils/
#!/bin/sh
. package/info
usage () {
cat <<EOF
Usage: $0 [OPTION]... [TARGET]
Defaults for the options are specified in brackets.
Installation directories:
--prefix=PREFIX main installation prefix [/]
--exec-prefix=EPREFIX installation prefix for executable files [PREFIX]
Fine tuning of the installation directories:
--bindir=BINDIR user executables [EPREFIX/bin]
--libdir=LIBDIR static library files [PREFIX/lib/$package_macro_dir]
--sysconfdir=SYSDIR global configuration files [/etc]
--datarootdir=DATAROOTDIR read-only architecture-independent data root [PREFIX/share]
--mandir=DIR man documentation [$datarootdir/man]
--livedir=DIR 66 default live directory [/run/66]
--with-system-service=DIR 66 service intallation directory [DATAROOTDIR/$package_macro_dir/service]
--with-system-script=DIR 66 script installation directory of scripts [DATAROOTDIR/$package_macro_dir/script]
--with-system-seed=DIR system trees default configuration[DATAROOTDIR/$package_macro_dir/seed]
--with-skeleton=DIR 66 skeleton files directory installation [SYSDIR/$package_macro_dir]
--shebangdir=DIR absolute path for execline #\! invocations [BINDIR]
Fine tunning of boot configuration:
--version=VALUE version of the service[0.0.1]
EOF
exit 0
}
# Helper functions
# If your system does not have printf, you can comment this, but it is
# generally not a good idea to use echo.
# See http://www.etalabs.net/sh_tricks.html
echo () {
IFS=" "
printf %s\\n "$*"
}
quote () {
tr '\n' ' ' <<EOF | grep '^[-[:alnum:]_=,./:]* $' >/dev/null 2>&1 && { echo "$1" ; return 0 ; }
$1
EOF
echo "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/'/" -e "s#^'\([-[:alnum:]_,./:]*\)=\(.*\)\$#\1='\2#" -e "s|\*/|* /|g"
}
fail () {
echo "$*"
exit 1
}
fnmatch () {
eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac"
}
cmdexists () {
type "$1" >/dev/null 2>&1
}
stripdir () {
while eval "fnmatch '*/' \"\${$1}\"" ; do
eval "$1=\${$1%/}"
done
}
testval () {
if test -z ${1}; then
return 0 ;
else
return 1 ;
fi
}
# Actual script
prefix=
exec_prefix='$prefix'
bindir='$exec_prefix/bin'
libdir='$prefix/lib/$package_macro_dir'
sysconfdir='/etc'
datarootdir='$prefix/share'
mandir='$datarootdir/man'
livedir='/run/66'
service_directory='$datarootdir/$package_macro_dir/service'
script_directory='$datarootdir/$package_macro_dir/script'
seed_directory='$datarootdir/$package_macro_dir/seed'
adm_conf='$sysconfdir/$package_macro_dir/conf'
skel_directory='$sysconfdir/$package_macro_dir'
shebangdir='$bindir'
version='0.0.1'
for arg ; do
case "$arg" in
--help) usage ;;
--prefix=*) prefix=${arg#*=} ;;
--exec-prefix=*) exec_prefix=${arg#*=} ;;
--bindir=*) bindir=${arg#*=} ;;
--libdir=*) libdir=${arg#*=} ;;
--sysconfdir=*) sysconfdir=${arg#*=} ;;
--datarootdir=*) datarootdir=${arg#*=} ;;
--mandir=*) mandir=${arg#*=} ;;
--livedir=*) livedir=${arg#*=} ;;
--with-system-service=*) service_directory=${arg#*=} ;;
--with-system-script=*) script_directory=${arg#*=} ;;
--with-system-seed=*) seed_directory=${arg#*=} ;;
--with-sysadmin-service-conf=*) adm_conf=${arg#*=} ;;
--with-skeleton=*) skel_directory=${arg#*=} ;;
--shebangdir=*) shebangdir=${arg#*=} ;;
--version=*) version=${arg#*=} ;;
-* ) echo "$0: unknown option $arg" ;;
*=*) ;;
*) target=$arg ;;
esac
done
# Add /usr in the default case
if test -z "$prefix" ; then
if test "$libdir" = '$prefix/lib/$package_macro_dir' ; then
libdir=/usr/lib/$package_macro_dir
fi
if test "$datarootdir" = '$prefix/share'; then
datarootdir=/usr/share
fi
fi
if test -z "$sysconfdir" ; then
if test "$sysconfdir" = '$sysconfdir' ; then
sysconfdir = '/etc'
fi
if test "$adm_conf" = '$sysconfdir/$package_macro_dir/conf' ; then
adm_conf = '$sysconfdir/$package_macro_dir/conf'
fi
if test "$skel_directory" = '$sysconfdir/$package_macro_dir' ; then
skel_directory = '$sysconfdir/$package_macro_dir'
fi
fi
# Expand installation directories
stripdir prefix
for i in exec_prefix bindir libdir sysconfdir datarootdir mandir livedir \
service_directory script_directory seed_directory skel_directory adm_conf shebangdir; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
stripdir sysconfdir
for i in adm_conf skel_directory; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
stripdir datarootdir
for i in service_directory script_directory seed_directory mandir; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
# Get usable temp filenames
i=0
set -C
while : ; do
i=$(($i+1))
tmpc="./tmp-configure-$$-$PPID-$i.c"
tmpe="./tmp-configure-$$-$PPID-$i.tmp"
2>|/dev/null > "$tmpc" && break
2>|/dev/null > "$tmpe" && break
test "$i" -gt 50 && fail "$0: cannot create temporary files"
done
set +C
trap 'rm -f "$tmpc" "$tmpe"' EXIT ABRT INT QUIT TERM HUP
echo "creating config.mak..."
cmdline=$(quote "$0")
for i ; do cmdline="$cmdline $(quote "$i")" ; done
exec 3>&1 1>config.mak
cat << EOF
# This file was generated by:
# $cmdline
# Any changes made here will be lost if configure is re-run.
version := $version
prefix := $prefix
exec_prefix := $exec_prefix
bindir := $bindir
libdir := $libdir
sysconfdir := $sysconfdir
datarootdir := $datarootdir
mandir := $mandir
livedir := $livedir
service_directory := $service_directory
script_directory := $script_directory
seed_directory := $seed_directory
adm_conf := $adm_conf
skel_directory := $skel_directory
package_macro_dir := $package_macro_dir
shebangdir := $shebangdir
version := $version
EOF
exec 1>&3 3>&-
echo " ... done."
package_macro_dir=66
SERVICE_TARGET := $(shell find service/ -maxdepth 1 -type f)
[Main]
Type = classic
Version = %%VERSION%%
Description = "Launch @I"
User = ( root )
Options = ( !log )
[Start]
Execute = ( %%BINDIR%%/execl-cmdline -s { %%BINDIR%%/agetty ${Args} @I } )
[Environment]
Args=!-J 38400
#!/bin/sh
usage() {
echo "usage: $0 [-D] [-l] [-m mode] src dst" 1>&2
exit 1
}
mkdirp=false
symlink=false
mode=0755
while getopts Dlm: name ; do
case "$name" in
D) mkdirp=true ;;
l) symlink=true ;;
m) mode=$OPTARG ;;
?) usage ;;
esac
done
shift $(($OPTIND - 1))
test "$#" -eq 2 || usage
src=$1
dst=$2
tmp="$dst.tmp.$$"
case "$dst" in
*/) echo "$0: $dst ends in /" 1>&2 ; exit 1 ;;
esac
set -C
set -e
if $mkdirp ; then
umask 022
case "$2" in
*/*) mkdir -p "${dst%/*}" ;;
esac
fi
trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
umask 077
if $symlink ; then
ln -s "$src" "$tmp"
else
cat < "$1" > "$tmp"
chmod "$mode" "$tmp"
fi
mv -f "$tmp" "$dst"
if test -d "$dst" ; then
rm -f "$dst/$(basename $tmp)"
if $symlink ; then
mkdir "$tmp"
ln -s "$src" "$tmp/$(basename $dst)"
mv -f "$tmp/$(basename $dst)" "${dst%/*}"
rmdir "$tmp"
else
echo "$0: $dst is a directory" 1>&2
exit 1
fi
fi
[main]
@type = classic
@version = @VERSION@
@description = "Launch @I"
@user = ( root )
@options = ( !log )
[start]
@execute = ( execl-cmdline -s { agetty ${Args} @I } )
[environment]
Args=!-J 38400