From 935d4120f59f60423ea722dcdd60e170848a23ff Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 16 May 2021 00:54:55 +0200 Subject: [PATCH] add package from artix to aur https://gitea.artixlinux.org/artixlinux/packages-openrc/commit/822009b47dc9fc30f1328bf0f27457a54693d570 --- .SRCINFO | 18 ++++++++++++++ .gitignore | 33 +++++++++++++++++++++++++ PKGBUILD | 23 ++++++++++++++++++ autofs.confd | 14 +++++++++++ autofs.initd | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 157 insertions(+) create mode 100644 .SRCINFO create mode 100644 .gitignore create mode 100644 PKGBUILD create mode 100644 autofs.confd create mode 100644 autofs.initd diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..5fec0a9 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = autofs-openrc + pkgdesc = OpenRC autofs init script + pkgver = 20210506 + pkgrel = 2 + url = https://code.obermui.de/6543/autofs-openrc + arch = any + license = GPL2 + depends = openrc + depends = autofs + provides = init-autofs + conflicts = init-autofs + source = autofs.confd + source = autofs.initd + sha256sums = d95fc4b88c02dafcd771e35f7422f4f03642687187a17613d3f2b0fb48caaad4 + sha256sums = 517faf155ff348df8df4437d6c5352538f0b686d22b646d816b9efe91e4eebd2 + +pkgname = autofs-openrc + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6101d41 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +# ---> ArchLinuxPackages +*.tar +*.tar.* +*.jar +*.exe +*.msi +*.zip +*.tgz +*.log +*.log.* +*.sig + +pkg/ +src/ + + +# ---> Archives +*.7z +*.rar +*.gz +*.bzip +*.bz2 +*.xz +*.lzma +*.cab + +# ---> systemd +*.service +*.socket +*.timer + +# ---> snap +*.snap diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..76cba56 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer: 6543 <6543@obermui.de> +# Contributor: artoo +# Contributor: Oscar Campos + +pkgname=autofs-openrc +pkgver=20210506 +pkgrel=2 +pkgdesc="OpenRC autofs init script" +arch=('any') +url="https://code.obermui.de/6543/autofs-openrc" +license=('GPL2') +provides=('init-autofs') +depends=('openrc' 'autofs') +conflicts=('init-autofs') +source=("autofs.confd" + "autofs.initd") +sha256sums=('d95fc4b88c02dafcd771e35f7422f4f03642687187a17613d3f2b0fb48caaad4' + '517faf155ff348df8df4437d6c5352538f0b686d22b646d816b9efe91e4eebd2') + +package() { + install -Dm755 "${srcdir}/autofs.initd" "${pkgdir}/etc/init.d/autofs" + install -Dm644 "${srcdir}/autofs.confd" "${pkgdir}/etc/conf.d/autofs" +} diff --git a/autofs.confd b/autofs.confd new file mode 100644 index 0000000..2ca53ff --- /dev/null +++ b/autofs.confd @@ -0,0 +1,14 @@ +# +# Init syatem options +# +# If the kernel supports using the autofs miscellanous device +# and you wish to use it you must set this configuration option +# to "yes" otherwise it will not be used. +# +USE_MISC_DEVICE="yes" +# +# Use OPTIONS to add automount(8) command line options that +# will be used when the daemon is started. +# +#OPTIONS="" +# diff --git a/autofs.initd b/autofs.initd new file mode 100644 index 0000000..9a6d82b --- /dev/null +++ b/autofs.initd @@ -0,0 +1,69 @@ +#!/usr/bin/openrc-run +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +DAEMON=/usr/bin/automount +PIDFILE=/run/autofs.pid +DEVICE=autofs + +depend() { + need localmount + use ypbind nfs slapd portmap net +} + +extra_started_commands="reload" + +start() { + ebegin "Starting automounter" + + # Ensure autofs support is loaded + grep -q autofs /proc/filesystems || modprobe -q autofs4 + if [ $? -ne 0 ]; then + eend 1 "No autofs support available in kernel" + return 1 + fi + + # Check misc device + if [ -n "${USE_MISC_DEVICE}" -a "${USE_MISC_DEVICE}" = "yes" ]; then + sleep 1 + if [ -e "/proc/misc" ]; then + MINOR=$(awk "/${DEVICE}/ {print \$1}" /proc/misc) + if [ -n "${MINOR}" -a ! -c "/dev/${DEVICE}" ]; then + mknod -m 0600 "/dev/${DEVICE}" c 10 ${MINOR} + if [ $? -ne 0 ]; then + eend 1 "Could not create '/dev/${DEVICE}'" + return 1 + fi + fi + fi + if [ -x /usr/bin/restorecon -a -c "/dev/${DEVICE}" ]; then + /usr/bin/restorecon "/dev/${DEVICE}" + if [ $? -ne 0 ]; then + eend 1 "Failed to execute '/usr/bin/restorecon \"/dev/${DEVICE}\"'" + return 1 + fi + fi + else + [ -c "/dev/${DEVICE}" ] && rm -rf "/dev/${DEVICE}" + fi + + start-stop-daemon --start --exec ${DAEMON} -- -p ${PIDFILE} ${OPTIONS} + + eend $? +} + +stop() { + ebegin "Stopping automounter" + start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} + eend $? +} + +reload() { + ebegin "Reloading automounter" + if [ ! -r "${PIDFILE}" ]; then + eend 1 "automount not running" + else + kill -s HUP $(cat "${PIDFILE}") 2> /dev/null + eend $? + fi +}