diff --git a/splint.spec b/splint.spec index b718672..f0d71ab 100644 --- a/splint.spec +++ b/splint.spec @@ -1,81 +1,73 @@ -%define prefix /usr -%define ver 3.0.1.6 -Summary: Splint - A tool for statically checking C programs -Name: splint -Version: %ver -Release: 1 -Copyright: MIT -Url: http://www.splint.org - -Packager: Heiko Abraham, abrahamh@web.de -Group: Development/Languages -Source: %{name}-%{ver}.src.tgz - -BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root -Requires: gcc - +# splint.spec +Summary: Splint - A tool for statically checking C programs +Name: splint +Version: 3.1.2 +Release: 2%{?dist} +License: GPLv2+ +Url: http://www.splint.org +Group: Development/Tools +Source: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} +BuildRequires: bison flex flex-devel gcc +Obsoletes: lclint <= 3.0.0 +Provides: lclint = %{version}-%{release} +Provides: splint = %{version}-%{release} +Provides: splint(%{_arch}) = %{version}-%{release} %description -Splint is a tool for statically checking C programs for security vulnerabilities +Splint is a tool for statically checking C programs for security vulnerabilities and common programming mistakes. With minimal effort, Splint can be used as a better lint(1).If additional effort is invested adding annotations to programs, Splint can perform stronger checks than can be done by any standard lint. For -full documentation, please see http://www.splint.org. +full documentation, please see http://www.splint.org. Please set environment variables: -- LARCH_PATH=%{prefix}/share/splint/lib +- LARCH_PATH=%{_datadir}/splint/lib and -- LCLIMPORTDIR=%{prefix}/share/splint/imports -. +- LCLIMPORTDIR=%{_datadir}/splint/imports %prep %setup -q +chmod 644 doc/manual.pdf # TODO: this line should remove in the future +cp -p src/.splintrc splintrc.demo %build -CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} -make +test ! -f configure && ./bootstrap +CFLAGS="$CFLAGS $RPM_OPT_FLAGS" +%configure +make -j `nproc` %install rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{prefix}/bin -mkdir -p $RPM_BUILD_ROOT%{prefix}/share/doc/%{name}-%{PACKAGE_VERSION} -mkdir -p $RPM_BUILD_ROOT%{prefix}/share/splint/imports -mkdir -p $RPM_BUILD_ROOT%{prefix}/share/splint/lib -mkdir -p $RPM_BUILD_ROOT%{prefix}/share/man/man1 - -make DESTDIR=$RPM_BUILD_ROOT install - -# now install docs, why 'make install' will not do this -cp README $RPM_BUILD_ROOT%{prefix}/share/doc/%{name}-%{PACKAGE_VERSION} -cp doc/*.html $RPM_BUILD_ROOT%{prefix}/share/doc/%{name}-%{PACKAGE_VERSION} -cp doc/*.pdf $RPM_BUILD_ROOT%{prefix}/share/doc/%{name}-%{PACKAGE_VERSION} - - +make DESTDIR=$RPM_BUILD_ROOT install %post %preun - - %clean -rm -rf $RPM_BUILD_ROOT/* -rm -rf $RPM_BUILD_DIR/%{name}-%{PACKAGE_VERSION}/* - - - +make clean %files -%{prefix}/bin/splint -%{prefix}/share/splint/imports/* -%{prefix}/share/splint/lib/* -%{prefix}/share/doc/%{name}-%{PACKAGE_VERSION}/* - - - - - - +%defattr(-,root,root,-) +%doc README.md doc/manual.pdf splintrc.demo +%license LICENSE +%{_bindir}/splint +%{_mandir}/man1/*.1* +%dir %{_datadir}/splint +%{_datadir}/splint/* + +%define __debug_install_post \ + %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ +%{nil} + +%changelog +* Tue Spe 07 2021 Weilun Fong - 3.1.2-2 +- Refactor the whole .spec file, make it more readable and maintainable +- Improve provides list and filelist + +* Mon May 20 2002 Heiko Abraham - 3.1.2-1 +- Contribute splint.spec