From ae41f796fe9ec6c659d91a24c8b99649125d83ec Mon Sep 17 00:00:00 2001 From: Weilun Fong Date: Tue, 21 Sep 2021 11:46:20 +0800 Subject: [PATCH] Optimize builtin SPEC file 1. optimize writing, add SPEC Directive, improve install command and update version to 2.0.19 2. adjust assignment way of variable and in makefile --- flawfinder.spec | 40 +++++++++++++++++++++++----------------- makefile | 6 +++--- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/flawfinder.spec b/flawfinder.spec index 38106b6..8b2fdda 100644 --- a/flawfinder.spec +++ b/flawfinder.spec @@ -1,14 +1,20 @@ -Name: flawfinder -Summary: Examines C/C++ source code for security flaws -Version: 2.0.18 -Release: 1%{?dist} -License: GPLv2+ -Group: Development/Tools -URL: http://dwheeler.com/flawfinder/ -Source: http://dwheeler.com/flawfinder/%{name}-%{version}.tar.gz -Requires: python -BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Name: flawfinder +Summary: Examines C/C++ source code for security flaws +Version: 2.0.19 +Release: 1%{?dist} +Group: Development/Tools + +License: GPLv2+ +URL: http://dwheeler.com/flawfinder/ +Source: http://dwheeler.com/flawfinder/%{name}-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: flex +BuildRequires: make +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Provides: flawfinder = %{version}-%{release} +Requires: python %description Flawfinder scans through C/C++ source code, @@ -19,12 +25,10 @@ By default it reports hits sorted by severity, with the riskiest lines first. %setup -q %build -make %{?_smp_mflags} +%{__make} %{?_smp_mflags} %install -rm -rf $RPM_BUILD_ROOT -install -m755 -D flawfinder ${RPM_BUILD_ROOT}%{_bindir}/flawfinder -install -m644 -D flawfinder.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/flawfinder.1 +%{__make} install DESTDIR=${RPM_BUILD_ROOT} prefix=%{_usr} %clean rm -rf $RPM_BUILD_ROOT @@ -36,6 +40,10 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/* %changelog +* Tue Sep 21 2021 Weilun Fong +- Improve install command +- Add SPEC Directive + * Mon Aug 27 2007 Horst H. von Brand 1.27-2 - Fix specfile as per Fedora guidelines @@ -43,5 +51,3 @@ rm -rf $RPM_BUILD_ROOT - changed build architecture to noarch - replaced hardcoded directories by rpm macros - removed several rpmlint warnings/errors - -# vim:set ai ts=4 sw=4: diff --git a/makefile b/makefile index fe0d03e..e1ad121 100644 --- a/makefile +++ b/makefile @@ -6,7 +6,7 @@ # how to change version numbers. NAME=flawfinder -VERSION=2.0.18 +VERSION=2.0.19 RPM_VERSION=1 VERSIONEDNAME=$(NAME)-$(VERSION) ARCH=noarch @@ -19,7 +19,7 @@ SAMPLE_DIR=/usr/src/linux-2.2.16 # not notice any changes. We define exec_prefix oddly so we can # quietly merge these 2 systems: -prefix=/usr/local +prefix?=/usr/local INSTALL_DIR=$(prefix) exec_prefix=$(INSTALL_DIR) bindir=$(exec_prefix)/bin @@ -44,7 +44,7 @@ PYTHONEXT= RPMBUILD=rpmbuild -DESTDIR= +DESTDIR?= TESTDIR=test/