Blob Blame History Raw
# vim: set ts=4 sw=4 et nu: coding=UTF-8

%if 0%{?rhel} < 6
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif


Name:           lcm
Version:        0.9.0
Release:        5%{?dist}
License:        LGPLv2+
Summary:        Utilities for lightweight communications and marshaling
URL:            http://code.google.com/p/lcm/
Group:          Applications/Engineering
Source:         https://lcm.googlecode.com/files/%{name}-%{version}.tar.gz
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
# package fails to build on fedora epel for el5 and el6 due to missing 
# java-devel build dependency; excluding arch
%if 0%{rhel} <= 6
ExcludeArch:    ppc ppc64
%endif

BuildRequires:  chrpath
BuildRequires:  glib2-devel
BuildRequires:  gettext
BuildRequires:  python-devel

%description
LCM is a library for message passing and data marshaling targeted at real time
systems where high-bandwidth and low latency are critical.
It provides a publish/subscribe message passing model and a XDR-style message
specification language with bindings for applications in C, Java and Python.


%package java
Summary:        Lightweight communications and marshaling java artifacts
Group:          System Environment/Libraries
%if 0%{?rhel} >= 6
BuildArch:      noarch
%endif
BuildRequires:  java-devel >= 1:1.6.0
BuildRequires:  jpackage-utils
Requires:       java >= 1:1.6.0
Requires:       jpackage-utils

%description java
LCM is a library for message passing and data marshaling targeted at real time
systems where high-bandwidth and low latency are critical.

This package provides the java stuff...


%package javadoc
Summary:        Lightweight communications and marshaling java artifacts documentation
Group:          Documentation
%if 0%{?rhel} >= 6
BuildArch:      noarch
%endif
Requires:       jpackage-utils

%description javadoc
LCM is a library for message passing and data marshaling targeted at real time
systems where high-bandwidth and low latency are critical.

This package provides the java documentation.


%package python
Summary:        Lightweight communications and marshaling python bindings
Group:          System Environment/Libraries

%description python
LCM is a library for message passing and data marshaling targeted at real time
systems where high-bandwidth and low latency are critical.


%package devel
Summary:        Lightweight communications and marshaling development files
Group:          Development/Libraries
Requires:       %{name}%{?_isa}        = %{version}-%{release}
Requires:       %{name}-python%{?_isa} = %{version}-%{release}
%if 0%{?rhel} < 6
Requires:       pkgconfig
Requires:       %{name}-java%{?_isa}   = %{version}-%{release}
%else
Requires:       %{name}-java           = %{version}-%{release}
%endif

%description devel
LCM is a library for message passing and data marshaling targeted at real time
systems where high-bandwidth and low latency are critical.

This package provides the development files for the various lcm packages.


%prep
%setup -q


%build
%configure                  \
   --disable-static         \
   --disable-rpath          \
   --without-examples       \
   --with-jardir=%{_datadir}/java
make V=1 %{?_smp_mflags}


%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install

%{javadoc} -d %{buildroot}/%{_javadocdir}/%{name} -sourcepath lcm-java \
    lcm.lcm lcm.logging lcm.spy lcm.util

# wipe libtool archives and RPATH from binaries
find %{buildroot}%{_libdir} -type f -name "*.la" -delete -print
find %{buildroot}%{_bindir} -type f -name "lcm-logplayer" -print -exec chrpath --delete {} \;
find %{buildroot}%{_bindir} -type f -name "lcm-logger" -print -exec chrpath --delete {} \;
find %{buildroot}%{python_sitearch} -type f -name "_lcm.so" -print -exec chrpath --delete {} \;


%clean
rm -rf %{buildroot}

%check
make check V=1


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog NEWS
%{_bindir}/lcm-gen
%{_bindir}/lcm-logger
%{_bindir}/lcm-logplayer
%{_mandir}/man1/*.1.gz
%{_libdir}/liblcm.so.*
# man pages which go on java sub-package
%exclude %{_mandir}/man1/lcm-logplayer-gui.1.gz
%exclude %{_mandir}/man1/lcm-spy.1.gz


%files java
%defattr(-,root,root,-)
%doc AUTHORS COPYING
%{_bindir}/lcm-logplayer-gui
%{_bindir}/lcm-spy
%{_datadir}/java/lcm.jar
%{_datadir}/java/lcm-%{version}.jar
%{_mandir}/man1/lcm-logplayer-gui.1.gz
%{_mandir}/man1/lcm-spy.1.gz


%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/%{name}/


%files python
%defattr(-,root,root,-)
%{python_sitearch}/lcm/


%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}/
%{_libdir}/liblcm.so
%{_libdir}/pkgconfig/lcm.pc
%{_libdir}/pkgconfig/lcm-java.pc
%{_datadir}/aclocal/lcm.m4


%changelog
* Wed Jul 11 2012 Nelson Marques <nmo.marques@gmail.com> - 0.9.0-5
- Add "ExcludeArch: ppc ppc64" for el5 and el6, no java dependencies
- Update release to match the changelog

* Fri Jul 06 2012 Nelson Marques <nelson-m-marques@ext.ptinovacao.pt> - 0.9.0-1
- Update to version 0.9.0
- BZ#767649, moved java man pages to java sub-package

* Thu Jul 05 2012 Nelson Marques <nelson-m-marques@ext.ptinovacao.pt> - 0.7.1-3
- BZ#767649, updated buildroot and other improvements

* Tue Jul 03 2012 Nelson Marques <nelson-m-marques@ext.ptinovacao.pt> - 0.7.1-2
- BZ#767649, introduced recommended changes

* Mon Jul 02 2012 Nelson Marques <nelson-m-marques@ext.ptinovacao.pt> - 0.7.1-1
- BZ#767649, initial package from upstream release 0.7.1