# vim: set ts=4 sw=4 et: 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: 1.2.1
Release: 1%{?dist}
License: LGPLv2+
Summary: Utilities for lightweight communications and marshaling
URL: https://lcm-proj.github.io/
Group: Applications/Engineering
Source: https://github.com/lcm-proj/lcm/releases/download/v%{version}/%{name}-%{version}.zip
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
# parallel make causes jar extraction to fail
# (not reported upstream yet)
Patch1: lcm-jar-xf-noparallel.patch
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
%patch1 -p1
%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} -Xdoclint:none -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 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
%{_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
* Fri Jun 19 2015 Dan Callaghan <dcallagh@redhat.com> - 1.2.1-1
- new upstream release 1.2.1
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Tue Nov 12 2013 Dan Callaghan <dcallagh@redhat.com> - 0.9.2-4
- BZ#1022129, remove versioned .jar symlink as per new Java packaging guidelines
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Wed Dec 19 2012 Nelson Marques <nmarques@fedoraproject.org> - 0.9.2-1
- Update to 0.9.2
- Upstream doesn't create the .jar versioned link, we do it on install
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* 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