Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > c6c403e2788ca9ab6041d30aa0c443df > files > 2

numlock-2.1.2-8.mga3.src.rpm

# !!!!!!!! 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 use_numlockx 1
%{?_use_numlockx: %{expand: %%global use_numlockx 1}}

%define name numlock
%define version 2.1.2
%define release %mkrel 8

Summary: Numlock key locker
Name: %{name}
Version: %{version}
Release: %{release}
License: GPL
Url:   http://svnweb.mageia.org/soft/numlock/
Group: System/Boot and Init
Source0: %{name}-%{version}.tar.bz2
%if %{use_numlockx}
Source1: http://home.kde.org/~seli/numlockx/numlockx-1.2.tar.gz
BuildRequires: libxext-devel
BuildRequires: libxt-devel
%endif # end use_numlockx
BuildRequires: libx11-devel
BuildRequires: libxtst-devel
# 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
%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
%makeinstall_std
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


%changelog

* Wed Jan 23 2013 fwang <fwang> 2.1.2-8.mga3
+ Revision: 391174
- update rpm group

* Sat Jan 12 2013 umeabot <umeabot> 2.1.2-7.mga3
+ Revision: 361080
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Tue Jan 03 2012 lmenut <lmenut> 2.1.2-6.mga2
+ Revision: 189843
- update URL
- replace enable_X11_numlock by numlockx
  (try to fix numlock under X - mga #1136)

* Fri Feb 04 2011 dmorgan <dmorgan> 2.1.2-5.mga1
+ Revision: 46827
- imported package numlock