SHA256
1
0
forked from pool/gpm
gpm/gpm.spec

202 lines
5.8 KiB
RPMSpec

#
# spec file for package gpm
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: gpm
BuildRequires: bison lzma ncurses-devel
Url: http://linux.schottelius.org/gpm/
License: GPLv2+
Group: System/Console
Provides: select
PreReq: /bin/sed %insserv_prereq %fillup_prereq
AutoReqProv: on
# bug437293
%ifarch ppc64
Obsoletes: gpm-64bit
%endif
#
Version: 1.20.6
Release: 3
Summary: Console Mouse Support
Source0: gpm-%{version}.tar.lzma
Source1: gpm-%{version}-patches.tar.lzma
Source2: rcgpm
Source3: sysconfig.mouse-%{name}
Source4: README.SuSE
Source5: baselibs.conf
Source6: inputattach.c
Patch0: gpm-DESTDIR.patch
Patch4: gpm-syn_conf.patch
Patch6: gpm-conf.patch
Patch7: gpm-va_arg.patch
Patch9: gpm-no_templates_for_new_multiple_mode.patch
Patch10: gpm-ceil.patch
Patch11: gpm-Gpm_Open.patch
Patch12: gpm-daemon_mode.patch
Patch15: gpm-verbosity.patch
Patch17: gpm-log.patch
Patch18: gpm-glibc210.patch
Patch19: gpm-use_getdtablesize.patch
Patch20: gpm-int_ptr_casts.patch
Patch21: gpm-close-fds.patch
Patch22: gpm-gcc4.3.patch
Patch23: gpm-lib-silent.patch
Patch24: gpm-libtool.patch
Patch25: gpm-multilib.patch
Patch26: gpm-weak-wgetch.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %install_info_prereq
%description
The gpm (general purpose mouse) daemon tries to be a useful mouse
server for applications running on the Linux console. It can be used by
mc (Midnight Commander) or by w3m, the text-based Web browser. It
provides console cut and paste operations.
Authors:
--------
Alessandro Rubini <rubini at ipvvis.unipv.it>
Nico Schottelius <nico at schottelius.org>
%package devel
License: GPLv2+
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Summary: Development files for gpm (Console Mouse Support)
%description devel
Development files for the gpm (general purpose mouse) package.
%prep
%setup -q
%patch0
%patch4
%patch6
%patch7
%patch9
%patch10
%patch11
%patch12
%patch15
%patch17
%patch18
%patch19
%patch20
%patch21
%patch22
%patch23
%patch24
%patch25
%patch26
cp %{S:2} %{S:3} %{S:4} .
%build
# This package failed when testing with -Wl,-as-needed being default.
# So we disable it here, if you want to retest, just delete this comment and the line below.
export SUSE_ASNEEDED=0
autoreconf -fi
CFLAGS="$RPM_OPT_FLAGS -DQUIET_LIBGPM" \
%configure --disable-static \
--sysconfdir=/etc/gpm
make CC="%{__cc}" %{?_smp_mflags}
%__cc %{optflags} -o inputattach %{SOURCE6}
%install
%makeinstall ROOT=""
#
# gpm confings
install -d $RPM_BUILD_ROOT/etc/${file/conf\/gpm-/gpm\/}
for file in conf/gpm-* ; do
install -d $RPM_BUILD_ROOT/etc/${file/conf\/gpm-/gpm\/}
install -m 644 $file $RPM_BUILD_ROOT/etc/${file/conf\/gpm-/gpm\/}
done
#
# lisp
# an updated version is part of emacs now
#install -d $RPM_BUILD_ROOT/usr/share/emacs/site-lisp
#install contrib/emacs/t-mouse.el* $RPM_BUILD_ROOT/usr/share/emacs/site-lisp
#
# start script
install -m 755 -d $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 755 -d $RPM_BUILD_ROOT/etc/init.d
install -m 755 -d $RPM_BUILD_ROOT/usr/sbin
install -m 755 inputattach %{buildroot}%{_sbindir}
install -m 644 sysconfig.mouse-%{name} $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 755 rcgpm $RPM_BUILD_ROOT/etc/init.d/gpm
ln -sf ../../etc/init.d/gpm $RPM_BUILD_ROOT/usr/sbin/rcgpm
# there were two variables with the same value GPM_PROTOCOL and MOUSETYPE
# in SuLi 8.2. The MOUSETYPE variable better conforms with with other
# variable names MOUSEDEVICE and XMOUSETYPE name scheme, so get rid of
# the obsolete GPM_PROTOCOL variable
if grep "^GPM_PROTOCOL=" /etc/sysconfig/mouse 1>/dev/null 2>/dev/null ; then
if grep "^MOUSETYPE=" /etc/sysconfig/mouse 1>/dev/null 2>/dev/null ; then
# comment out the obsolete MOUSETYPE variable
perl -pi -e "s|^(MOUSETYPE=.*)$|\#\$1 \# the variable GPM_PROTOCOL was renamed to MOUSETYPE|" /etc/sysconfig/mouse
fi
# rename GPM_PROTOCOL to MOUSETYPE
perl -pi -e "s|^GPM_PROTOCOL=(.*)$|\# the variable GPM_PROTOCOL was renamed to MOUSETYPE\nMOUSETYPE=\$1|" /etc/sysconfig/mouse
fi
# Do not package static library
rm -fv $RPM_BUILD_ROOT/%{_libdir}/libgpm.a
mkdir -p %{buildroot}%{_localstatedir}/run
touch %{buildroot}%{_localstatedir}/run/gpm.pid
%preun
%stop_on_removal gpm
%post
/sbin/ldconfig
%{fillup_and_insserv gpm}
%{fillup_only -an mouse}
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%postun
/sbin/ldconfig
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%restart_on_update gpm
%{insserv_cleanup}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc BUGS COPYING README README.SuSE TODO doc/changes
%doc doc/Announce doc/FAQ doc/README*
%{_infodir}/*
%{_mandir}/*/*
%dir %config /etc/gpm
%config /etc/gpm/*
%config /etc/init.d/gpm
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/libgpm.so.*
/var/adm/fillup-templates/*
%ghost %{_localstatedir}/run/gpm.pid
%files devel
%defattr(-,root,root)
%{_includedir}/*.h
%{_libdir}/libgpm.so
%changelog