%define realname nanomsg %global betatag beta # Currently fails checks: https://github.com/nanomsg/nanomsg/issues/281 %bcond_with check # Don't create static libraries (unless we want to) %bcond_with static Name: libnanomsg Version: 0.4 Release: 0.1.%{betatag}%{?dist} Summary: A fast, scalable, and easy to use socket library Group: System Environment/Libraries License: MIT URL: http://nanomsg.org/ Source0: http://download.nanomsg.org/%{realname}-%{version}-%{betatag}.tar.gz BuildRequires: asciidoc xmlto BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Provides: %{realname}%{?_isa} = %{version}-%{release} %description nanomsg is a socket library that provides several common communication patterns. It aims to make the networking layer fast, scalable, and easy to use. Implemented in C, it works on a wide range of operating systems with no further dependencies. The communication patterns, also called "scalability protocols", are basic blocks for building distributed systems. By combining them you can create a vast array of distributed applications. %if %{with static} %package static Summary: Libraries for static linking of applications which will use nanomsg Group: Development/Libraries Requires: %{name}-devel%{?_isa} = %{version}-%{release} Provides: %{realname}-static%{?_isa} = %{version}-%{release} %description static nanomsg is a socket library that provides several common communication patterns. The nanomsg-static package includes static libraries needed to link and develop applications using this library. Most users will not need to install this package. %endif %package devel Summary: Development files for the nanomsg socket library Group: Development/Libraries Requires: pkgconfig Requires: %{name}%{?_isa} = %{version}-%{release} Provides: %{realname}-devel%{?_isa} = %{version}-%{release} %description devel This package contains files needed to develop applications using nanomsg, a socket library that provides several common communication patterns. %package utils Summary: Command line interfaces for communicating with nanomsg Group: Applications/Internet %description utils Includes nanocat, a simple utility for reading and writing to nanomsg sockets and bindings, which can include local and remote connections. nanocat can change its behavior based on how it is called, and several symlinks are provided. %prep %setup -q -n %{realname}-%{version}-%{betatag} %build %if %{with static} %configure --enable-doc --enable-debug --enable-static %else %configure --enable-doc --enable-debug --disable-static %endif # http://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} %install rm -fR %{buildroot} make install DESTDIR="%{buildroot}" # remove libtool archives %{__rm} %{buildroot}%{_libdir}/libnanomsg.la # move docs back to buiiddir so they can be re-added via macro %{__mv} %{buildroot}%{_defaultdocdir} _docdir_temp # a bunch of symlinks are created to nanocat -- symlink their man pages too pushd %{buildroot}%{_bindir} BINARIES=`ls -1 nn_*` popd pushd %{buildroot}%{_mandir}/man1/ for THISBINARY in $BINARIES; do %{__ln_s} nanocat.1 ${THISBINARY}.1 done popd # conditional: currently failing tests: https://github.com/nanomsg/nanomsg/issues/281 %if %{with check} %check make check DESTDIR="%{buildroot}" %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %clean rm -fR %{buildroot} %files %defattr(-,root,root) %doc AUTHORS ChangeLog COPYING README %doc doc/*.css doc/*.7.html %{_mandir}/man7/* %{_libdir}/*.so.* %if %{with static} %files static %defattr(-,root,root) %doc COPYING README %{_libdir}/libnanomsg.a* %endif %files devel %defattr(-,root,root) %doc AUTHORS ChangeLog COPYING README %doc doc/*.css doc/*.3.html %{_mandir}/man3/* %{_includedir}/* %{_libdir}/*.so %{_libdir}/pkgconfig/libnanomsg.pc %files utils %defattr(-,root,root) %doc doc/*.css doc/*.1.html %doc AUTHORS ChangeLog COPYING README %{_mandir}/man1/* %{_bindir}/* %changelog * Thu Jul 17 2014 Japheth Cleaver 0.4-0.1.beta - new "libnanomsg" package based on BZ#1012392, with current versioning - devel and utils subpackages created, static lib a build conditional - check section added as a build conditional - ensure man pages for nanocat symlinks present - disable RPATH in library - License set to MIT