Optimize builtin SPEC file

1. optimize writing, add <Provides> SPEC Directive, improve install command and update version to 2.0.19
2. adjust assignment way of variable <prefix> and <DESTDIR> in makefile
This commit is contained in:
Weilun Fong 2021-09-21 11:46:20 +08:00
parent 0810f732d2
commit ae41f796fe
2 changed files with 26 additions and 20 deletions

View File

@ -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 <wlf@zhishan-iot.tk>
- Improve install command
- Add <Provides> SPEC Directive
* Mon Aug 27 2007 Horst H. von Brand <vonbrand@inf.utfsm.cl> 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:

View File

@ -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/