From 8a55ee20388e1206f5326799a64d7eda42b49a17 Mon Sep 17 00:00:00 2001 From: Lukas Zaoral Date: Wed, 19 Aug 2020 11:41:10 +0200 Subject: [PATCH] dg.spec.rpkg: Reflect changes in Fedora's CMake macros * Add docs to the package * Do not set CMake buildtype as rpmbuild sets the default set of buildflags * Fix some rpmlint errors and warnings * Fix compatibility with openSUSE and Mageia Closes: #327 --- dg.spec.rpkg | 72 ++++++++++++++++++---------------------------------- 1 file changed, 25 insertions(+), 47 deletions(-) diff --git a/dg.spec.rpkg b/dg.spec.rpkg index f9a39559f..85ad32c1f 100644 --- a/dg.spec.rpkg +++ b/dg.spec.rpkg @@ -1,9 +1,12 @@ # vim: syntax=spec +# Do out-of-source build by default on Fedora +%undefine __cmake_in_source_build + Name: {{{ git_dir_name }}} Version: {{{ git_dir_version }}} Release: 1%{?dist} -Summary: Various program analyses, construction of dependence graphs and program slicing of LLVM bitcode +Summary: Analyses, construction of dependence graphs and slicing of LLVM bitcode License: MIT URL: https://github.com/mchalupa/dg @@ -14,74 +17,49 @@ Source: {{{ git_dir_archive }}} BuildRequires: clang BuildRequires: cmake BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: llvm-devel +BuildRequires: make BuildRequires: ncurses-devel BuildRequires: python3 BuildRequires: zlib-devel -# FIXME: dg should support dynamic linking with LLVM -BuildRequires: llvm-static - Requires: clang Requires: llvm %description -DG is a library containing various bits for program analysis. However, the main -motivation of this library is program slicing. The library contains implementation -of a pointer analysis, data dependence analysis, control dependence analysis, -and an analysis of relations between values in LLVM bitcode. All of the analyses -target LLVM bitcode, but most of them are written in a generic way, so they are -not dependent on LLVM in particular. +DG is a library containing various bits for program analysis. However, the +main motivation of this library is program slicing. The library contains +implementation of a pointer analysis, data dependence analysis, control +dependence analysis, and an analysis of relations between values in LLVM +bitcode. All of the analyses target LLVM bitcode, but most of them are written +in a generic way, so they are not dependent on LLVM in particular. %prep {{{ git_dir_setup_macro }}} -GIT_REVISION={{{ git rev-parse --short --sq HEAD }}} -sed -i "s/unknown/$GIT_REVISION/" tools/git-version.sh %build -%if 0%{?fedora} || 0%{?rhel} || 0%{?centos} - %cmake . -DCMAKE_BUILD_TYPE=Release - %make_build -%endif - -%if 0%{?mageia} == 7 - %cmake -DCMAKE_BUILD_TYPE=Release - %make_build -%endif - -%if 0%{?mageia} > 7 || 0%{?sle_version} || 0%{?suse_version} - %cmake -DCMAKE_BUILD_TYPE=Release - %cmake_build -%endif +GIT_VERSION={{{ git rev-parse --short --sq HEAD }}} +%cmake -DGIT_VERSION="$GIT_VERSION" +%cmake_build %install -%if 0%{?fedora} || 0%{?rhel} || 0%{?centos} - %make_install -%endif - -%if 0%{?mageia} == 7 - cd %{_cmake_builddir} - %make_install -%endif - -%if 0%{?mageia} > 7 || 0%{?sle_version} || 0%{?suse_version} - %cmake_install -%endif +%cmake_install %check - -%if 0%{?mageia} == 7 - cd %{_cmake_builddir} -%endif - -%if 0%{?mageia} > 7 || 0%{?sle_version} || 0%{?suse_version} - cd %{__builddir} +%if 0%{?suse_version} + %cmake_build -C %{__builddir} check +%else + %if 0%{?epel} + %cmake_build check + %else + %cmake_build --target check + %endif %endif -make check %{?_smp_mflags} - %files %license LICENSE +%doc doc/* %{_bindir}/* %{_includedir}/%{name} %{_libdir}/*