File libmodbus.spec of Package libmodbus

# vim: set sw=4 ts=4 et nu:
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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/

%if 0%{?suse_version} >= 1100
%define with_doc 1
%else
%define with_doc 0
%endif

Name:           libmodbus
Version:        3.0.3
%define soname 5
Release:        0
Summary:        Library to send/receive data according to the Modbus protocol
Source:         http://github.com/downloads/stephane/libmodbus/libmodbus-%{version}.tar.gz
URL:            http://libmodbus.org
Group:          System/Libraries
License:        LGPL-3.0
BuildRoot:      %{_tmppath}/build-%{name}-%{version}
%if %with_doc
BuildRequires:  asciidoc xmlto
%endif
BuildRequires:  gcc-c++ make glibc-devel pkgconfig
BuildRequires:  autoconf automake libtool

%description
libmodbus is a free software library to send/receive data according to the
Modbus protocol. This library is written in C and supports RTU (serial) and TCP
(Ethernet) communications.

%package -n %{name}%{soname}
Summary:        Library to send/receive data according to the Modbus protocol
Group:          System/Libraries

%description -n %{name}%{soname}
libmodbus is a free software library to send/receive data according to the
Modbus protocol. This library is written in C and supports RTU (serial) and TCP
(Ethernet) communications.

%package devel
Summary:        Library to send/receive data according to the Modbus protocol
Group:          Development/Libraries/C and C++
Requires:       %{name}%{soname} = %{version}

%description devel
libmodbus is a free software library to send/receive data according to the
Modbus protocol. This library is written in C and supports RTU (serial) and TCP
(Ethernet) communications.

%prep
%setup -q

%build
%configure
%__make %{?_smp_flags}

%install
%makeinstall

%__rm "%{buildroot}%{_libdir}"/*.la

%post   -n %{name}%{soname} -p /sbin/ldconfig
%postun -n %{name}%{soname} -p /sbin/ldconfig

%files -n %{name}%{soname}
%defattr(-,root,root)
%{_libdir}/libmodbus.so.%{soname}
%{_libdir}/libmodbus.so.%{soname}.*

%files devel
%defattr(-,root,root)
%{_includedir}/modbus
%{_libdir}/libmodbus.so
%{_libdir}/pkgconfig/libmodbus.pc
%if %with_doc
%doc %{_mandir}/man3/modbus*.3%{ext_man}
%doc %{_mandir}/man7/libmodbus.7%{ext_man}
%endif

%changelog
openSUSE Build Service is sponsored by