[perl-constant] Import

Petr Pisar ppisar at fedoraproject.org
Fri Mar 22 07:58:07 UTC 2013


commit 53921cc7a062824617fc7f2ef1776caf5b1668fc
Author: Petr Písař <ppisar at redhat.com>
Date:   Fri Mar 22 08:57:56 2013 +0100

    Import

 .gitignore         |    1 +
 perl-constant.spec |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources            |    1 +
 3 files changed, 67 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..1bb1d98 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/constant-1.27.tar.gz
diff --git a/perl-constant.spec b/perl-constant.spec
new file mode 100644
index 0000000..325ea1c
--- /dev/null
+++ b/perl-constant.spec
@@ -0,0 +1,65 @@
+Name:           perl-constant
+Version:        1.27
+Release:        1%{?dist}
+Summary:        Perl pragma to declare constants
+License:        GPL+ or Artistic
+Group:          Development/Libraries
+URL:            http://search.cpan.org/dist/constant/
+Source0:        http://www.cpan.org/authors/id/S/SA/SAPER/constant-%{version}.tar.gz
+BuildArch:      noarch
+BuildRequires:  perl
+BuildRequires:  perl(Module::Build)
+BuildRequires:  perl(strict)
+# Run-time:
+BuildRequires:  perl(Carp)
+BuildRequires:  perl(vars)
+BuildRequires:  perl(warnings::register)
+# Tests:
+BuildRequires:  perl(Test::More)
+BuildRequires:  perl(utf8)
+BuildRequires:  perl(warnings)
+# Optional tests:
+BuildRequires:  perl(Test::Pod) >= 1.14
+BuildRequires:  perl(Test::Pod::Coverage) >= 1.04
+Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
+Requires:       perl(Carp)
+
+%description
+This pragma allows you to declare constants at compile-time:
+
+use constant PI => 4 * atan2(1, 1);
+
+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
+%setup -q -n constant-%{version}
+
+%build
+perl Build.PL installdirs=vendor
+./Build
+
+%install
+./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
+%{_fixperms} $RPM_BUILD_ROOT/*
+
+%check
+./Build test
+
+%files
+%doc Changes eg README
+%{perl_vendorlib}/*
+%{_mandir}/man3/*
+
+%changelog
+* Thu Mar 21 2013 Petr Pisar <ppisar at redhat.com> 1.27-1
+- Specfile autogenerated by cpanspec 1.78.
diff --git a/sources b/sources
index e69de29..36d22d9 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+1e00a4fbed2b98ae1f447848b132cdd0  constant-1.27.tar.gz


More information about the scm-commits mailing list