git: bfa13bfc5255 - main - x11/lightdm-gtk-greeter: and x11/slick-greeter: auto-set greeter-session
Ben Woods
woodsb02 at FreeBSD.org
Wed Aug 25 23:08:19 UTC 2021
The branch main has been updated by woodsb02:
URL: https://cgit.FreeBSD.org/ports/commit/?id=bfa13bfc525586bc7823f2d5b082a88fdce06213
commit bfa13bfc525586bc7823f2d5b082a88fdce06213
Author: Ben Woods <woodsb02 at FreeBSD.org>
AuthorDate: 2021-08-22 02:48:26 +0000
Commit: Ben Woods <woodsb02 at FreeBSD.org>
CommitDate: 2021-08-25 23:06:22 +0000
x11/lightdm-gtk-greeter: and x11/slick-greeter: auto-set greeter-session
Add pkg-install and pkg-deinstall scripts to automatically configure
the greeter-session variable in lightdm.conf if it has not been manually
changed from the default value.
This reduces the steps for a fresh FreeBSD install to get to a graphical
environment to the following simple steps (excluding graphics drivers):
$ pkg install <greeter> <desktop-environment>
$ service lightdm enable
$ service ligthdm start
Approved by: ericbsd (maintainer x11/slick-greeter)
Approved by: madpilot (maintainer x11/lightdm-gtk-greeter)
Differential Revision: https://reviews.freebsd.org/D31632
---
x11/lightdm-gtk-greeter/Makefile | 3 ++-
x11/lightdm-gtk-greeter/files/pkg-deinstall.in | 19 +++++++++++++++++++
x11/lightdm-gtk-greeter/files/pkg-install.in | 18 ++++++++++++++++++
x11/slick-greeter/Makefile | 3 ++-
x11/slick-greeter/files/pkg-deinstall.in | 19 +++++++++++++++++++
x11/slick-greeter/files/pkg-install.in | 18 ++++++++++++++++++
6 files changed, 78 insertions(+), 2 deletions(-)
diff --git a/x11/lightdm-gtk-greeter/Makefile b/x11/lightdm-gtk-greeter/Makefile
index b61ab57e96a9..ff096fe22301 100644
--- a/x11/lightdm-gtk-greeter/Makefile
+++ b/x11/lightdm-gtk-greeter/Makefile
@@ -2,7 +2,7 @@
PORTNAME= lightdm-gtk-greeter
PORTVERSION= 2.0.8
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= x11
MASTER_SITES= https://github.com/Xubuntu/${PORTNAME}/releases/download/${PORTNAME}-${PORTVERSION}/
@@ -23,6 +23,7 @@ USE_XORG= x11
GNU_CONFIGURE= yes
INSTALLS_ICONS= yes
+SUB_FILES= pkg-deinstall pkg-install
CONFIGURE_ARGS+=--disable-indicator-services-command \
--enable-at-spi-command=${LOCALBASE}/libexec/at-spi-bus-launcher
diff --git a/x11/lightdm-gtk-greeter/files/pkg-deinstall.in b/x11/lightdm-gtk-greeter/files/pkg-deinstall.in
new file mode 100644
index 000000000000..0e8837b4c464
--- /dev/null
+++ b/x11/lightdm-gtk-greeter/files/pkg-deinstall.in
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+PREFIX=${PKG_PREFIX-/usr/local}
+
+case $2 in
+DEINSTALL)
+ if grep -Fxq "greeter-session=lightdm-gtk-greeter" ${PREFIX}/etc/lightdm/lightdm.conf
+ then
+ echo ":: Removing greeter configuration in ${PREFIX}/etc/lightdm/lightdm.conf"
+ echo ":: Configure another greeter if you plan to keep using lightdm."
+ /usr/bin/sed -i ".bak" "s/^greeter-session=lightdm-gtk-greeter$/#greeter-session=example-gtk-gnome/g" \
+ ${PREFIX}/etc/lightdm/lightdm.conf
+ else
+ echo ":: lightdm-gtk-greeter is not the configured greeter in ${PREFIX}/etc/lightdm/lightdm.conf"
+ echo ":: Leaving the lightdm greeter configuration unchanged."
+ fi
+ echo ":: $(grep greeter-session= ${PREFIX}/etc/lightdm/lightdm.conf)"
+ ;;
+esac
diff --git a/x11/lightdm-gtk-greeter/files/pkg-install.in b/x11/lightdm-gtk-greeter/files/pkg-install.in
new file mode 100644
index 000000000000..b015bae0dd27
--- /dev/null
+++ b/x11/lightdm-gtk-greeter/files/pkg-install.in
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+PREFIX=${PKG_PREFIX-/usr/local}
+
+case $2 in
+POST-INSTALL)
+ if grep -Fxq "#greeter-session=example-gtk-gnome" ${PREFIX}/etc/lightdm/lightdm.conf
+ then
+ echo ":: Setting lightdm-gtk-greeter as greeter session in ${PREFIX}/etc/lightdm/lightdm.conf"
+ /usr/bin/sed -i ".bak" "s/^#greeter-session=example-gtk-gnome$/greeter-session=lightdm-gtk-greeter/g" \
+ ${PREFIX}/etc/lightdm/lightdm.conf
+ else
+ echo ":: A greeter has already been configured in ${PREFIX}/etc/lightdm/lightdm.conf"
+ echo ":: Leaving the lightdm greeter configuration unchanged."
+ fi
+ echo ":: $(grep greeter-session= ${PREFIX}/etc/lightdm/lightdm.conf)"
+ ;;
+esac
diff --git a/x11/slick-greeter/Makefile b/x11/slick-greeter/Makefile
index f3f33ebb97cd..157e914fcfa3 100644
--- a/x11/slick-greeter/Makefile
+++ b/x11/slick-greeter/Makefile
@@ -3,7 +3,7 @@
PORTNAME= slick-greeter
PORTVERSION= 1.5.3
CATEGORIES= x11
-PORTREVISION= 1
+PORTREVISION= 2
MAINTAINER= ericbsd at FreeBSD.org
COMMENT= Slick-looking LightDM greeter
@@ -34,6 +34,7 @@ SHEBANG_FILES= files/usr/bin/slick-greeter-check-hidpi \
makepot
bash_OLD_CMD= /usr/bin/bash
bash_CMD= /bin/sh
+SUB_FILES= pkg-deinstall pkg-install
GLIB_SCHEMAS= x.dm.slick-greeter.gschema.xml
diff --git a/x11/slick-greeter/files/pkg-deinstall.in b/x11/slick-greeter/files/pkg-deinstall.in
new file mode 100644
index 000000000000..38be3ef52c3f
--- /dev/null
+++ b/x11/slick-greeter/files/pkg-deinstall.in
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+PREFIX=${PKG_PREFIX-/usr/local}
+
+case $2 in
+DEINSTALL)
+ if grep -Fxq "greeter-session=slick-greeter" ${PREFIX}/etc/lightdm/lightdm.conf
+ then
+ echo ":: Removing greeter configuration in ${PREFIX}/etc/lightdm/lightdm.conf"
+ echo ":: Configure another greeter if you plan to keep using lightdm."
+ /usr/bin/sed -i ".bak" "s/^greeter-session=slick-greeter$/#greeter-session=example-gtk-gnome/g" \
+ ${PREFIX}/etc/lightdm/lightdm.conf
+ else
+ echo ":: slick-greeter is not the configured greeter in ${PREFIX}/etc/lightdm/lightdm.conf"
+ echo ":: Leaving the lightdm greeter configuration unchanged."
+ fi
+ echo ":: $(grep greeter-session= ${PREFIX}/etc/lightdm/lightdm.conf)"
+ ;;
+esac
diff --git a/x11/slick-greeter/files/pkg-install.in b/x11/slick-greeter/files/pkg-install.in
new file mode 100644
index 000000000000..f6d24a6ce8e8
--- /dev/null
+++ b/x11/slick-greeter/files/pkg-install.in
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+PREFIX=${PKG_PREFIX-/usr/local}
+
+case $2 in
+POST-INSTALL)
+ if grep -Fxq "#greeter-session=example-gtk-gnome" ${PREFIX}/etc/lightdm/lightdm.conf
+ then
+ echo ":: Setting slick-greeter as greeter session in ${PREFIX}/etc/lightdm/lightdm.conf"
+ /usr/bin/sed -i ".bak" "s/^#greeter-session=example-gtk-gnome$/greeter-session=slick-greeter/g" \
+ ${PREFIX}/etc/lightdm/lightdm.conf
+ else
+ echo ":: A greeter has already been configured in ${PREFIX}/etc/lightdm/lightdm.conf"
+ echo ":: Leaving the lightdm greeter configuration unchanged."
+ fi
+ echo ":: $(grep greeter-session= ${PREFIX}/etc/lightdm/lightdm.conf)"
+ ;;
+esac
More information about the dev-commits-ports-all
mailing list