From b834c8270555838cfce17d8ca6c4f781af428ac8 Mon Sep 17 00:00:00 2001 From: Björn Esser Date: Mar 09 2016 11:09:22 +0000 Subject: split things in lib%%{name}-packages add conditionals for EPEL <= 7 --- diff --git a/dynaplugz.spec b/dynaplugz.spec index 6f72f24..2ebd962 100644 --- a/dynaplugz.spec +++ b/dynaplugz.spec @@ -13,8 +13,9 @@ %global gittar %{name}-%{version}-%{gitver}.tar.gz %endif # 0%%{?rel_build} -# Setup _pkgdocdir if not defined already. -%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} +# Setup _pkgdocdir. +%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/lib%{name}-%{version}} +%{?_pkgdocdir:%global _pkgdocdir %{_docdir}/lib%{name}} # CMake-builds go out-of-tree. %global cmake_builddir build-%{?__isa}%{?dist} @@ -22,10 +23,14 @@ # Fix 'W: unused-direct-shlib-dependency'. %global __global_ldflags %(echo '%{?__global_ldflags} -Wl,--as-needed' | %{__sed} -e 's!^[ \t]\+!!g' -e 's![ \t]\+$!!g') +# Common description. +%global common_description \ +Dynamic plugin-loading like a boss. + Name: dynaplugz Version: 0.0.0.0 -Release: 0.1%{?gitrel}%{?dist} +Release: 0.2%{?gitrel}%{?dist} Summary: Dynamic plugin-loading like a boss License: BSD @@ -36,35 +41,63 @@ Source0: %{url}/archive/v%{version}.tar.gz#/%{gittar} Source0: %{url}/archive/%{commit}.tar.gz#/%{gittar} %endif # 0%%{?rel_build} -BuildRequires: cmake >= 3.1 -BuildRequires: gcc-c++ >= 4.4 +%description +%{common_description} + + +%package -n lib%{name} +Summary: Dynamic plugin-loading like a boss + +BuildRequires: cmake >= 3.1 +BuildRequires: gcc-c++ >= 4.4 BuildRequires: hardlink -BuildRequires: perl BuildRequires: valgrind -%description -Dynamic plugin-loading like a boss. +Provides: %{name} == %{version}-%{release} +Provides: %{name}%{?_isa} == %{version}-%{release} + +%if 0%{?fedora} && 0%{?fedora} <= 25 +Obsoletes: %{name} <= 0.0.0.0-0.2 +%endif # 0%%{?fedora} && 0%%{?fedora} <= 25 + +%description -n lib%{name} +%{common_description} -%package devel +%package -n lib%{name}-devel Summary: Development-files for %{name} -Requires: %{name}%{?_isa} == %{version}-%{release} +Requires: lib%{name}%{?_isa} == %{version}-%{release} + +Provides: %{name}-devel == %{version}-%{release} +Provides: %{name}-devel%{?_isa} == %{version}-%{release} + +%if 0%{?fedora} && 0%{?fedora} <= 25 +Obsoletes: %{name}-devel <= 0.0.0.0-0.2 +%endif # 0%%{?fedora} && 0%%{?fedora} <= 25 -%description devel +%description -n lib%{name}-devel This package contains files to develop applications -using %{name}. +using lib%{name}. -%package doc -Summary: Documentation-files for %{name} +%package -n lib%{name}-doc +Summary: Documentation-files for lib%{name} BuildArch: noarch BuildRequires: doxygen BuildRequires: graphviz +BuildRequires: perl + +Provides: %{name}-doc == %{version}-%{release} -%description doc -This package contains documentation-files for %{name}. +%if 0%{?fedora} && 0%{?fedora} <= 25 +Obsoletes: %{name}-doc <= 0.0.0.0-0.2 +%endif # 0%%{?fedora} && 0%%{?fedora} <= 25 + +%description -n lib%{name}-doc +This package contains documentation-files +for lib%{name}. %prep @@ -74,9 +107,14 @@ This package contains documentation-files for %{name}. %build pushd %{cmake_builddir} -%{cmake} \ - -DCMAKE_BUILD_TYPE=RELEASE \ - -DPROJECT_VERSION_GIT='%{?gitrel}' \ +# Build using CMake3 on EPEL6 and EPEL7. +%if 0%{?fedora} || 0%{?rhel} > 7 +%{cmake} \ +%else # 0%%{?fedora} || 0%%{?rhel} > 7 +%{cmake3} \ +%endif # 0%%{?fedora} || 0%%{?rhel} > 7 + -DCMAKE_BUILD_TYPE=RELEASE \ + -DPROJECT_VERSION_GIT='%{?gitrel}' \ .. %{_bindir}/doxygen -u doc/Doxyfile %{__make} %{?_smp_mflags} @@ -96,12 +134,20 @@ pushd %{cmake_builddir} popd # Create symlink to tag-file. -/bin/ln -fs %{_datadir}/%{name}/%{name}.tag \ +/bin/ln -fs %{_datadir}/%{name}/%{name}.tag \ %{buildroot}%{_pkgdocdir}/html # Install other documentation. -%{__install} -pm 0644 \ - AUTHORS README.md \ +for i in ChangeLog NEWS +do + if [ ! -e "$i" ] + then + echo "dummy" > "$i" + fi +done + +%{__install} -pm 0644 \ + ChangeLog NEWS README.md \ %{buildroot}%{_pkgdocdir} # Hardlink duplicate documentation-files. @@ -114,26 +160,22 @@ pushd %{cmake_builddir} popd -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%post -n lib%{name} -p /sbin/ldconfig +%postun -n lib%{name} -p /sbin/ldconfig -%files -# EPEL <= 6 doesn't support %%license. See: -# https://fedoraproject.org/wiki/EPEL:Packaging#The_.25license_tag -%{!?_licensedir:%global license %doc} +%files -n lib%{name} %doc %dir %{_pkgdocdir} %doc %{_pkgdocdir}/README.md -%license LICENSE.txt +%license AUTHORS LICENSE.txt %dir %{_libdir}/%{name} %{_libdir}/lib%{name}.so.* -%files devel +%files -n lib%{name}-devel %doc %dir %{_pkgdocdir} -%doc %{_pkgdocdir}/AUTHORS -#doc %%{_pkgdocdir}/ChangeLog -#doc %%{_pkgdocdir}/NEWS +%doc %{_pkgdocdir}/ChangeLog +%doc %{_pkgdocdir}/NEWS %{_datadir}/%{name} %{_includedir}/%{name}-%{version}%{?gitrel} %{_libdir}/cmake @@ -141,15 +183,18 @@ popd %{_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}} +%files -n lib%{name}-doc +# Pick up previously installed licenses. +%{?_licensedir:%license %{_datadir}/licenses/lib%{name}*} %doc %{_pkgdocdir} %dir %{_datadir}/%{name} %{_datadir}/%{name}/%{name}.tag %changelog +* Wed Mar 09 2016 Björn Esser - 0.0.0.0-0.2.git20160304.589c448 +- split things in lib%%{name}-packages +- add conditionals for EPEL <= 7 + * Fri Mar 04 2016 Björn Esser - 0.0.0.0-0.1.git20160304.589c448 - initial rpm-release (#1314895)