# Conditional for release and snapshot builds. Uncomment for release-builds. #global rel_build 1 # Settings used for build from git-snapshots. %if 0%{?rel_build} %global gittar %{name}-%{version}.tar.gz %else # 0%%{?rel_build} %global commit 589c448aa93f27e28533d5474e07272efcf889e7 %global commit_date 20160304 %global shortcommit %(c=%{commit};echo ${c:0:7}) %global gitver git%{commit_date}-%{shortcommit} %global gitrel .git%{commit_date}.%{shortcommit} %global gittar %{name}-%{version}-%{gitver}.tar.gz %endif # 0%%{?rel_build} # Setup _pkgdocdir if not defined already. %{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} # CMake-builds go out-of-tree. %global cmake_builddir build-%{?__isa}%{?dist} # Fix 'W: unused-direct-shlib-dependency'. %global __global_ldflags %(echo '%{?__global_ldflags} -Wl,--as-needed' | %{__sed} -e 's!^[ \t]\+!!g' -e 's![ \t]\+$!!g') Name: dynaplugz Version: 0.0.0.0 Release: 0.1%{?gitrel}%{?dist} Summary: Dynamic plugin-loading like a boss License: BSD URL: https://github.com/shogun-toolbox/%{name} %if 0%{?rel_build} Source0: %{url}/archive/v%{version}.tar.gz#/%{gittar} %else # 0%%{?rel_build} Source0: %{url}/archive/%{commit}.tar.gz#/%{gittar} %endif # 0%%{?rel_build} BuildRequires: cmake >= 3.1 BuildRequires: gcc-c++ >= 4.4 BuildRequires: hardlink BuildRequires: perl BuildRequires: valgrind %description Dynamic plugin-loading like a boss. %package devel Summary: Development-files for %{name} Requires: %{name}%{?_isa} == %{version}-%{release} %description devel This package contains files to develop applications using %{name}. %package doc Summary: Documentation-files for %{name} BuildArch: noarch BuildRequires: doxygen BuildRequires: graphviz %description doc This package contains documentation-files for %{name}. %prep %setup -q%{?commit:n %{name}-%{commit}} %{__mkdir} -p %{cmake_builddir} %build pushd %{cmake_builddir} %{cmake} \ -DCMAKE_BUILD_TYPE=RELEASE \ -DPROJECT_VERSION_GIT='%{?gitrel}' \ .. %{_bindir}/doxygen -u doc/Doxyfile %{__make} %{?_smp_mflags} # Build the autodocs. %{__make} doc popd %install pushd %{cmake_builddir} %{__make} install DESTDIR=%{buildroot} # Install the autodocs. %{__mkdir} -p %{buildroot}%{_pkgdocdir} %{__cp} -a doc/html %{buildroot}%{_pkgdocdir} popd # Create symlink to tag-file. /bin/ln -fs %{_datadir}/%{name}/%{name}.tag \ %{buildroot}%{_pkgdocdir}/html # Install other documentation. %{__install} -pm 0644 \ AUTHORS README.md \ %{buildroot}%{_pkgdocdir} # Hardlink duplicate documentation-files. /sbin/hardlink -cv %{buildroot}%{_pkgdocdir} %check pushd %{cmake_builddir} %{__make} memcheck popd %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files # EPEL <= 6 doesn't support %%license. See: # https://fedoraproject.org/wiki/EPEL:Packaging#The_.25license_tag %{!?_licensedir:%global license %doc} %doc %dir %{_pkgdocdir} %doc %{_pkgdocdir}/README.md %license LICENSE.txt %dir %{_libdir}/%{name} %{_libdir}/lib%{name}.so.* %files devel %doc %dir %{_pkgdocdir} %doc %{_pkgdocdir}/AUTHORS #doc %%{_pkgdocdir}/ChangeLog #doc %%{_pkgdocdir}/NEWS %{_datadir}/%{name} %{_includedir}/%{name}-%{version}%{?gitrel} %{_libdir}/cmake %{_libdir}/lib%{name}.so %{_libdir}/pkgconfig/%{name}.pc %files doc # EPEL <= 6 doesn't support %%license. See: # https://fedoraproject.org/wiki/EPEL:Packaging#The_.25license_tag %{?_licensedir:%license %{_datadir}/licenses/%{name}} %doc %{_pkgdocdir} %dir %{_datadir}/%{name} %{_datadir}/%{name}/%{name}.tag %changelog * Fri Mar 04 2016 Björn Esser - 0.0.0.0-0.1.git20160304.589c448 - initial rpm-release (#1314895)