92 lines
2.8 KiB
RPMSpec
92 lines
2.8 KiB
RPMSpec
#
|
|
# spec file for package perl-true
|
|
#
|
|
# Copyright (c) 2024 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 cpan_name true
|
|
Name: perl-true
|
|
Version: 1.0.2
|
|
Release: 0
|
|
# v1.0.2 -> normalize -> 1.0.2
|
|
%define cpan_version v1.0.2
|
|
License: Artistic-2.0
|
|
Summary: Automatically return a true value when a file is required
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
Source0: https://cpan.metacpan.org/authors/id/C/CH/CHOCOLATE/%{cpan_name}-%{cpan_version}.tar.gz
|
|
Source1: cpanspec.yml
|
|
Source100: README.md
|
|
BuildRequires: perl
|
|
BuildRequires: perl-macros
|
|
BuildRequires: perl(B::Hooks::OP::Annotation) >= 0.44
|
|
BuildRequires: perl(B::Hooks::OP::Check) >= 0.22
|
|
BuildRequires: perl(Devel::StackTrace) >= 2.03
|
|
BuildRequires: perl(ExtUtils::Depends) >= 0.405
|
|
BuildRequires: perl(Function::Parameters) >= 2.1.3
|
|
BuildRequires: perl(Moo) >= 2.003004
|
|
Requires: perl(B::Hooks::OP::Annotation) >= 0.44
|
|
Requires: perl(B::Hooks::OP::Check) >= 0.22
|
|
Requires: perl(Devel::StackTrace) >= 2.03
|
|
%{perl_requires}
|
|
|
|
%description
|
|
Perl's 'require' builtin (and its 'use' wrapper) requires the files it
|
|
loads to return a true value. This is usually accomplished by placing a
|
|
single
|
|
|
|
1;
|
|
|
|
statement at the end of included scripts or modules. It's not onerous to
|
|
add but it's a speed bump on the Perl novice's road to enlightenment. In
|
|
addition, it appears to be a _non-sequitur_ to the uninitiated, leading
|
|
some to attempt to mitigate its appearance with a comment:
|
|
|
|
1; # keep require happy
|
|
|
|
or:
|
|
|
|
1; # Do not remove this line
|
|
|
|
or even:
|
|
|
|
1; # Must end with this, because Perl is bogus.
|
|
|
|
This module packages this "return true" behaviour so that it doesn't need
|
|
to be written explicitly. It can be used directly, but it is intended to be
|
|
invoked from the 'import' method of a Modern::Perl-style module that
|
|
enables modern Perl features and conveniences and cleans up legacy Perl
|
|
warts.
|
|
|
|
%prep
|
|
%autosetup -n %{cpan_name}-%{cpan_version}
|
|
|
|
%build
|
|
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
|
|
%make_build
|
|
|
|
%check
|
|
make test
|
|
|
|
%install
|
|
%perl_make_install
|
|
%perl_process_packlist
|
|
%perl_gen_filelist
|
|
|
|
%files -f %{name}.files
|
|
%doc Changes README
|
|
%license LICENSE.md
|
|
|
|
%changelog
|