# !!!!!!!! WARNING THIS HAS TO BE EDITED IN THE SVN !!!!!!!!!!! # lmenut 2012/01/03 # WIP - try to use numlockx instead of enable_X11_numlock # in order to fix mga #1136 # if it works fine, I will update svn.mageia.org/soft/numlock # %define subrel 1 %define use_numlockx 1 %{?_use_numlockx: %{expand: %%global use_numlockx 1}} Summary: Numlock key locker Name: numlock Version: 2.1.2 Release: %mkrel 15 License: GPL Url: http://svnweb.mageia.org/soft/numlock/ Group: System/Boot and Init Source0: %{name}-%{version}.tar.bz2 Patch0: %{name}_level7.patch Patch1: %{name}-xinit-sourced.patch %if %{use_numlockx} Source1: http://home.kde.org/~seli/numlockx/numlockx-1.2.tar.gz BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(xt) %endif # end use_numlockx BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xtst) # do not require X11 libs autoReq: no Requires(post): rpm-helper Requires(preun): rpm-helper Obsoletes: NumLock Provides: NumLock = %{version}-%{release} %description NumLock enable to lock the numlock key. Only enable it at boot-time with ntsysv or with any other SVSR like rc.d config scripts editor such as tksysv or the ones from GNOME and KDE. NumLock is safe for laptops since it is disabled by default. %prep %setup -q %if %{use_numlockx} %setup -T -D -a 1 %patch0 -p1 %patch1 -p1 %endif # end use_numlockx %build make CFLAGS="$RPM_OPT_FLAGS" %if %{use_numlockx} pushd numlockx-1.2 %configure %make popd sed -i -e "s#enable_X11_numlock#numlockx#" numlock.xinit %endif # end use_numlockx %install make install TOP=%{buildroot} INITRDDIR=%{_initrddir} %if %{use_numlockx} pushd numlockx-1.2 %make_install popd rm -f %buildroot%{_bindir}/enable_X11_numlock rm -rf %buildroot%{_mandir}/* %endif # end use_numlockx %post %_post_service numlock %preun %_preun_service numlock %triggerpostun -- numlock < 2.1.2-2mdv if [ -L "/etc/rc.d/rc5.d/*numlock" ]; then /sbin/chkconfig --level 7 numlock reset fi %files %config(noreplace) %{_initrddir}/%{name} %config(noreplace) /etc/profile.d/%{name}.sh %config(noreplace) /etc/X11/xinit.d/numlock %{_bindir}/* %if !%{use_numlockx} %{_mandir}/man1/* %lang(cs) %{_mandir}/cs/man1/* %lang(et) %{_mandir}/et/man1/* %lang(eu) %{_mandir}/eu/man1/* %lang(fi) %{_mandir}/fi/man1/* %lang(fr) %{_mandir}/fr/man1/* %lang(it) %{_mandir}/it/man1/* %lang(nl) %{_mandir}/nl/man1/* %lang(ru) %{_mandir}/ru/man1/* %lang(uk) %{_mandir}/uk/man1/* %endif # end use_numlockx