%global betatag beta # Currently fails checks: https://github.com/nanomsg/nanomsg/issues/281 %bcond_without check # Don't create static libraries (unless we want to) %bcond_with static Name: nanomsg Version: 0.7 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: https://github.com/nanomsg/nanomsg/releases/download/%{version}-%{betatag}/%{name}-%{version}-%{betatag}.tar.gz BuildRequires: asciidoc xmlto BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %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} %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: %{name}%{?_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. %package doc Summary: HTML Documentation for nanomsg Group: Documentation %description doc Contains HTML versions of the documentation for development of nanomsg- related software. %prep %setup -q -n %{name}-%{version}-%{betatag} %build %configure --enable-doc --disable-silent-rules %{?_with_static:--enable-static}%{!?_with_static:--disable-static} STRIP=/bin/true # 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} V=1 %install rm -fR %{buildroot} make install DESTDIR="%{buildroot}" # remove libtool archives rm -f %{buildroot}%{_libdir}/*.la # remove docs (they'll be re-added via macro later on) rm -fR %{buildroot}%{_defaultdocdir} # 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 %check # conditional: currently failing tests: https://github.com/nanomsg/nanomsg/issues/281 %if %{with check} make check LD_LIBRARY_PATH="%{buildroot}%{_libdir}" DESTDIR="%{buildroot}" %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %clean rm -fR %{buildroot} %files %defattr(-,root,root) %doc ChangeLog COPYING README %{_libdir}/*.so.* %if %{with static} %files static %defattr(-,root,root) %{_libdir}/*.a* %endif %files devel %defattr(-,root,root) %{_mandir}/man7/* %{_mandir}/man3/* %{_includedir}/* %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %files utils %defattr(-,root,root) %{_mandir}/man1/* %{_bindir}/* %files doc %defattr(-,root,root) %doc AUTHORS ChangeLog COPYING README %doc doc/*.css doc/*.html %changelog * Tue Oct 27 2015 Japheth Cleaver 0.7-0.1.beta - update to 0.7-beta release * Fri Nov 14 2014 Japheth Cleaver 0.5-0.1.beta - update to 0.5-beta release * Sun Jul 27 2014 Japheth Cleaver 0.4-0.3.beta - compile with correct Fedora flags - move documentation back to base package - spec file cleanups * Thu Jul 17 2014 Japheth Cleaver 0.4-0.2.beta - drop the 'lib' prefix from package name - remove explicit pkgconfig requires in nanomsg-devel - move overview man pages to devel subpackage - move html to doc subpackage * 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