From 53940e72aa512ef8097e82460a57b2bb1efbea67 Mon Sep 17 00:00:00 2001 From: Grooooot Date: Wed, 15 Jan 2020 19:16:14 +0800 Subject: [PATCH] update spec --- ...tx-auto-display-select-work-with-per.patch | 35 ------- Xclients | 78 ---------------- Xmodmap | 25 ----- Xresources | 13 --- Xsession | 93 ------------------- localuser.sh | 12 --- xinit-1.0.2-client-session.patch | 38 -------- xinit-1.3.4-set-XORG_RUN_AS_USER_OK.patch | 15 --- xinit-compat | 7 -- xinit-compat.desktop | 4 - xinitrc | 33 ------- xinitrc-common | 61 ------------ xorg-x11-xinit.spec | 30 +----- 13 files changed, 4 insertions(+), 440 deletions(-) delete mode 100644 0003-startx-Make-startx-auto-display-select-work-with-per.patch delete mode 100644 Xclients delete mode 100644 Xmodmap delete mode 100644 Xresources delete mode 100644 Xsession delete mode 100644 localuser.sh delete mode 100644 xinit-1.0.2-client-session.patch delete mode 100644 xinit-1.3.4-set-XORG_RUN_AS_USER_OK.patch delete mode 100644 xinit-compat delete mode 100644 xinit-compat.desktop delete mode 100644 xinitrc delete mode 100644 xinitrc-common diff --git a/0003-startx-Make-startx-auto-display-select-work-with-per.patch b/0003-startx-Make-startx-auto-display-select-work-with-per.patch deleted file mode 100644 index aa67ba0..0000000 --- a/0003-startx-Make-startx-auto-display-select-work-with-per.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 72939fed64b00be4a74dd0e1bf0b418e00ac4c57 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 20 Mar 2015 14:30:08 +0100 -Subject: [PATCH xinit 3/3] startx: Make startx auto display select work with - per user /tmp dirs - -If a separate /tmp per user is used the existing auto display select code -does not work, add an extra check for the unix socket for the display number -existing in /proc/net/unix (linux only). - -Signed-off-by: Hans de Goede ---- - startx.cpp | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/startx.cpp b/startx.cpp -index fe49996..3b0dd86 100644 ---- a/startx.cpp -+++ b/startx.cpp -@@ -120,7 +120,11 @@ enable_xauth=1 - XCOMM Automatically determine an unused $DISPLAY - d=0 - while true ; do -- [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || break -+ [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || -+#ifdef __linux__ -+ grep -q "/tmp/.X11-unix/X$d" "/proc/net/unix" || -+#endif -+ break - d=$(($d + 1)) - done - defaultdisplay=":$d" --- -2.3.3 - diff --git a/Xclients b/Xclients deleted file mode 100644 index 1d6d6f7..0000000 --- a/Xclients +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This -# copyrighted material is made available to anyone wishing to use, modify, -# copy, or redistribute it subject to the terms and conditions of the -# GNU General Public License version 2. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -GSESSION="$(type -p gnome-session)" -MSESSION="$(type -p mate-session)" -STARTKDE="$(type -p startkde)" -STARTLXDE="$(type -p startlxde)" - -# check to see if the user has a preferred desktop -PREFERRED= -if [ -f /etc/sysconfig/desktop ]; then - . /etc/sysconfig/desktop - if [ "$DESKTOP" = "GNOME" ]; then - PREFERRED="$GSESSION" - elif [ "$DESKTOP" = "MATE" ]; then - PREFERRED="$MSESSION" - elif [ "$DESKTOP" = "KDE" ]; then - PREFERRED="$STARTKDE" - elif [ "$DESKTOP" = "LXDE" ]; then - PREFERRED="$STARTLXDE" - fi -fi - -if [ -n "$PREFERRED" ]; then - exec "$PREFERRED" -fi - -# now if we can reach here, either no desktop file was present, -# or the desktop requested is not installed. - -if [ -n "$GSESSION" ]; then - # by default, we run GNOME. - exec "$GSESSION" -elif [ -n "$STARTKDE" ]; then - # if GNOME isn't installed, try KDE. - exec "$STARTKDE" -elif [ -n "$STARTLXDE" ]; then - # if neither GNOME nor KDE then LXDE - exec "$STARTLXDE" -fi - -# We should also support /etc/X11/xinit/Xclients.d scripts -XCLIENTS_D=/etc/X11/xinit/Xclients.d -if [ "$#" -eq 1 ] && [ -x "$XCLIENTS_D/Xclients.$1.sh" ]; then - exec -l $SHELL -c "$SSH_AGENT $XCLIENTS_D/Xclients.$1.sh" -fi - -# Failsafe. - -# these files are left sitting around by TheNextLevel. -rm -f $HOME/Xrootenv.0 - -# Argh! Nothing good is installed. Fall back to twm -{ - # gosh, neither fvwm95 nor fvwm2 is available; - # fall back to failsafe settings - [ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45' - - if [ -x /usr/bin/xclock ] ; then - /usr/bin/xclock -geometry 100x100-5+5 & - fi - if [ -x /usr/bin/xterm ] ; then - /usr/bin/xterm -geometry 80x50-50+150 & - fi - if [ -x /usr/bin/firefox -a -f /usr/share/doc/HTML/index.html ]; then - /usr/bin/firefox /usr/share/doc/HTML/index.html & - fi - if [ -x /usr/bin/twm ] ; then - exec /usr/bin/twm - fi -} diff --git a/Xmodmap b/Xmodmap deleted file mode 100644 index 5625f3a..0000000 --- a/Xmodmap +++ /dev/null @@ -1,25 +0,0 @@ -! /etc/X11/Xmodmap -! -! global Xmodmap file -- used by both xdm and xinit (startx) - -! keycode and keysym remapping should generally be used only if the X -! server config file has been configured to disable the XKEYBOARD -! extension - -! i386 and alpha -! keycode 22 = BackSpace -! keycode 107 = Delete - -! powerpc -! keycode 59 = BackSpace -! keycode 125 = Delete - -! sparc -! keycode 50 = BackSpace -! keycode 73 = Delete - -! Euro sign support -! keycode 26 = e E currency -! keycode 54 = c C cent -! keycode 113 = Mode_switch Mode_switch Multi_key - diff --git a/Xresources b/Xresources deleted file mode 100644 index 814e990..0000000 --- a/Xresources +++ /dev/null @@ -1,13 +0,0 @@ -! This is the global resources file that is loaded when -! all users log in, as well as for the login screen - -! Fix the Xft dpi to 96; this prevents tiny fonts -! or HUGE fonts depending on the screen size. -Xft.dpi: 96 - -! hintstyle: medium means that (for Postscript fonts) we -! position the stems for maximum constrast and consistency -! but do not force the stems to integral widths. hintnone, -! hintslight, and hintfull are the other possibilities. -Xft.hintstyle: hintmedium -Xft.hinting: true diff --git a/Xsession b/Xsession deleted file mode 100644 index 2cffea1..0000000 --- a/Xsession +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash -# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This -# copyrighted material is made available to anyone wishing to use, modify, -# copy, or redistribute it subject to the terms and conditions of the -# GNU General Public License version 2. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -# redirect errors to a file in user's home directory if we can -if [ -z "$GDMSESSION" ]; then - # GDM redirect output itself in a smarter fashion - errfile="$HOME/.xsession-errors" - if ( umask 077 && cp /dev/null "$errfile" 2> /dev/null ); then - chmod 600 "$errfile" - [ -x /sbin/restorecon ] && /sbin/restorecon $errfile - exec > "$errfile" 2>&1 - else - errfile=$(mktemp -q /tmp/xses-$USER.XXXXXX) - if [ $? -eq 0 ]; then - exec > "$errfile" 2>&1 - fi - fi -fi - -SWITCHDESKPATH=/usr/share/switchdesk - -# Mandatorily source xinitrc-common, which is common code shared between the -# Xsession and xinitrc scripts which has been factored out to avoid duplication -. /etc/X11/xinit/xinitrc-common - -# This Xsession.d implementation, is intended to obsolete and replace the -# various mechanisms present in the 'case' statement which follows, and to -# eventually be able to easily remove all hard coded window manager specific -# content from this script. See bug #142260 for additional explanation and -# details. All window manager rpm packages and desktop environment -# packages should be modified to provide the Xsession.d/Xsession.$wm scripts -# to start themselves up. In the future, the legacy switchdesk mechanisms -# and hard coded window managers and desktop environments will be removed from -# this script. -XCLIENTS_D=/etc/X11/xinit/Xclients.d -if [ "$#" -eq 1 ] && [ -x "$XCLIENTS_D/Xclients.$1.sh" ]; then - exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $XCLIENTS_D/Xclients.$1.sh" -else -# now, we see if xdm/gdm/kdm has asked for a specific environment -case $# in -1) - if [ -x "$SWITCHDESKPATH/Xclients.$1" ]; then - exec -l $SHELL -c "$SWITCHDESKPATH/Xclients.$1"; - fi; - - case "$1" in - failsafe) - exec -l $SHELL -c "xterm -geometry 80x24-0-0" - ;; - gnome|gnome-session) - # lack of SSH_AGENT is intentional, see #441123. though - # the whole thing should really happen in xinitrc.d anyway. - exec -l $SHELL -c gnome-session - exec /bin/sh -c "exec -l $SHELL -c \"gnome-session\"" - ;; - kde|kde1|kde2) - exec $CK_XINIT_SESSION $SSH_AGENT /bin/sh -c "exec -l $SHELL -c \"startkde\"" - ;; - twm) - # fall back to twm - exec $CK_XINIT_SESSION $SSH_AGENT /bin/sh -c "exec -l $SHELL -c \"twm\"" - ;; - *) - # GDM provies either a command line as the first argument or - # provides 'failsafe', 'default' or 'custom'. KDM will do the - # same at some point - if [ "$1" != "default" -a "$1" != "custom" ]; then - exec $CK_XINIT_SESSION $SSH_AGENT /bin/sh -c "exec -l $SHELL -c \"$1\"" - fi - ;; - esac -esac -fi - -# otherwise, take default action -if [ -x "$HOME/.xsession" ]; then - exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $HOME/.xsession" -elif [ -x "$HOME/.Xclients" ]; then - exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $HOME/.Xclients" -elif [ -x /etc/X11/xinit/Xclients ]; then - exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT /etc/X11/xinit/Xclients" -else - # should never get here; failsafe fallback - exec -l $SHELL -c "xsm" -fi - diff --git a/localuser.sh b/localuser.sh deleted file mode 100644 index 0cf6fe6..0000000 --- a/localuser.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (C) 2006 Red Hat, Inc. All rights reserved. This -# copyrighted material is made available to anyone wishing to use, modify, -# copy, or redistribute it subject to the terms and conditions of the -# GNU General Public License version 2. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -[ -x /usr/bin/xhost ] && [ -x /usr/bin/id ] && - xhost +si:localuser:`id -un` >& /dev/null diff --git a/xinit-1.0.2-client-session.patch b/xinit-1.0.2-client-session.patch deleted file mode 100644 index f463f68..0000000 --- a/xinit-1.0.2-client-session.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -up xinit-1.3.4/xinit.c.client-session xinit-1.3.4/xinit.c ---- xinit-1.3.4/xinit.c.client-session 2014-03-25 10:20:26.000000000 +0100 -+++ xinit-1.3.4/xinit.c 2014-09-11 17:03:30.928360694 +0200 -@@ -89,6 +89,8 @@ char xserverrcbuf[256]; - - #define TRUE 1 - #define FALSE 0 -+#define OK_EXIT 0 -+#define ERR_EXIT 1 - - static char *default_server = "X"; - static char *default_display = ":0"; /* choose most efficient */ -@@ -560,6 +562,7 @@ startClient(char *client_argv[]) - { - clientpid = fork(); - if (clientpid == 0) { -+ int fd; - set_environment(); - setWindowPath(); - -@@ -567,7 +570,16 @@ startClient(char *client_argv[]) - Error("cannot change uid"); - _exit(EXIT_FAILURE); - } -- setpgid(0, getpid()); -+ fd = open ("/dev/null", O_RDONLY); -+ -+ if (fd < 0) { -+ Error("cannot open /dev/null: %s\n", strerror(errno)); -+ _exit(ERR_EXIT); -+ } -+ close (STDIN_FILENO); -+ dup2 (fd, STDIN_FILENO); -+ close (fd); -+ setsid(); - Execute(client_argv); - Error("Unable to run program \"%s\"", client_argv[0]); - diff --git a/xinit-1.3.4-set-XORG_RUN_AS_USER_OK.patch b/xinit-1.3.4-set-XORG_RUN_AS_USER_OK.patch deleted file mode 100644 index 8e36e5d..0000000 --- a/xinit-1.3.4-set-XORG_RUN_AS_USER_OK.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up xinit-1.3.4/startx.cpp~ xinit-1.3.4/startx.cpp ---- xinit-1.3.4/startx.cpp~ 2015-03-18 12:13:11.000000000 +0100 -+++ xinit-1.3.4/startx.cpp 2015-03-18 12:49:49.445624223 +0100 -@@ -140,8 +140,10 @@ - have_vtarg="yes" - fi - done --if [ "$have_vtarg" = "no" ]; then -+if [ "$have_vtarg" = "no" -a x"$vtarg" != x ]; then - serverargs="$serverargs $vtarg" -+ XCOMM Fedora specific mod to make X run as non root -+ export XORG_RUN_AS_USER_OK=1 - fi - - XCOMM if no display, use default diff --git a/xinit-compat b/xinit-compat deleted file mode 100644 index 863956c..0000000 --- a/xinit-compat +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -for session in ~/.xsession ~/.Xclients /etc/X11/xinit/Xclients ; -do -if [ -f ${session} ] ; then - exec ${session} -fi -done diff --git a/xinit-compat.desktop b/xinit-compat.desktop deleted file mode 100644 index c11478d..0000000 --- a/xinit-compat.desktop +++ /dev/null @@ -1,4 +0,0 @@ -[Desktop Entry] -Name=User script -Comment=This session runs ~/.xsession or ~/.Xclients if available -Exec=/usr/libexec/xinit-compat diff --git a/xinitrc b/xinitrc deleted file mode 100644 index 39e5b10..0000000 --- a/xinitrc +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# Copyright (C) 1999 - 2005 Red Hat, Inc. All rights reserved. This -# copyrighted material is made available to anyone wishing to use, modify, -# copy, or redistribute it subject to the terms and conditions of the -# GNU General Public License version 2. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# Authors: -# Mike A. Harris - -# Mandatorily source xinitrc-common, which is common code shared between the -# Xsession and xinitrc scripts which has been factored out to avoid duplication -. /etc/X11/xinit/xinitrc-common - -# The user may have their own clients they want to run. If they don't, -# fall back to system defaults. -if [ -f $HOME/.Xclients ]; then - exec $CK_XINIT_SESSION $SSH_AGENT $HOME/.Xclients || \ - exec $CK_XINIT_SESSION $SSH_AGENT $HOME/.Xclients -elif [ -f /etc/X11/xinit/Xclients ]; then - exec $CK_XINIT_SESSION $SSH_AGENT /etc/X11/xinit/Xclients || \ - exec $CK_XINIT_SESSION $SSH_AGENT /etc/X11/xinit/Xclients -else - # Failsafe settings. Although we should never get here - # (we provide fallbacks in Xclients as well) it can't hurt. - [ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45' - [ -x /usr/bin/xclock ] && /usr/bin/xclock -geometry 100x100-5+5 & - [ -x /usr/bin/xterm ] && xterm -geometry 80x50-50+150 & - [ -x /usr/bin/twm ] && /usr/bin/twm -fi diff --git a/xinitrc-common b/xinitrc-common deleted file mode 100644 index 6509c80..0000000 --- a/xinitrc-common +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This -# copyrighted material is made available to anyone wishing to use, modify, -# copy, or redistribute it subject to the terms and conditions of the -# GNU General Public License version 2. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -# xinitrc-common -# -# This is common code shared by both Xsession and xinitrc scripts. Be sure -# to take this into account when fixing bugs or adding new functionality. - -# Set up i18n environment -if [ -r /etc/profile.d/lang.sh ]; then - . /etc/profile.d/lang.sh -fi - -[ -r $HOME/.profile ] && . $HOME/.profile - -userresources=$HOME/.Xresources -usermodmap=$HOME/.Xmodmap -userxkbmap=$HOME/.Xkbmap - -sysresources=/etc/X11/Xresources -sysmodmap=/etc/X11/Xmodmap -sysxkbmap=/etc/X11/Xkbmap - -# merge in defaults -[ -r "$sysresources" ] && xrdb -nocpp -merge "$sysresources" -[ -r "$userresources" ] && xrdb -merge "$userresources" - -# merge in keymaps -if [ -r "$sysxkbmap" ]; then - setxkbmap $(cat "$sysxkbmap") -fi - -if [ -r "$userxkbmap" ]; then - setxkbmap $(cat "$userxkbmap") -fi - -# xkb and xmodmap don't play nice together -if ! [ -r "$sysxkbmap" -o -r "$userxkbmap" ] ; then - [ -r "$sysmodmap" ] && xmodmap "$sysmodmap" - [ -r "$usermodmap" ] && xmodmap "$usermodmap" -fi - -# run all system xinitrc shell scripts. -for file in /etc/X11/xinit/xinitrc.d/* ; do - . $file -done - -# Prefix launch of session with ssh-agent if available and not already running. -if [ -z "$SSH_AGENT" ] && [ -z "$SSH_AUTH_SOCK" ] && [ -z "$SSH_AGENT_PID" ] && [ -x /usr/bin/ssh-agent ]; then - if [ "x$TMPDIR" != "x" ]; then - SSH_AGENT="/usr/bin/ssh-agent /bin/env TMPDIR=$TMPDIR" - else - SSH_AGENT="/usr/bin/ssh-agent" - fi -fi diff --git a/xorg-x11-xinit.spec b/xorg-x11-xinit.spec index 3fc25a4..0eb73ae 100644 --- a/xorg-x11-xinit.spec +++ b/xorg-x11-xinit.spec @@ -1,23 +1,10 @@ Name: xorg-x11-xinit Version: 1.4.0 -Release: 4 +Release: 5 Summary: X.Org X11 X Window System xinit startup scripts License: MIT URL: https://www.x.org Source0: https://xorg.freedesktop.org/archive/individual/app/xinit-%{version}.tar.bz2 -Source1: xinitrc-common -Source2: xinitrc -Source3: Xclients -Source4: Xmodmap -Source5: Xresources -Source6: Xsession -Source7: localuser.sh -Source8: xinit-compat.desktop -Source9: xinit-compat - -Patch0000: xinit-1.0.2-client-session.patch -Patch0001: 0003-startx-Make-startx-auto-display-select-work-with-per.patch -Patch0002: xinit-1.3.4-set-XORG_RUN_AS_USER_OK.patch BuildRequires:automake gcc gcc-c++ pkgconfig(x11) dbus-devel @@ -44,30 +31,21 @@ Help document for th xorg-x11-xinit package. %install %make_install -install -p -m644 -D %{SOURCE8} $RPM_BUILD_ROOT%{_datadir}/xsessions/xinit-compat.desktop -install -D -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/xinitrc-common -for script in %{SOURCE2} %{SOURCE3} %{SOURCE6} ; do - install -p -m 755 $script $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/${script##*/} -done -install -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/X11/Xmodmap -install -p -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/X11/Xresources -install -D -p -m 755 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/xinitrc.d/localuser.sh install -d %{buildroot}%{_sysconfdir}/X11/xinit/Xclients.d -install -D -p -m 755 %{SOURCE9} $RPM_BUILD_ROOT%{_libexecdir}/xinit-compat %files %doc COPYING README ChangeLog %{_bindir}/* %{_sysconfdir}/X11/xinit/* %config(noreplace) %{_sysconfdir}/X11/* -%{_sysconfdir}/X11/xinit/xinitrc.d/* -%{_libexecdir}/xinit-compat -%{_datadir}/xsessions/xinit-compat.desktop %files help %{_mandir}/man1/startx.1* %{_mandir}/man1/xinit.1* %changelog +* Wed Jan 15 2020 openEuler Buildteam - 1.4.0-5 +- update spec + * Fri Oct 25 2019 Lijin Yang - 1.4.0-4 - Package init