67 lines
2.1 KiB
RPMSpec
67 lines
2.1 KiB
RPMSpec
#
|
|
# spec file for package perl-constant
|
|
#
|
|
# 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 constant
|
|
Name: perl-constant
|
|
Version: 1.33
|
|
Release: 0
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
|
Summary: Perl pragma to declare constants
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
Source0: https://cpan.metacpan.org/authors/id/R/RJ/RJBS/%{cpan_name}-%{version}.tar.gz
|
|
Source100: README.md
|
|
BuildArch: noarch
|
|
BuildRequires: perl
|
|
BuildRequires: perl-macros
|
|
%{perl_requires}
|
|
|
|
%description
|
|
This pragma allows you to declare constants at compile-time.
|
|
|
|
When you declare a constant such as 'PI' using the method shown above, each
|
|
machine your script runs upon can have as many digits of accuracy as it can
|
|
use. Also, your program will be easier to read, more likely to be
|
|
maintained (and maintained correctly), and far less likely to send a space
|
|
probe to the wrong planet because nobody noticed the one equation in which
|
|
you wrote '3.14195'.
|
|
|
|
When a constant is used in an expression, Perl replaces it with its value
|
|
at compile time, and may then optimize the expression further. In
|
|
particular, any code in an 'if (CONSTANT)' block will be optimized away if
|
|
the constant is false.
|
|
|
|
%prep
|
|
%autosetup -n %{cpan_name}-%{version}
|
|
|
|
%build
|
|
perl Makefile.PL INSTALLDIRS=vendor
|
|
%make_build
|
|
|
|
%check
|
|
make test
|
|
|
|
%install
|
|
%perl_make_install
|
|
%perl_process_packlist
|
|
%perl_gen_filelist
|
|
|
|
%files -f %{name}.files
|
|
%doc Changes README
|
|
|
|
%changelog
|