[Midnightbsd-cvs] mports [19416] trunk/x11/slim: slim 1.3.6

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Tue Jun 9 21:38:31 EDT 2015


Revision: 19416
          http://svnweb.midnightbsd.org/mports/?rev=19416
Author:   laffer1
Date:     2015-06-09 21:38:31 -0400 (Tue, 09 Jun 2015)
Log Message:
-----------
slim 1.3.6

Modified Paths:
--------------
    trunk/x11/slim/Makefile
    trunk/x11/slim/distinfo
    trunk/x11/slim/files/patch-app.cpp
    trunk/x11/slim/files/patch-slim.conf
    trunk/x11/slim/files/patch-switchuser.cpp
    trunk/x11/slim/files/pkg-message.in
    trunk/x11/slim/files/slim.in
    trunk/x11/slim/pkg-descr
    trunk/x11/slim/pkg-plist

Modified: trunk/x11/slim/Makefile
===================================================================
--- trunk/x11/slim/Makefile	2015-06-10 01:21:23 UTC (rev 19415)
+++ trunk/x11/slim/Makefile	2015-06-10 01:38:31 UTC (rev 19416)
@@ -1,8 +1,8 @@
 # $MidnightBSD$
 
 PORTNAME=	slim
-PORTVERSION=	1.3.5
-PORTREVISION=	2
+PORTVERSION=	1.3.6
+PORTREVISION=	0
 CATEGORIES=	x11
 MASTER_SITES=	ftp://ftp.berlios.de/pub/slim/ \
 		SF/slim.berlios
@@ -17,19 +17,27 @@
 		libjpeg.so:${PORTSDIR}/graphics/jpeg \
 		libpng.so:${PORTSDIR}/graphics/png \
 		libfreetype.so:${PORTSDIR}/print/freetype2 \
-		libck-connector.so:${PORTSDIR}/sysutils/consolekit \
-		libexpat.so:${PORTSDIR}/textproc/expat2 \
 		libfontconfig.so:${PORTSDIR}/x11-fonts/fontconfig
 
 USES=		cmake pkgconfig
-USE_XORG=	ice sm x11 xau xcb xdmcp xext xft xmu xorg-server xrender xt
+USE_XORG=	ice sm x11 xau xcb xdmcp xext xft xmu xorg-server xrandr \
+		xrender xt
 USE_RC_SUBR=	slim
+USE_LDCONFIG=	yes
 SUB_FILES=	pkg-message
 
-CMAKE_ARGS=	-DUSE_CONSOLEKIT=yes
+CMAKE_ARGS=	-DUSE_CONSOLEKIT=yes \
+	-DBUILD_SLIMLOCK=no \
+	-DBUILD_SHARED_LIBS=yes
 
-OPTIONS_DEFINE=	PAM
+OPTIONS_DEFINE=		PAM UTF8 CONSOLEKIT
+OPTIONS_DEFAULT=	PAM CONSOLEKIT
 
+UTF8_DESC=	Support UTF-8 characters
+CONSOLEKIT_DESC=Enable support for consolekit
+
+PLIST_SUB+=	VERSION="${PORTVERSION}"
+
 .include <bsd.mport.options.mk>
 
 .if ${PORT_OPTIONS:MPAM}
@@ -40,27 +48,30 @@
 PLIST_SUB+=	PAM="@comment "
 .endif
 
+.if ${PORT_OPTIONS:MUTF8}
+# patch taken from slim-unicode in Arch User Repository
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-utf8
+.endif
+
+.if ${PORT_OPTIONS:MCONSOLEKIT}
+CMAKE_ARGS+=	-DUSE_CONSOLEKIT=yes
+LIB_DEPENDS+=	libck-connector.so:${PORTSDIR}/sysutils/consolekit
+.else
+CMAKE_ARGS+=	-DUSE_CONSOLEKIT=no
+.endif
+
 post-patch:
 	@${CP} ${WRKSRC}/slim.conf ${WRKSRC}/slim.conf.sample
 	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
 		${WRKSRC}/slim.conf.sample
-	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' \
-		-e 's|/etc|${PREFIX}/etc|' \
-		-e 's|share/man|man|' \
-		-e 's|slim.conf|slim.conf.sample|' \
-		-e '/systemd/d' \
-		${WRKSRC}/CMakeLists.txt
+	@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' \
+		${WRKSRC}/slim.1
 
 post-install:
-	@if [ ! -f ${PREFIX}/etc/slim.conf ]; then \
-		${CP} ${PREFIX}/etc/slim.conf.sample ${PREFIX}/etc/slim.conf ; \
-	fi
+	${CP} ${FILESDIR}/background.jpg ${PREFIX}/share/slim/themes/default/background.jpg
+
 .	if ${PORT_OPTIONS:MPAM}
-	@${INSTALL_DATA} ${FILESDIR}/pam.conf ${PREFIX}/etc/pam.d/slim.default
-	@if [ ! -f ${PREFIX}/etc/pam.d/slim ]; then \
-		${CP} ${PREFIX}/etc/pam.d/slim.default ${PREFIX}/etc/pam.d/slim ; \
-	fi
+	${INSTALL_DATA} ${FILESDIR}/pam.conf ${STAGEDIR}${PREFIX}/etc/pam.d/slim.default
 .	endif
-	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.mk>

Modified: trunk/x11/slim/distinfo
===================================================================
--- trunk/x11/slim/distinfo	2015-06-10 01:21:23 UTC (rev 19415)
+++ trunk/x11/slim/distinfo	2015-06-10 01:38:31 UTC (rev 19416)
@@ -1,2 +1,2 @@
-SHA256 (slim-1.3.5.tar.gz) = 818d209f51e2fa8d5b94ef75ce90a7415be48b45e796d66f8083a9532b655629
-SIZE (slim-1.3.5.tar.gz) = 226413
+SHA256 (slim-1.3.6.tar.gz) = 21defeed175418c46d71af71fd493cd0cbffd693f9d43c2151529125859810df
+SIZE (slim-1.3.6.tar.gz) = 232547

Modified: trunk/x11/slim/files/patch-app.cpp
===================================================================
--- trunk/x11/slim/files/patch-app.cpp	2015-06-10 01:21:23 UTC (rev 19415)
+++ trunk/x11/slim/files/patch-app.cpp	2015-06-10 01:38:31 UTC (rev 19416)
@@ -1,6 +1,87 @@
---- ./app.cpp.orig	2012-12-31 07:03:42.000000000 -0600
-+++ ./app.cpp	2013-03-23 14:10:35.000000000 -0500
-@@ -931,7 +931,7 @@
+--- app.cpp.orig	2013-10-01 18:38:05.000000000 -0400
++++ app.cpp	2015-03-08 14:34:54.992147000 -0400
+@@ -14,6 +14,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <stdint.h>
++#include <login_cap.h>
+ #include <cstring>
+ #include <cstdio>
+ #include <iostream>
+@@ -32,6 +33,20 @@
+ 
+ using namespace std;
+ 
++static const int LOGIN_CAP_VAR_COUNT = 4;
++static const char* LOGIN_CAP_VARS[] = {
++	"lang",
++	"charset",
++	"timezone",
++	"manpath",
++};
++static const char* LOGIN_CAP_ENVS[] = {
++	"LANG",
++	"MM_CHARSET",
++	"TZ",
++	"MANPATH",
++};
++
+ #ifdef USE_PAM
+ #include <string>
+ 
+@@ -123,6 +138,22 @@
+ 	signal(sig, User1Signal);
+ }
+ 
++static void AddToEnv(char*** curr_env, const char *name, const char *value) {
++	int n;
++	for (n = 0; (*curr_env)[n] != NULL; n++) ;
++	n++;
++	char** new_env = static_cast<char**>(malloc(sizeof(char*) * (n + 1)));
++	memcpy(new_env, *curr_env, sizeof(char*) * n);
++	char* entry = static_cast<char*>(malloc(strlen(name) + strlen(value) + 2));
++	strcpy(entry, name);
++	strcat(entry, "=");
++	strcat(entry, value);
++	new_env[n-1] = entry;
++	new_env[n] = NULL;
++	free(*curr_env);
++	*curr_env = new_env;
++}
++
+ #ifdef USE_PAM
+ App::App(int argc, char** argv)
+   : pam(conv, static_cast<void*>(&LoginPanel)),
+@@ -596,8 +627,8 @@
+ 
+ 		n++;
+ 
+-		child_env = static_cast<char**>(malloc(sizeof(char*)*n));
+-		memcpy(child_env, old_env, sizeof(char*)*n+1);
++		child_env = static_cast<char**>(malloc(sizeof(char*)*(n+1)));
++		memcpy(child_env, old_env, sizeof(char*)*n);
+ 		child_env[n - 1] = StrConcat("XDG_SESSION_COOKIE=", ck.get_xdg_session_cookie());
+ 		child_env[n] = NULL;
+ # endif /* USE_CONSOLEKIT */
+@@ -627,6 +658,17 @@
+ 
+ #endif
+ 
++		login_cap_t *lc = login_getpwclass(pw);
++		if (lc != NULL) {
++			for (int i = 0; i < LOGIN_CAP_VAR_COUNT; i++) {
++				const char *value = login_getcapstr(lc, LOGIN_CAP_VARS[i], NULL, NULL);
++				if (value != NULL) {
++					AddToEnv(&child_env, LOGIN_CAP_ENVS[i], value);
++				}
++			}
++			login_close(lc);
++		}
++
+ 		/* Login process starts here */
+ 		SwitchUser Su(pw, cfg, DisplayName, child_env);
+ 		string session = LoginPanel->getSession();
+@@ -941,7 +983,7 @@
  	}
  
  	if (!hasVtSet && daemonmode) {

Modified: trunk/x11/slim/files/patch-slim.conf
===================================================================
--- trunk/x11/slim/files/patch-slim.conf	2015-06-10 01:21:23 UTC (rev 19415)
+++ trunk/x11/slim/files/patch-slim.conf	2015-06-10 01:38:31 UTC (rev 19416)
@@ -1,16 +1,17 @@
---- ./slim.conf.orig	2012-12-31 07:03:42.000000000 -0600
-+++ ./slim.conf	2013-03-23 14:10:35.000000000 -0500
-@@ -1,17 +1,19 @@
+--- slim.conf.orig	2013-10-01 18:38:05.000000000 -0400
++++ slim.conf	2014-08-28 21:35:07.000000000 -0400
+@@ -1,17 +1,20 @@
  # Path, X server and arguments (if needed)
  # Note: -xauth $authfile is automatically appended
 -default_path        /bin:/usr/bin:/usr/local/bin
 -default_xserver     /usr/bin/X
 -#xserver_arguments   -dpi 75
-+default_path        /bin:/usr/bin:%%LOCALBASE%%/bin
++# Use default path from /etc/login.conf
++default_path        /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:%%LOCALBASE%%/sbin:%%LOCALBASE%%/bin
 +default_xserver     %%LOCALBASE%%/bin/X
 +# The X server needs to be started on an unused virtual terminal,
 +# for FreeBSD in a default configuration, the first one of those is #09
-+xserver_arguments   vt09
++xserver_arguments   -nolisten tcp vt09
  
  # Commands for halt, login, etc.
 -halt_cmd            /sbin/shutdown -h now
@@ -27,7 +28,7 @@
  
  # Xauth file for server
  authfile           /var/run/slim.auth
-@@ -32,8 +34,8 @@
+@@ -32,8 +35,8 @@
  # NOTE: if your system does not have bash you need
  # to adjust the command according to your preferred shell,
  # i.e. for freebsd use:
@@ -38,7 +39,29 @@
  
  # Commands executed when starting and exiting a session.
  # They can be used for registering a X11 session with
-@@ -63,7 +65,7 @@
+@@ -47,11 +50,16 @@
+ # options "-d" and "-nodaemon"
+ # daemon	yes
+ 
+-# Available sessions (first one is the default).
+-# The current chosen session name is replaced in the login_cmd
+-# above, so your login command can handle different sessions.
+-# see the xinitrc.sample file shipped with slim sources
+-sessions            xfce4,icewm-session,wmaker,blackbox
++# Option "sessions" is no longer supported.
++# Now you need to put session files in the directory specified
++# by option "sessiondir".
++# sessions            xfce4,icewm-session,wmaker,blackbox
++
++# Directory of session files.
++# They should be xdg-style .desktop files.
++# The "Name" entry in the session file would be used as session name.
++# The "Exec" entry would replace %session in login_cmd.
++sessiondir		%%LOCALBASE%%/share/xsessions
+ 
+ # Executed when pressing F11 (requires imagemagick)
+ screenshot_cmd      import -window root /slim.png
+@@ -63,7 +71,7 @@
  # session_msg         Session: 
  
  # shutdown / reboot messages
@@ -47,7 +70,7 @@
  reboot_msg         The system is rebooting...
  
  # default user, leave blank or remove this line
-@@ -84,7 +86,7 @@
+@@ -84,7 +92,7 @@
  current_theme       default
  
  # Lock file

Modified: trunk/x11/slim/files/patch-switchuser.cpp
===================================================================
--- trunk/x11/slim/files/patch-switchuser.cpp	2015-06-10 01:21:23 UTC (rev 19415)
+++ trunk/x11/slim/files/patch-switchuser.cpp	2015-06-10 01:38:31 UTC (rev 19416)
@@ -1,11 +1,46 @@
---- ./switchuser.cpp.orig	2012-12-31 07:03:42.000000000 -0600
-+++ ./switchuser.cpp	2013-03-23 14:10:35.000000000 -0500
-@@ -36,6 +36,8 @@
+--- switchuser.cpp.orig	2013-10-01 18:38:05.000000000 -0400
++++ switchuser.cpp	2014-12-15 22:14:16.000000000 -0500
+@@ -9,6 +9,9 @@
+    (at your option) any later version.
+ */
  
++#include <sys/types.h>
++#include <login_cap.h>
++
+ #include <cstdio>
+ #include "switchuser.h"
+ #include "util.h"
+@@ -35,13 +38,27 @@
+ }
+ 
  void SwitchUser::SetUserId() {
- 	if( (Pw == 0) ||
-+			(setsid() == -1) ||
-+			(setlogin(Pw->pw_name) != 0) ||
- 			(initgroups(Pw->pw_name, Pw->pw_gid) != 0) ||
- 			(setgid(Pw->pw_gid) != 0) ||
- 			(setuid(Pw->pw_uid) != 0) ) {
+-	if( (Pw == 0) ||
+-			(initgroups(Pw->pw_name, Pw->pw_gid) != 0) ||
+-			(setgid(Pw->pw_gid) != 0) ||
+-			(setuid(Pw->pw_uid) != 0) ) {
+-		logStream << APPNAME << ": could not switch user id" << endl;
+-		exit(ERR_EXIT);
++	if ((Pw != 0) && (setsid() != -1)) {
++		// TODO: allow users to override settings with .login.conf
++		login_cap_t *lc = login_getpwclass(Pw);
++		if ((lc != NULL) &&
++				(setusercontext(lc, Pw, Pw->pw_uid, LOGIN_SETALL) == 0)) {
++			login_close(lc);
++			return;
++		}
++		login_close(lc);
++		logStream << APPNAME << ": fail to set user context" << endl;
++		// fallback to old method
++		if ((setlogin(Pw->pw_name) == 0) &&
++				(initgroups(Pw->pw_name, Pw->pw_gid) == 0) &&
++				(setgid(Pw->pw_gid) == 0) &&
++				(setuid(Pw->pw_uid) == 0) ) {
++			return;
++		}
+ 	}
++
++	logStream << APPNAME << ": could not switch user id" << endl;
++	exit(ERR_EXIT);
+ }
+ 
+ void SwitchUser::Execute(const char* cmd) {

Modified: trunk/x11/slim/files/pkg-message.in
===================================================================
--- trunk/x11/slim/files/pkg-message.in	2015-06-10 01:21:23 UTC (rev 19415)
+++ trunk/x11/slim/files/pkg-message.in	2015-06-10 01:38:31 UTC (rev 19416)
@@ -3,4 +3,17 @@
 Thanks to Nikos Ntarmos, it is now possible to start slim from /etc/ttys.
 Please see %%PREFIX%%/etc/rc.d/slim for instructions on how to do that.
 
+Alternatively, just put
+
+slim_enable=yes
+
+into /etc/rc.conf
+
+*** Option "sessions" is no longer supported. ***
+
+Now you need to put session files in the directory specified by option
+"sessiondir". They should be xdg-style .desktop files.
+The "Name" entry in the session file would be used as session name.
+The "Exec" entry would replace %session in login_cmd.
+
 *************************************************************************

Modified: trunk/x11/slim/files/slim.in
===================================================================
--- trunk/x11/slim/files/slim.in	2015-06-10 01:21:23 UTC (rev 19415)
+++ trunk/x11/slim/files/slim.in	2015-06-10 01:38:31 UTC (rev 19416)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $FreeBSD$
+# $FreeBSD: head/x11/slim/files/slim.in 319487 2013-05-31 11:54:01Z crees $
 #
 # PROVIDE: slim
 # REQUIRE: LOGIN dbus hald

Modified: trunk/x11/slim/pkg-descr
===================================================================
--- trunk/x11/slim/pkg-descr	2015-06-10 01:21:23 UTC (rev 19415)
+++ trunk/x11/slim/pkg-descr	2015-06-10 01:38:31 UTC (rev 19416)
@@ -5,4 +5,4 @@
 themes and an option file; is suitable for machines on which remote login
 functionalities are not needed.
 
-WWW: http://slim.berlios.de/
+WWW: http://sourceforge.net/projects/slim.berlios/

Modified: trunk/x11/slim/pkg-plist
===================================================================
--- trunk/x11/slim/pkg-plist	2015-06-10 01:21:23 UTC (rev 19415)
+++ trunk/x11/slim/pkg-plist	2015-06-10 01:38:31 UTC (rev 19416)
@@ -1,14 +1,11 @@
 bin/slim
+lib/libslim.so
+lib/libslim.so.%%VERSION%%
 %%DATADIR%%/themes/default/background.jpg
 %%DATADIR%%/themes/default/panel.png
 %%DATADIR%%/themes/default/slim.theme
- at dirrm %%DATADIR%%/themes/default
- at dirrmtry %%DATADIR%%/themes
- at dirrmtry %%DATADIR%%
- at unexec if cmp -s %D/etc/slim.conf.sample %D/etc/slim.conf; then rm -f %D/etc/slim.conf; fi
-etc/slim.conf.sample
- at exec if [ ! -f %D/etc/slim.conf ] ; then cp -p %D/%F %B/slim.conf; fi
-%%PAM%%@unexec if cmp -s %D/etc/pam.d/slim.default %D/etc/pam.d/slim; then rm -f %D/etc/pam.d/slim ; fi
+man/man1/slim.1.gz
+ at sample etc/slim.conf.sample
+%%PAM%%@unexec if cmp -s %D/etc/pam.d/slim.default %D/etc/pam.d/slim; then rm -f %D/etc/pam.d/slim; fi
 %%PAM%%etc/pam.d/slim.default
-%%PAM%%@exec if [ ! -f %D/etc/pam.d/slim ] ; then cp -p %D/%F %B/slim; fi
- at exec /bin/rm -f %D/share/man/man1/slim.1
+%%PAM%%@exec if [ ! -f %D/etc/pam.d/slim ]; then cp -p %D/%F %B/slim; fi



More information about the Midnightbsd-cvs mailing list