Package icewm-startup: Specfile

%def_without xtdesktop
%def_without desklaunch
Name: icewm-startup
Version: 0.11
Release: alt3

Summary: simple pluggable IceWM autostart manager

Summary(ru_RU.CP1251): \xec\xe5\xed\xe5\xe4\xe6\xe5\xf0 \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0 \xef\xf0\xee\xe3\xf0\xe0\xec\xec IceWM
License: GPL
Group: Graphical desktop/Icewm
Url: http://www.imath.kiev.ua/~vlasenko/

Packager: Igor Vlasenko <viy@altlinux.ru>
#Source: %name-%version.tar.bz2

BuildArch: noarch
AutoReq: no

# uncomment if you want to backport prior to M30
#define icewmconfdir #_x11x11dir/icewm
#Requires: icewm
%define icewmconfdir %_sysconfdir/X11/icewm
#due to new icewmconfdir in /etc/X11
Requires: icewm >= 1.2.25

%description
Simple pluggable icewm autostart manager is a generic IceWM startup script
which allows one to configure IceWM default autostart via installing corresponding rpm plug-ins.

%description -l ru_RU.CP1251
\xec\xe5\xed\xe5\xe4\xe6\xe5\xf0 \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0 \xef\xf0\xee\xe3\xf0\xe0\xec\xec IceWM
\xef\xee\xe7\xe2\xee\xeb\xff\xe5\xf2 \xef\xf3\xf2\xe5\xec \xf3\xf1\xf2\xe0\xed\xee\xe2\xea\xe8 rpm \xf0\xe0\xf1\xf8\xe8\xf0\xe5\xed\xe8\xe9 \xef\xf0\xee\xf1\xf2\xee \xed\xe0\xf1\xf2\xf0\xe0\xe8\xe2\xe0\xf2\xfc 
\xf0\xe0\xe1\xee\xf7\xe8\xe9 \xf1\xf2\xee\xeb IceWM \xef\xee \xf3\xec\xee\xeb\xf7\xe0\xed\xe8\xfe \xf1\xf0\xe0\xe7\xf3 \xe4\xeb\xff \xe2\xf1\xe5\xf5 \xef\xee\xeb\xfc\xe7\xee\xe2\xe0\xf2\xe5\xeb\xe5\xe9, 
\xf1\xee\xf5\xf0\xe0\xed\xff\xff \xe7\xe0 \xef\xee\xeb\xfc\xe7\xee\xe2\xe0\xf2\xe5\xeb\xff\xec\xe8 \xef\xee\xeb\xed\xf3\xfe \xf1\xe2\xee\xe1\xee\xe4\xf3 \xef\xe5\xf0\xf1\xee\xed\xe0\xeb\xfc\xed\xee\xe9 \xed\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8
\xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0.

\xc8\xec\xe5\xfe\xf9\xe8\xe5\xf1\xff \xec\xee\xe4\xf3\xeb\xe8 \xef\xee\xe7\xe2\xee\xeb\xff\xfe\xf2 \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 icewm \xee\xe1\xed\xee\xe2\xeb\xff\xf2\xfc \xeb\xee\xea\xe0\xeb\xfc\xed\xee\xe5 \xec\xe5\xed\xfe \xef\xee\xeb\xfc\xe7\xee\xe2\xe0\xf2\xe5\xeb\xff
(\xe5\xf1\xeb\xe8 \xf3 \xed\xe5\xe3\xee \xee\xed\xee \xe5\xf1\xf2\xfc), \xe7\xe0\xef\xf3\xf1\xea\xe0\xf2\xfc ivman, gkrellm, xxkb,
\xe7\xe0\xef\xf3\xf1\xea\xe0\xf2\xfc \xf0\xe0\xe1\xee\xf7\xe8\xe9 \xf1\xf2\xee\xeb (idesk, xtdesktop, desklaunch, kdesktop) \xe8 \xf2. \xe4.

%package gkrellm
Group: Graphical desktop/Icewm
Summary: gkrellm autostart at IceWM startup
Summary(ru_RU.CP1251): \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea gkrellm \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM
# xtoolwait is required because icewm is not launched yet
Requires: %name gkrellm xtoolwait
AutoReq: no

%description gkrellm
gkrellm plug-in for simple pluggable IceWM autostart manager.
%description -l ru_RU.CP1251 gkrellm
\xe7\xe0\xef\xf3\xf1\xea gkrellm \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM
(\xd2\xf0\xe5\xe1\xf3\xe5\xf2 \xec\xe5\xed\xe5\xe4\xe6\xe5\xf0 \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0 \xef\xf0\xee\xe3\xf0\xe0\xec\xec IceWM).

%package idesk
Group: Graphical desktop/Icewm
Summary: idesk autostart at IceWM startup
Summary(ru_RU.CP1251): \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea idesk \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM
Requires: %name idesk
Conflicts: %name-kdesktop
AutoReq: no

%description idesk
idesk plug-in for simple pluggable IceWM autostart manager.
%description -l ru_RU.CP1251 idesk
idesk plug-in \xe4\xeb\xff \xec\xe5\xed\xe5\xe4\xe6\xe5\xf0\xe0 \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0 \xef\xf0\xee\xe3\xf0\xe0\xec\xec \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM.

%package kdesktop
Group: Graphical desktop/Icewm
Summary: kdesktop autostart at IceWM startup
Summary(ru_RU.CP1251): \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea kdesktop \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM
Requires: %name kdebase-wm
Conflicts: %name-idesk
AutoReq: no

%description kdesktop
kdesktop plug-in for simple pluggable IceWM autostart manager.
%description -l ru_RU.CP1251 kdesktop
kdesktop plug-in \xe4\xeb\xff \xec\xe5\xed\xe5\xe4\xe6\xe5\xf0\xe0 \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0 \xef\xf0\xee\xe3\xf0\xe0\xec\xec \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM.

%package xxkb
Group: Graphical desktop/Icewm
Summary: xxkb autostart at IceWM startup
Summary(ru_RU.CP1251): \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea xxkb \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM
Requires: %name xxkb
AutoReq: no

%description xxkb
xxkb plug-in for simple pluggable IceWM autostart manager.
~/.xxkbrc or /etc/X11/app-defaults/XXkb is required.
%description -l ru_RU.CP1251 xxkb
xxkb plug-in \xe4\xeb\xff \xec\xe5\xed\xe5\xe4\xe6\xe5\xf0\xe0 \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0 \xef\xf0\xee\xe3\xf0\xe0\xec\xec \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM.
\xcf\xeb\xe0\xe3\xe8\xed \xe7\xe0\xef\xf3\xf1\xea\xe0\xe5\xf2 xxkb \xf2\xee\xeb\xfc\xea\xee \xef\xf0\xe8 \xed\xe0\xeb\xe8\xf7\xe8\xe8 ~/.xxkbrc \xe8\xeb\xe8 
/etc/X11/app-defaults/XXkb.

%if_with desklaunch
%package desklaunch
Group: Graphical desktop/Icewm
Summary: desklaunch autostart at IceWM startup
Summary(ru_RU.CP1251): \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea desklaunch \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM
Requires: %name desklaunch
AutoReq: no
%endif #desklaunch

%if_with desklaunch
%description desklaunch
desklaunch plug-in for simple pluggable IceWM autostart manager.
desklaunch is only launched for users that have ~/.desklaunchrc.
%description -l ru_RU.CP1251 desklaunch
desklaunch plug-in \xe4\xeb\xff \xec\xe5\xed\xe5\xe4\xe6\xe5\xf0\xe0 \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0 \xef\xf0\xee\xe3\xf0\xe0\xec\xec IceWM.
\xcf\xeb\xe0\xe3\xe8\xed \xe7\xe0\xef\xf3\xf1\xea\xe0\xe5\xf2 desklaunch \xf2\xee\xeb\xfc\xea\xee \xef\xf0\xe8 \xed\xe0\xeb\xe8\xf7\xe8\xe8 ~/.desklaunchrc.
%endif #desklaunch

%if_with xtdesktop
%package xtdesktop
Group: Graphical desktop/Icewm
Summary: xtdesktop autostart at IceWM startup
Summary(ru_RU.CP1251): \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea xtdesktop \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM
Requires: %name xtdesktop
AutoReq: no
%endif #xtdesktop

%if_with xtdesktop
%description xtdesktop
xtdesktop plug-in for simple pluggable IceWM autostart manager.
xtdesktop is only launched for users that have ~/.xtdeskrc.
%description -l ru_RU.CP1251 xtdesktop
xtdesktop plug-in \xe4\xeb\xff \xec\xe5\xed\xe5\xe4\xe6\xe5\xf0\xe0 \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0 \xef\xf0\xee\xe3\xf0\xe0\xec\xec IceWM.
\xcf\xeb\xe0\xe3\xe8\xed \xe7\xe0\xef\xf3\xf1\xea\xe0\xe5\xf2 xtdesktop \xf2\xee\xeb\xfc\xea\xee \xef\xf0\xe8 \xed\xe0\xeb\xe8\xf7\xe8\xe8 ~/.xtdeskrc.
%endif #xtdesktop

%package ivman
Group: Graphical desktop/Icewm
Summary: ivman autostart at IceWM startup
Summary(ru_RU.CP1251): \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea ivman \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM
Requires: %name ivman
AutoReq: no

%description ivman
ivman plug-in for simple pluggable IceWM autostart manager.
%description -l ru_RU.CP1251 ivman
ivman plug-in \xe4\xeb\xff \xec\xe5\xed\xe5\xe4\xe6\xe5\xf0\xe0 \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0 \xef\xf0\xee\xe3\xf0\xe0\xec\xec IceWM.

%package update-menus
Group: Graphical desktop/Icewm
Summary: autoupdate of user menu at IceWM startup
Summary(ru_RU.CP1251): \xe0\xe2\xf2\xee\xee\xe1\xed\xee\xe2\xeb\xe5\xed\xe8\xe5 \xec\xe5\xed\xfe \xef\xee\xeb\xfc\xe7\xee\xe2\xe0\xf2\xe5\xeb\xff \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM (\xef\xf0\xe8 \xed\xe5\xee\xe1\xf5\xee\xe4\xe8\xec\xee\xf1\xf2\xe8)
Requires: %name menu
AutoReq: no

%description update-menus
update-menus plug-in for simple pluggable IceWM autostart manager.
Does autoupdate of user menu at IceWM startup. (~/.icewm/menu).

%description -l ru_RU.CP1251 update-menus
update-menus plug-in \xe4\xeb\xff \xec\xe5\xed\xe5\xe4\xe6\xe5\xf0\xe0 \xe0\xe2\xf2\xee\xe7\xe0\xef\xf3\xf1\xea\xe0 \xef\xf0\xee\xe3\xf0\xe0\xec\xec IceWM.
\xe0\xe2\xf2\xee\xee\xe1\xed\xee\xe2\xeb\xe5\xed\xe8\xe5 \xec\xe5\xed\xfe \xef\xee\xeb\xfc\xe7\xee\xe2\xe0\xf2\xe5\xeb\xff \xef\xf0\xe8 \xf1\xf2\xe0\xf0\xf2\xe5 IceWM. 
\xc0\xe2\xf2\xee\xee\xe1\xed\xee\xe2\xeb\xe5\xed\xe8\xe5 \xe7\xe0\xef\xf3\xf1\xea\xe0\xe5\xf2\xf1\xff \xf2\xee\xeb\xfc\xea\xee \xe5\xf1\xeb\xe8 \xef\xee\xeb\xfc\xe7\xee\xe2\xe0\xf2\xe5\xeb\xfc 
\xed\xe5 \xef\xee\xeb\xfc\xe7\xf3\xe5\xf2\xf1\xff \xee\xe1\xf9\xe5\xf1\xe8\xf1\xf2\xe5\xec\xed\xfb\xec \xec\xe5\xed\xfe, \xe0 \xef\xf0\xe5\xe4\xef\xee\xf7\xe8\xf2\xe0\xe5\xf2 
\xeb\xee\xea\xe0\xeb\xfc\xed\xee\xe5 \xec\xe5\xed\xfe \xe8\xe7 ~/.icewm/menu.

%prep
%setup -q -c -T

%build

cat > README.ru_RU.CP1251 <<EOF



~/.icewm/startup.d

# starting all system-wide icewm autostart programs
for file in %icewmconfdir/startup.d/*; do
  userfile=~/.icewm/startup.d/`echo $file | sed -e 's,%icewmconfdir/startup.d/,,'`
  # root can disable autostart removing 'execute' bits
  if [ -x $file ]; then 
    # User-supplied programs disable system-wide programs.
    # So user can disable system-wide program 
    # by touching file in ~/.icewm/startup.d/ with the same name
    # or even replace it with his own script.

    # skip system-wide program if user-supplied file exists.
    [ -e $userfile ] || . $file
  fi
done

# starting user-supplied icewm autostart programs
for file in ~/.icewm/startup.d/*; do
  # running user files 
  # user can disable autostart removing 'execute' bits
  [ -x $file ] && . $file
done


EOF



%install
%__mkdir_p %buildroot/%icewmconfdir/startup.d
cat <<'EOF' > %buildroot/%icewmconfdir/startup
#!/bin/sh

# starting all system-wide icewm autostart programs
for file in %icewmconfdir/startup.d/*; do
  userfile=~/.icewm/startup.d/`echo $file | sed -e 's,%icewmconfdir/startup.d/,,'`
  # root can disable autostart removing 'execute' bits
  if [ -x $file ]; then 
    # User-supplied programs disable system-wide programs.
    # So user can disable system-wide program 
    # by touching file in ~/.icewm/startup.d/ with the same name
    # or even replace it with his own script.

    # skip system-wide program if user-supplied file exists.
    [ -e $userfile ] || . $file
  fi
done

# starting user-supplied icewm autostart programs
for file in ~/.icewm/startup.d/*; do
  # running user files 
  # user can disable autostart removing 'execute' bits
  [ -x $file ] && . $file
done
EOF

echo 'xtoolwait gkrellm'> %buildroot/%icewmconfdir/startup.d/gkrellm
echo 'kdesktop&'> %buildroot/%icewmconfdir/startup.d/kdesktop
echo 'ivman&'> %buildroot/%icewmconfdir/startup.d/ivman
echo 'artsd&'> %buildroot/%icewmconfdir/startup.d/arts

cat <<EOF > %buildroot/%icewmconfdir/startup.d/idesk
#!/bin/sh
if [ -e ~/.ideskrc ]; then 
  idesk &
else # first run
  startidesk &
fi
EOF

cat <<EOF > %buildroot/%icewmconfdir/startup.d/xxkb
#!/bin/sh
# it is not wise to run non-configured xxkb, so we look 
# whether it is configured.
# if [ -e ~/.xxkbrc ] then user has configured xxkb properly
# if [ -e /etc/X11/app-defaults/XXkb ]
# then sysadmin has configured xxkb properly.

if [ -e ~/.xxkbrc ] || [ -e /etc/X11/app-defaults/XXkb ]; then
  xxkb&
fi
EOF

cat <<EOF > %buildroot/%icewmconfdir/startup.d/desklaunch
#!/bin/sh
# it is not wise to run non-configured desklaunch, so we look 
# whether it is configured.
# if [ -e ~/.desklaunchrc ] then user has configured desklaunch properly
if [ -e ~/.desklaunchrc ]; then
  desklaunch&
fi
EOF

cat <<EOF > %buildroot/%icewmconfdir/startup.d/xtdesktop
#!/bin/sh
# it is not wise to run non-configured xtdesktop, so we look 
# whether it is configured.
# if [ -e ~/.xtdeskrc ] then user has configured xtdesktop properly
if [ -e ~/.xtdeskrc ]; then
  xtdesktop&
fi
EOF

cat <<EOF > %buildroot/%icewmconfdir/startup.d/update-menus
#!/bin/sh
# if user has no local menu we will not create it either.
# otherwise it is worth updating it.
if [ -e ~/.icewm/menu ]; then
  update-menus&
fi
EOF

chmod 755 %buildroot/%icewmconfdir/startup.d/*
chmod 755 %buildroot/%icewmconfdir/startup

%files
#%doc README
%dir %icewmconfdir/startup.d
%config %icewmconfdir/startup
#%_man1dir/*

%if_with desklaunch
%files desklaunch
%config %icewmconfdir/startup.d/desklaunch
%endif #desklaunch

%files gkrellm
%config %icewmconfdir/startup.d/gkrellm

%files idesk
%config %icewmconfdir/startup.d/idesk

%files ivman
%config %icewmconfdir/startup.d/ivman

%files kdesktop
%config %icewmconfdir/startup.d/kdesktop

%files update-menus
%config %icewmconfdir/startup.d/update-menus

%if_with xtdesktop
%files xtdesktop
%config %icewmconfdir/startup.d/xtdesktop
%endif #xtdesktop

%files xxkb
%config %icewmconfdir/startup.d/xxkb

%changelog
* Wed Mar 02 2011 Igor Vlasenko <viy@altlinux.ru> 0.11-alt3
- removed artsd support (obsolete)

* Tue Dec 02 2008 Igor Vlasenko <viy@altlinux.ru> 0.11-alt2.1
- disabled unmet subpackages using nmu script

* Fri Sep 21 2007 Igor Vlasenko <viy@altlinux.ru> 0.11-alt2
- fixed requires in update-menus

* Thu Sep 20 2007 Igor Vlasenko <viy@altlinux.ru> 0.11-alt1
- added arts, update-menus
- TODO: README

* Sat Sep 08 2007 Igor Vlasenko <viy@altlinux.ru> 0.1-alt1
- added ivman, desklaunch and xtdesktop support

* Mon Apr 17 2006 Igor Vlasenko <viy@altlinux.ru> 0.0-alt2
- added kdesktop support

* Wed Mar 22 2006 Igor Vlasenko <viy@altlinux.ru> 0.0-alt1
- build for Sisyphus

* Wed Mar 22 2006 Igor Vlasenko <viy@altlinux.ru> 0.0-alt0.M30.1
- backport for M30

* Wed Mar 22 2006 Igor Vlasenko <viy@altlinux.ru> 0.0-alt0
- initial build