File rabbitmq-c.spec of Package rabbitmq-c

Name: rabbitmq-c
%define lname librabbitmq
Summary: RabbitMQ C AMQP client library
Version: 0.8.0
Release: 2
License: MIT
Group: System Environment/Libraries
URL: https://github.com/alanxz/%name
Source: %name-%version.tar.xz
BuildRequires: cmake > 2.8
BuildRequires: openssl-devel
# For tools
BuildRequires: popt-devel
# For man page
BuildRequires: xmlto

%description
This is a C-language AMQP client library for use with AMQP servers speaking
protocol versions 0-9-1.


%package doc
Summary: Documentation of RabbitMQ C AMQP client library
Group: Documentation
Provides: %lname-doc = %version-%release

%description doc
This package contains documentation and examples of RabbitMQ C AMQP client
library.


%package -n %lname
Summary: RabbitMQ C AMQP client library
Group: System Environment/Libraries

%description -n %lname
This is a C-language AMQP client library for use with AMQP servers speaking
protocol versions 0-9-1.


%package -n %lname-devel
Summary: Header files and development libraries for %lname
Group: Development/Libraries/C and C++
Provides: %name-%devel = %version-%release
Requires: %lname = %version-%release

%description -n %lname-devel
This package contains the header files and development libraries for %lname.


%package -n %lname-devel-static
Summary: Static %lname
Group: Development/Libraries/C and C++
Requires: %lname-devel = %version-%release

%description -n %lname-devel-static
This package contains static %lname.


%package tools
Summary: Example tools built using the %lname
Group: Development/Libraries
Provides: %lname-tools = %version-%release
Requires: %lname = %version-%release

%description tools
This package contains example tools built using %lname.
It provides:
  - amqp-consume: consume messages from a queue on an AMQP server
  - amqp-declare-queue: declare a queue on an AMQP server
  - amqp-delete-queue: delete a queue from an AMQP server
  - amqp-get: get a message from a queue on an AMQP server
  - amqp-publish: publish a message on an AMQP server


%prep
%setup -q


%build
%cmake -DBUILD_TOOLS_DOCS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=ON
make %{?_smp_mflags} VERBOSE=1


%install
%cmake_install DESTDIR=%buildroot
install -d -m 0755 %buildroot%_docdir/%name
install -p -m 0644 AUTHORS THANKS TODO *.md %buildroot%_docdir/%name/
cp -r examples %buildroot%_docdir/%name/


%check
# check .pc is usable
grep -qv @ %buildroot%_libdir/pkgconfig/librabbitmq.pc
# upstream tests
make %{?__builddir:-C %__builddir} test


%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig


%files -n %lname
%defattr(-,root,root)
%_libdir/*.so.*


%files -n %lname-devel
%defattr(-,root,root)
%_libdir/*.so
%_includedir/*
%_pkgconfigdir/*


%files -n %lname-devel-static
%defattr(-,root,root)
%_libdir/*.a


%files tools
%defattr(-,root,root)
%_bindir/*
%_mandir/man1/*
%_mandir/man7/*


%files doc
%defattr(-,root,root)
%_docdir/%name


%changelog
* Thu Dec 28 2017 Led <ledest@gmail.com> 0.8.0-1
- initial build
openSUSE Build Service is sponsored by