|
|
@ -60,6 +60,73 @@ KDE 5 desktop settings for classic variant of Kometa |
|
|
|
|
|
|
|
|
|
|
|
#-------------------------------------------------------------- |
|
|
|
#-------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%define regex auth[[:space:]]([[:space:]]).*pam_env.so user_envfile=.kometa_env readenv=0 user_readenv=1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%package pam-env |
|
|
|
|
|
|
|
Summary: Hack PAM configs to make Qt5 applications ran by usermode use Kometa icons |
|
|
|
|
|
|
|
Summary(ru): Хак конфигов PAM, чтобы запущенные через usermode приложения на Qt5 использовали иконки Кометы |
|
|
|
|
|
|
|
Group: System/Base |
|
|
|
|
|
|
|
# %%_qt5_plugindir/platformthemes/libqgtk3.so |
|
|
|
|
|
|
|
Requires: libqt5-gui |
|
|
|
|
|
|
|
Requires: pam |
|
|
|
|
|
|
|
Requires(post): /bin/echo |
|
|
|
|
|
|
|
Requires(post): grep |
|
|
|
|
|
|
|
Requires(post): pam-config |
|
|
|
|
|
|
|
Requires(preun): grep |
|
|
|
|
|
|
|
Requires(preun): sed |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%description pam-env |
|
|
|
|
|
|
|
Hack PAM configs to make Qt5 applications ran by usermode use Kometa icons. |
|
|
|
|
|
|
|
%description -l ru_RU.UTF-8 pam-env |
|
|
|
|
|
|
|
Некоторые приложения, например, acc (alterator-standalone), запускаются из-под |
|
|
|
|
|
|
|
пользовательской сессии от root через usermode и при этом используют basealt |
|
|
|
|
|
|
|
в качестве иконки. В KDE 5 под X11 приложение само после запуска устанавливает иконку |
|
|
|
|
|
|
|
на панели задач. Темы иконок kometa* в качестве иконки basealt устанавливают логотип |
|
|
|
|
|
|
|
Кометы вместо Базальта, чтобы не создавать ошибочное впечатление, что Комета — продукт |
|
|
|
|
|
|
|
Базальта. Но из-под root Qt5 не узнает тему иконок и использует иконку basealt не из |
|
|
|
|
|
|
|
темы Кометы. Этот пакет при установке подключает выставление переменной окружения |
|
|
|
|
|
|
|
QT_QPA_PLATFORMTHEME=gtk3 для root, благодаря чему Qt5 начинает использовать |
|
|
|
|
|
|
|
пользовательскую тему иконок под root. Удаление пакета отключает выставление переменной. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files pam-env |
|
|
|
|
|
|
|
/root/.kometa_env |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# echo -e is a bashism |
|
|
|
|
|
|
|
%post pam-env |
|
|
|
|
|
|
|
# This scriptlet sees if pam_env.so <...> exists in PAM configuration and adds it to there if it does not. |
|
|
|
|
|
|
|
# It does not add if if a sysadmin manually commented it out. |
|
|
|
|
|
|
|
# /etc/control.d/facilities/ seemed to be too complex and not easy to use for this task, so inventing a bicycle. |
|
|
|
|
|
|
|
TEXT='auth\t\toptional\tpam_env.so user_envfile=.kometa_env readenv=0 user_readenv=1' |
|
|
|
|
|
|
|
# based on /etc/control.d/facilities/pam_access |
|
|
|
|
|
|
|
CONFIG_COMMON=/etc/pam.d/system-auth-common |
|
|
|
|
|
|
|
CONFIG_SYSTEM=/etc/pam.d/system-auth |
|
|
|
|
|
|
|
if [ -f "$CONFIG_COMMON" ] |
|
|
|
|
|
|
|
then |
|
|
|
|
|
|
|
CONFIG="$CONFIG_COMMON" |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
CONFIG="$(readlink -e "$CONFIG_SYSTEM")" || CONFIG="$CONFIG_SYSTEM" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
if ! grep -qE "%regex" "$CONFIG" |
|
|
|
|
|
|
|
then |
|
|
|
|
|
|
|
echo "Adding loading ~/.kometa_env into PAM configs..." |
|
|
|
|
|
|
|
cp "$CONFIG" "$CONFIG".rpmsave |
|
|
|
|
|
|
|
# do not rely that shell-builtin 'echo' is capable of '-e' (not POSIX sh) |
|
|
|
|
|
|
|
/bin/echo -e "$TEXT" >> "$CONFIG" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%preun pam-env |
|
|
|
|
|
|
|
# Package removal, not upgrade |
|
|
|
|
|
|
|
if [ "$1" -eq 0 ]; then |
|
|
|
|
|
|
|
for file in /etc/pam.d/system-auth-common /etc/pam.d/system-auth |
|
|
|
|
|
|
|
do |
|
|
|
|
|
|
|
if grep -qE "^%regex" "$file"; then |
|
|
|
|
|
|
|
echo "Removing loading ~/.kometa_env from PAM config ${file}..." |
|
|
|
|
|
|
|
sed -i'.rpmsave' -E -e "/^%regex/d" "$file" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
#-------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
%prep |
|
|
|
%prep |
|
|
|
%setup -q |
|
|
|
%setup -q |
|
|
|
cp %SOURCE1 . |
|
|
|
cp %SOURCE1 . |
|
|
@ -81,6 +148,9 @@ install -m0755 scripts/systemd.sh %buildroot%_user_env_gen_dir/10-kometa-xdg.sh |
|
|
|
mkdir -p %buildroot/etc/xdg/kometa |
|
|
|
mkdir -p %buildroot/etc/xdg/kometa |
|
|
|
install -m0644 plasma5/* %buildroot/etc/xdg/kometa |
|
|
|
install -m0644 plasma5/* %buildroot/etc/xdg/kometa |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mkdir -p %buildroot/root |
|
|
|
|
|
|
|
echo QT_QPA_PLATFORMTHEME=gtk3 > %buildroot/root/.kometa_env |
|
|
|
|
|
|
|
|
|
|
|
%check |
|
|
|
%check |
|
|
|
cd scripts |
|
|
|
cd scripts |
|
|
|
./test.sh |
|
|
|
./test.sh |
|
|
|