File ftnchek.spec of Package ftnchek

#
# spec file for package ftnchek
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define svnrev 132
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
%global debug_package %{nil}
%endif

Name:           ftnchek
Version:        4beta_r%{svnrev}
Release:        0
Summary:        Static analyzer for Fortran programs
License:        MIT
Group:          Development/Languages/Fortran
URL:            https://sourceforge.net/projects/ftnchek/
#---first trigger creation of snapshot if needed at https://sourceforge.net/p/ftnchek/svn/%%{svnrev}/tree/
Source0:        https://sourceforge.net/code-snapshots/svn/f/ft/ftnchek/svn/ftnchek-svn-r%{svnrev}.zip
Patch0:         increase-maxline.patch
Patch1:         fix_dcl2inc_path.patch
Patch2:         argcheck.c.patch
Patch3:         advance.c.patch
Patch4:         increase_hashsize.patch
Patch5:         fix_hashtab.patch
Patch6:         symtab.h.patch
Patch7:         get_type-null-pointer.patch
Patch8:         errorstop.patch
Patch9:         makefile.patch
Patch10:        f2003-io-keywords.patch
Patch11:        flush-intrins.patch
Patch12:        flush-statement.patch
Patch13:        vms_intrins.patch
Patch14:        unix_intrins.patch
Patch15:        f03_intrins.patch
Patch16:        fix_int-overflows.patch
Patch17:        maybe-uninitialized.patch
Patch18:        fix_alist_null-deref.patch
Patch19:        f08_intrins.patch
Patch20:        reverse_source-form-default.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  bison
BuildRequires:  unzip
%if !(0%{?rhel_version})
BuildRequires:  groff
%endif
Requires:       awk

%description
ftnchek is a static analyzer for Fortran programs. It detects errors that a
compiler usually does not. Its purpose is to assist the user in finding errors
that are legal in the Fortran language but are wasteful or may cause incorrect
operation. Besides covering Fortran 77, ftnchek 4 supports some major
Fortran 95 features.

%prep
%autosetup -p1 -n "ftnchek-svn-r%{svnrev}/ftnchek"
libtoolize -icf
autoreconf -if -Wall,no-obsolete

%build
%configure
#---no parallel build, otherwise errors in fortran.c target
%make_build -j1 CFLAGS="%{optflags} -DUNIX"

%check
#---check aborts if ~/.ftnchekrc exists
env HOME=%{_localstatedir}/lib/empty %make_build -j1 check

%install
%make_install \
  bindir=%{buildroot}%{_bindir} \
  mandir=%{buildroot}%{_mandir} \
  datadir=%{buildroot}%{_datadir}

%files
%license LICENSE
%doc FAQ PATCHES README README-devel
%{_bindir}/%{name}
%{_bindir}/dcl2inc
%{_datadir}/%{name}/
%{_mandir}/man1/%{name}.1%{?ext_man}*
%{_mandir}/man1/dcl2inc.1%{?ext_man}*

%changelog
openSUSE Build Service is sponsored by