%global _trivial .0 %global _buildid .2 # Define common variables for the package %define _name xfce4-desktop %define version 4.20.0 %define release 1%{?dist} Name: %{_name} Version: %{version} Release: 1%{dist}%{?_trivial}%{?_buildid} Summary: A meta-package to install the XFCE4 desktop environment and common utilities. License: MIT BuildArch: noarch # No Source needed as this is a meta-package that only manages dependencies. Source1: xfce4-panel.xml Source2: thunar.xml # List all required packages. RPM will ensure these are present/installed. Requires: tigervnc-server Requires: firefox Requires: xfce4-session Requires: xfce4-settings Requires: xfce4-taskmanager Requires: xfce4-terminal Requires: xfce4-vala Requires: libxfce4windowing Requires: mousepad Requires: ristretto Requires: xarchiver Requires: xfconf Requires: xfdashboard Requires: xfdesktop Requires: xfwm4 Requires: xfce4-notes-plugin Requires: xfce4-mount-plugin Requires: xfce4-about Requires: xfce4-appfinder Requires: desktop-backgrounds Requires: Thunar Requires: plank Requires: gnome-icon-theme Requires: icon-naming-utils Requires: google-noto-sans-fonts Requires: google-noto-sans-cjk-sc-fonts Requires: google-noto-cjk-fonts Requires: google-noto-sans-mono-cjk-sc-fonts Requires: google-noto-serif-cjk-sc-fonts Requires: google-noto-serif-sc-fonts %description This package is a meta-package designed to pull in all the necessary components to set up a full XFCE4 desktop environment, along with additional utilities and fonts as specified. It simplifies the installation of a comprehensive XFCE4 environment on compatible systems. %install mkdir -p %{buildroot}%{_datadir}/my-xfce-config/ cp %{SOURCE1} %{buildroot}%{_datadir}/my-xfce-config/default.xml cp %{SOURCE2} %{buildroot}%{_datadir}/my-xfce-config/thunar.xml %posttrans cp %{_datadir}/my-xfce-config/default.xml /etc/xdg/xfce4/panel/default.xml cp %{_datadir}/my-xfce-config/thunar.xml /etc/xdg/Thunar/thunar.xml mkdir -p /etc/xdg/autostart cat > /etc/xdg/autostart/plank.desktop </dev/null; then echo "Info: 'ec2-user' found. Configuring .vnc/xstartup..." VNC_DIR="/home/ec2-user/.vnc" XSTARTUP_FILE="${VNC_DIR}/xstartup" # Create the .vnc directory if it doesn't exist mkdir -p "${VNC_DIR}" # Write the xstartup content using a 'here document' cat << 'EOF_XSTARTUP' > "${XSTARTUP_FILE}" #!/bin/bash unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS # Force X11 session type export XDG_SESSION_TYPE=x11 export XDG_CURRENT_DESKTOP=XFCE export XDG_SESSION_DESKTOP=XFCE export DISPLAY=:1 # or whatever your vncserver uses xrdb $HOME/.Xresources startxfce4 & EOF_XSTARTUP # Set executable permissions for the xstartup script chmod +x "${XSTARTUP_FILE}" # Set ownership of the .vnc directory and xstartup file to ec2-user chown ec2-user:ec2-user "${VNC_DIR}" chown ec2-user:ec2-user "${XSTARTUP_FILE}" fi %files %{_datadir}/my-xfce-config/default.xml %{_datadir}/my-xfce-config/thunar.xml %changelog * Fri Jul 25 2025 Yonghang Wang - 4.18.0-1 - Initial meta-package for XFCE4 desktop environment. - Configures xstartup for ec2-user if present.