2010-01-28 00:22:13 +00:00
|
|
|
|
#
|
2011-03-04 18:26:36 +00:00
|
|
|
|
# spec file for package perl-common-sense
|
2010-01-28 00:22:13 +00:00
|
|
|
|
#
|
2025-02-04 19:01:54 +00:00
|
|
|
|
# Copyright (c) 2025 SUSE LLC
|
2010-01-28 00:22:13 +00:00
|
|
|
|
#
|
|
|
|
|
# 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.
|
|
|
|
|
|
2020-04-06 21:48:09 +00:00
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-01-28 00:22:13 +00:00
|
|
|
|
#
|
|
|
|
|
|
2012-05-23 13:02:01 +00:00
|
|
|
|
|
2025-02-04 19:01:54 +00:00
|
|
|
|
%define cpan_name common-sense
|
2010-01-28 00:22:13 +00:00
|
|
|
|
Name: perl-common-sense
|
2025-02-04 19:01:54 +00:00
|
|
|
|
Version: 3.750.0
|
2012-05-23 13:02:01 +00:00
|
|
|
|
Release: 0
|
2025-02-04 19:01:54 +00:00
|
|
|
|
# 3.75 -> normalize -> 3.750.0
|
|
|
|
|
%define cpan_version 3.75
|
2020-04-06 21:48:09 +00:00
|
|
|
|
#Upstream: CHECK(Artistic-1.0 or GPL-1.0-or-later)
|
2025-02-04 19:01:54 +00:00
|
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2020-04-06 21:48:09 +00:00
|
|
|
|
Summary: Save a tree AND a kitten, use common::sense!
|
2025-02-04 19:01:54 +00:00
|
|
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
|
|
|
Source0: https://cpan.metacpan.org/authors/id/M/ML/MLEHMANN/%{cpan_name}-%{cpan_version}.tar.gz
|
2015-04-15 19:02:04 +00:00
|
|
|
|
Source1: cpanspec.yml
|
2025-08-12 18:12:33 +02:00
|
|
|
|
Source100: README.md
|
2015-04-15 19:02:04 +00:00
|
|
|
|
# MANUAL
|
|
|
|
|
#BuildArch: noarch
|
2010-01-28 00:22:13 +00:00
|
|
|
|
BuildRequires: perl
|
|
|
|
|
BuildRequires: perl-macros
|
2011-03-04 18:26:36 +00:00
|
|
|
|
%{perl_requires}
|
2025-02-05 11:27:19 +00:00
|
|
|
|
# MANUAL BEGIN
|
|
|
|
|
Provides: perl(common::sense) = %{version}
|
|
|
|
|
# MANUAL END
|
2010-01-28 00:22:13 +00:00
|
|
|
|
|
|
|
|
|
%description
|
2013-08-04 15:07:39 +00:00
|
|
|
|
“Nothing is more fairly distributed than common sense: no one thinks
|
|
|
|
|
he needs more of it than he already has.”
|
|
|
|
|
|
|
|
|
|
– René Descartes
|
|
|
|
|
|
|
|
|
|
This module implements some sane defaults for Perl programs, as defined by
|
|
|
|
|
two typical (or not so typical - use your common sense) specimens of Perl
|
|
|
|
|
coders. In fact, after working out details on which warnings and strict
|
|
|
|
|
modes to enable and make fatal, we found that we (and our code written so
|
|
|
|
|
far, and others) fully agree on every option, even though we never used
|
|
|
|
|
warnings before, so it seems this module indeed reflects a "common" sense
|
|
|
|
|
among some long-time Perl coders.
|
2011-03-04 18:26:36 +00:00
|
|
|
|
|
|
|
|
|
The basic philosophy behind the choices made in common::sense can be
|
|
|
|
|
summarised as: "enforcing strict policies to catch as many bugs as
|
|
|
|
|
possible, while at the same time, not limiting the expressive power
|
|
|
|
|
available to the programmer".
|
|
|
|
|
|
2013-08-04 15:07:39 +00:00
|
|
|
|
Two typical examples of how this philosophy is applied in practise is the
|
|
|
|
|
handling of uninitialised and malloc warnings:
|
|
|
|
|
|
|
|
|
|
* _uninitialised_
|
|
|
|
|
|
2020-04-06 21:48:09 +00:00
|
|
|
|
'undef' is a well-defined feature of perl, and enabling warnings for using
|
|
|
|
|
it rarely catches any bugs, but considerably limits you in what you can do,
|
|
|
|
|
so uninitialised warnings are disabled.
|
2013-08-04 15:07:39 +00:00
|
|
|
|
|
|
|
|
|
* _malloc_
|
|
|
|
|
|
2020-04-06 21:48:09 +00:00
|
|
|
|
Freeing something twice on the C level is a serious bug, usually causing
|
|
|
|
|
memory corruption. It often leads to side effects much later in the program
|
|
|
|
|
and there are no advantages to not reporting this, so malloc warnings are
|
|
|
|
|
fatal by default.
|
2013-08-04 15:07:39 +00:00
|
|
|
|
|
|
|
|
|
Unfortunately, there is no fine-grained warning control in perl, so often
|
|
|
|
|
whole groups of useful warnings had to be excluded because of a single
|
|
|
|
|
useless warning (for example, perl puts an arbitrary limit on the length of
|
|
|
|
|
text you can match with some regexes before emitting a warning, making the
|
|
|
|
|
whole 'regexp' category useless).
|
|
|
|
|
|
|
|
|
|
What follows is a more thorough discussion of what this module does, and
|
|
|
|
|
why it does it, and what the advantages (and disadvantages) of this
|
|
|
|
|
approach are.
|
|
|
|
|
|
2010-01-28 00:22:13 +00:00
|
|
|
|
%prep
|
2025-02-04 19:01:54 +00:00
|
|
|
|
%autosetup -n %{cpan_name}-%{cpan_version} -p1
|
|
|
|
|
|
|
|
|
|
find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644
|
2010-01-28 00:22:13 +00:00
|
|
|
|
|
|
|
|
|
%build
|
2020-04-06 21:48:09 +00:00
|
|
|
|
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
|
2025-02-04 19:01:54 +00:00
|
|
|
|
%make_build
|
2010-01-28 00:22:13 +00:00
|
|
|
|
|
|
|
|
|
%check
|
2020-04-06 21:48:09 +00:00
|
|
|
|
make test
|
2010-01-28 00:22:13 +00:00
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%perl_make_install
|
2011-03-04 18:26:36 +00:00
|
|
|
|
%perl_process_packlist
|
2010-01-28 00:22:13 +00:00
|
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
2020-04-06 21:48:09 +00:00
|
|
|
|
%doc Changes README
|
|
|
|
|
%license LICENSE
|
2010-01-28 00:22:13 +00:00
|
|
|
|
|
|
|
|
|
%changelog
|