Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > bbd3e8e2100890904741ebd69eab646a > files > 12

gpm-1.20.5-1mdv2009.0.src.rpm

# Allow first build without ncurses support
%define build_curses %{?_without_curses:0}%{!?_without_curses:1}

# this defines the library version that this package builds.
%define LIBMAJ 2
%define LIBVER %{LIBMAJ}.1.0
%define libname %mklibname %{name} %LIBMAJ
%define develname %mklibname %{name} -d

Summary:	A mouse server for the Linux console
Name:		gpm
Version:	1.20.5
Release:	%mkrel 1
License:	GPLv2+
Group:		System/Servers
URL:		ftp://arcana.linux.it/pub/gpm/
Source0:	http://ftp.linux.it/pub/People/rubini/gpm/%{name}-%{version}.tar.lzma
Source1:	gpm.init
Source2:	inputattach.c
# fedora patches (gpm-1.20.1-89.fc8.src.rpm)
Patch1: gpm-1.20.5-multilib.patch
Patch2: gpm-1.20.1-lib-silent.patch
Patch3: gpm-1.20.3-gcc4.3.patch
Patch4: gpm-1.20.3-close-fds.patch
Patch5: gpm-1.20.1-doc.patch
Patch6: gpm-1.20.5-weak-wgetch.patch
# mdv patches
Patch50:	gpm-1.20.5-nodebug.patch
Patch51:	gpm-1.20.0-docfix.patch
Patch52:	gpm-1.20.5-do_not_build_it_twice.diff
Requires(post): chkconfig, info-install, rpm-helper
Requires(preun): chkconfig, info-install, rpm-helper
BuildRequires:	byacc
%if %{build_curses}
BuildRequires:	ncurses-devel
%endif
#BuildRequires:	texinfo autoconf2.1
BuildRequires:	autoconf
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
Gpm provides mouse support to text-based Linux applications like the
emacs editor, the Midnight Commander file management system, and other
programs.  Gpm also provides console cut-and-paste operations using
the mouse and includes a program to allow pop-up menus to appear at
the click of a mouse button.

Gpm should be installed if you intend to use a mouse with your
MandrivaLinux system.

%package -n	%{libname}
Summary:	Libraries and header files for developing mouse driven programs
Group:		System/Libraries

%description -n	%{libname}
Library used by the gpm program.

Install %{libname}dev if you need to develop text-mode programs which will use
the mouse.  You'll also need to install the gpm package.

%package -n	%{develname}
Summary:	Libraries and header files for developing mouse driven programs
Group:		Development/C
Requires:	%{libname} = %{version}
Provides:	gpm-devel libgpm-devel
Obsoletes:	gpm-devel
Provides:	%{mklibname %{name} 1 -d} = %{version}
Obsoletes:	%{mklibname %{name} 1 -d}

%description -n	%{develname}
The %{develname} package contains the libraries and header files needed
for development of mouse driven programs.  This package allows you to
develop text-mode programs which use the mouse.

Install %{develname} if you need to develop text-mode programs which will use
the mouse.  You'll also need to install the gpm package.

%prep

%setup -q

for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do
    if [ -e "$i" ]; then rm -rf $i; fi >&/dev/null
done
    
# fedora patches
%patch1 -p1 -b .multilib
%patch2 -p1 -b .lib-silent
%patch3 -p1 -b .gcc4.3
%patch4 -p1 -b .close-fds
#%patch5 -p1 -b .doc
%patch6 -p1 -b .weak-wgetch

# mdv patches
%patch50 -p1 -b .nodebug
%patch51 -p1 -b .docfix
%patch52 -p1 -b .do_not_build_it_twice

# file is missing, copy in from the rpm package
cp -p %{_prefix}/lib/rpm/mkinstalldirs .

cp %{SOURCE1} gpm.init
cp %{SOURCE2} inputattach.c

%build
%serverbuild

CFLAGS="$CFLAGS -D_GNU_SOURCE -DPIC -fPIC" \
%configure2_5x %{?_without_curses}
make

gcc $CFLAGS -o inputattach inputattach.c

%install
rm -rf %{buildroot}

install -d %{buildroot}%{_sysconfdir}
install -d %{buildroot}%{_initrddir}  
install -d %{buildroot}/%{_lib}
install -d %{buildroot}%{_datadir}/emacs/site-lisp

PATH=/sbin:$PATH:%{_sbindir}:$PATH

%makeinstall

install -m0644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1
install -m0644 conf/gpm-root.conf %{buildroot}%{_sysconfdir}
#install -m0755 src/hltest %{buildroot}%{_bindir}
install -m0755 inputattach %{buildroot}/%{_sbindir}

ln -sf /%{_lib}/libgpm.so.%{LIBVER} %{buildroot}%{_libdir}/libgpm.so
ln -sf libgpm.so.%{LIBVER} %{buildroot}/%{_lib}/libgpm.so.%{LIBMAJ}
mv %{buildroot}%{_libdir}/libgpm.so.* %{buildroot}/%{_lib}

install -m0755 gpm.init %{buildroot}%{_initrddir}/gpm

perl -pi -e "s|/etc/rc.d/init.d|%{_initrddir}|" %{buildroot}%{_initrddir}/*

# cleanup
rm -rf %{buildroot}%{_datadir}/emacs/site-lisp

%post
%_post_service gpm
if [ -x "/sbin/install-info" ]; then
%_install_info %{name}.info
fi

# handle init sequence change
if [ -f /etc/rc5.d/S85gpm ]; then
	/sbin/chkconfig --add gpm
fi

%preun
%_preun_service gpm
%_remove_install_info %{name}.info

%if %mdkversion < 200900
%post -n %{libname} -p /sbin/ldconfig
%endif

%if %mdkversion < 200900
%postun -n %{libname} -p /sbin/ldconfig
%endif

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/gpm-root.conf
%{_initrddir}/gpm
%{_bindir}/display-buttons
%{_bindir}/display-coords
%{_bindir}/mev
%{_bindir}/gpm-root
%{_bindir}/hltest
%{_bindir}/mouse-test
%{_bindir}/disable-paste
%{_bindir}/get-versions
%{_sbindir}/gpm
%{_sbindir}/inputattach
%{_infodir}/gpm.info*
%{_mandir}/man1/mev.1*
%{_mandir}/man1/mouse-test.1*
%{_mandir}/man1/gpm-root.1*
%{_mandir}/man7/gpm-types.7*
%{_mandir}/man8/gpm.8*

%files -n %{libname}
%defattr(-,root,root)
%attr(0755,root,root) /%{_lib}/libgpm.so.%{LIBMAJ}*

%files -n %{develname}
%defattr(-,root,root)
%{_libdir}/libgpm.a
%{_includedir}/gpm.h
%{_libdir}/libgpm.so


%changelog
* Sat Jul 12 2008 Funda Wang <fundawang@mandriva.org> 1.20.5-1mdv2009.0
+ Revision: 234041
- autoconf is not required here
- New version 1.20.5
- rediff patches

  + Pixel <pixel@mandriva.com>
    - do not call ldconfig in %%post/%%postun, it is now handled by filetriggers

* Fri May 30 2008 Funda Wang <fundawang@mandriva.org> 1.20.4-1mdv2009.0
+ Revision: 213294
- update LIBVER
- New major (1->2)
- New version 1.20.4
- sync with fedora patches

* Tue May 20 2008 Oden Eriksson <oeriksson@mandriva.com> 1.20.1-22mdv2009.0
+ Revision: 209468
- bump release
- added P52 to fix the build
- rebuilt with gcc43

* Tue Mar 04 2008 Oden Eriksson <oeriksson@mandriva.com> 1.20.1-20mdv2008.1
+ Revision: 178714
- rebuild

  + Thierry Vignaud <tvignaud@mandriva.com>
    - rebuild
    - kill re-definition of %%buildroot on Pixel's request

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

* Wed Aug 29 2007 Oden Eriksson <oeriksson@mandriva.com> 1.20.1-18mdv2008.0
+ Revision: 74756
- sync with gpm-1.20.1-89.fc8.src.rpm (phew!), only 2 of our
  old patches applies, the rest is fixed by other means...
- bump release

  + Thierry Vignaud <tvignaud@mandriva.com>
    - kill file require on chkconfig
    - kill file require on info-install


* Tue Oct 31 2006 Oden Eriksson <oeriksson@mandriva.com> 1.20.1-15mdv2007.0
+ Revision: 74550
- bunzip patches and the init script
- Import gpm

* Mon Jan 09 2006 Olivier Blin <oblin@mandriva.com> 1.20.1-14mdk
- convert parallel init to LSB

* Mon Jan 02 2006 Olivier Blin <oblin@mandriva.com> 1.20.1-13mdk
- parallel init support
- remove requires on release

* Fri Oct 21 2005 Olivier Thauvin <nanardon@mandriva.org> 1.20.1-12mdk
- rebuild
- fix prereq

* Wed Jun 09 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 1.20.1-11mdk
- fix buildrequires

* Wed Mar 17 2004 Frederic Lepied <flepied@mandrakesoft.com> 1.20.1-10mdk
- put lib in /%%{_lib} (bug #7182)