1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-20 20:09:11 +00:00

sysutils/seatd: add new port

seatd is a seat management deamon, that does everything it needs to
do. Nothing more, nothing less. Depends only on libc.

libseat is a seat management library allowing applications to use
whatever seat management is available.

Supports:
- seatd
- (e)logind
- embedded seatd for standalone operation

Each backend can be compile-time included and is runtime auto-detected
or manually selected with the `LIBSEAT_BACKEND` environment variable.

Which backend is in use is transparent to the application, providing a
simple common interface.

WWW: https://git.sr.ht/~kennylevinsen/seatd
This commit is contained in:
Jan Beich 2020-08-09 09:35:20 +00:00
parent eb89bc89c4
commit 6f6ef4a50c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=544555
8 changed files with 130 additions and 1 deletions

View File

@ -1205,6 +1205,7 @@
SUBDIR += scterc
SUBDIR += sd-agent
SUBDIR += sdparm
SUBDIR += seatd
SUBDIR += seatools
SUBDIR += sec
SUBDIR += sensu-go

42
sysutils/seatd/Makefile Normal file
View File

@ -0,0 +1,42 @@
# $FreeBSD$
PORTNAME= seatd
PORTVERSION= s20200808
DISTVERSIONSUFFIX= -0-gf5bc8ab
CATEGORIES= sysutils
MASTER_SITES= https://git.sr.ht/~kennylevinsen/${PORTNAME}/archive/${DISTVERSIONFULL}${EXTRACT_SUFX}?dummy=/
MAINTAINER= jbeich@FreeBSD.org
COMMENT= Minimal seat management daemon and universal library
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= compiler:c11 meson pkgconfig
USE_LDCONFIG= yes
USE_RC_SUBR= ${PORTNAME}
PLIST_FILES= bin/${PORTNAME} \
include/libseat.h \
lib/libseat.so \
libdata/pkgconfig/libseat.pc
MESON_ARGS= -Dbuiltin=enabled # SUID fallback
OPTIONS_DEFINE= MANPAGES
OPTIONS_DEFAULT=MANPAGES
MANPAGES_BUILD_DEPENDS= scdoc:textproc/scdoc
MANPAGES_MESON_ENABLED= man-pages
MANPAGES_PLIST_FILES= man/man1/${PORTNAME}.1.gz
post-patch:
# hier(7) doesn't define /run, so use /var/run
@${REINPLACE_CMD} -e 's,/run,/var&,' \
${WRKSRC}/libseat/backend/seatd.c \
${WRKSRC}/man/seatd.1.scd \
${WRKSRC}/seatd/seatd.c
# realpath(3) expands /dev/dri/ to /dev/drm/
@${REINPLACE_CMD} -e 's,/dev/dri,/dev/drm,' \
-e '/prefix/ { s/card//; s/renderD//; }' \
${WRKSRC}/common/drm.c
.include <bsd.port.mk>

3
sysutils/seatd/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1596893263
SHA256 (seatd-s20200808-0-gf5bc8ab.tar.gz) = a43eb7b91c5926463753ccddfe42a277dc40c279c63d5970c87153a462ab9816
SIZE (seatd-s20200808-0-gf5bc8ab.tar.gz) = 30863

View File

@ -0,0 +1,20 @@
Similar to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189
--- seatd/client.c.orig 2020-08-08 13:27:43 UTC
+++ seatd/client.c
@@ -37,10 +37,14 @@ static int get_peer(int fd, pid_t *pid, uid_t *uid, gi
#elif defined(__FreeBSD__)
struct xucred cred;
socklen_t len = sizeof cred;
- if (getsockopt(fd, SOL_SOCKET, LOCAL_PEERCRED, &cred, &len) == -1) {
+ if (getsockopt(fd, 0, LOCAL_PEERCRED, &cred, &len) == -1) {
return -1;
}
+#if __FreeBSD__ < 13
*pid = -1;
+#else
+ *pid = cred.cr_pid;
+#endif
*uid = cred.cr_uid;
*gid = cred.cr_ngroups > 0 ? cred.cr_groups[0] : -1;
return 0;

View File

@ -0,0 +1,31 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: seatd
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable this service:
#
# seatd_enable (bool): Set it to YES to run seatd on startup.
# Default: NO
# seatd_args (string): Options to pass to seatd.
# Default: -g video
. /etc/rc.subr
name="seatd"
rcvar="${name}_enable"
load_rc_config "$name"
: ${seatd_enable="NO"}
: ${seatd_args="-g video"}
command="/usr/sbin/daemon"
procname="%%PREFIX%%/bin/${name}"
pidfile="/var/run/${name}.pid"
command_args="-s err -T ${name} -p ${pidfile} ${procname} ${seatd_args}"
run_rc_command "$1"

18
sysutils/seatd/pkg-descr Normal file
View File

@ -0,0 +1,18 @@
seatd is a seat management deamon, that does everything it needs to
do. Nothing more, nothing less. Depends only on libc.
libseat is a seat management library allowing applications to use
whatever seat management is available.
Supports:
- seatd
- (e)logind
- embedded seatd for standalone operation
Each backend can be compile-time included and is runtime auto-detected
or manually selected with the `LIBSEAT_BACKEND` environment variable.
Which backend is in use is transparent to the application, providing a
simple common interface.
WWW: https://git.sr.ht/~kennylevinsen/seatd

View File

@ -39,7 +39,7 @@ MESON_ARGS= -Dexamples=false
LLD_UNSAFE= yes
.endif
OPTIONS_DEFINE= CONSOLEKIT X11
OPTIONS_DEFINE= CONSOLEKIT LIBSEAT X11
OPTIONS_DEFAULT=X11
OPTIONS_SUB= yes
@ -53,6 +53,16 @@ CONSOLEKIT_MESON_ENABLED= consolekit2
.MAKEFLAGS: WITH+=CONSOLEKIT
.endif
LIBSEAT_DESC= DRM sessions with/without root via libseat (experimental)
LIBSEAT_PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/:libseat
LIBSEAT_PATCHFILES= be3753a4774f.patch:-p1:libseat # https://github.com/swaywm/wlroots/pull/2364
LIBSEAT_PATCHFILES+= c1955ad1ab05.patch:-p1:libseat # FreeBSD build fix
LIBSEAT_LIB_DEPENDS= libseat.so:sysutils/seatd
#LIBSEAT_MESON_ENABLED= libseat
.if make(makesum)
.MAKEFLAGS: WITH+=LIBSEAT
.endif
X11_LIB_DEPENDS=libxcb-errors.so:x11/xcb-util-errors \
libxcb-icccm.so:x11/xcb-util-wm
X11_RUN_DEPENDS=xwayland-devel>0:x11-servers/xwayland-devel

View File

@ -7,3 +7,7 @@ SHA256 (90cb6d26877b.patch) = 4c3a87dca481a637457d7409d38ce2bcd8d52ba4a0b02cf16e
SIZE (90cb6d26877b.patch) = 3965
SHA256 (b59460944208.patch) = 8b15ed54dcec76adf231db454ece78427eeabd5466ffd180b57ec785eeb4c507
SIZE (b59460944208.patch) = 27381
SHA256 (be3753a4774f.patch) = 7097190a74ce45db51c6651c7780f1eb8c3fec1fcc8a2252999a28cad15a092d
SIZE (be3753a4774f.patch) = 12350
SHA256 (c1955ad1ab05.patch) = f32e1dfddac74b08cfbc806aac4ce9b9eecbfe3d75b4ebbb5f714fa587e85f05
SIZE (c1955ad1ab05.patch) = 2699