commit e10bd126719e8cfea0919ebfc3b74f4d52c8419af63d7d14b30dc96d9b71950c Author: Stephan Kulow Date: Sun May 1 10:39:44 2011 +0000 initial package OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-enum?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/enum-1.016.tar.gz b/enum-1.016.tar.gz new file mode 100644 index 0000000..bdde1c7 --- /dev/null +++ b/enum-1.016.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd4a2f44f60fe0ac5f708a7a232601a634bfb6b7f561e2eef706e9efa2cd04d0 +size 5847 diff --git a/perl-enum.changes b/perl-enum.changes new file mode 100644 index 0000000..93fd39e --- /dev/null +++ b/perl-enum.changes @@ -0,0 +1,6 @@ +------------------------------------------------------------------- +Sun May 1 10:39:39 UTC 2011 - coolo@opensuse.org + +- initial package 1.016 + * created by cpanspec 1.78.04 + diff --git a/perl-enum.spec b/perl-enum.spec new file mode 100644 index 0000000..8763893 --- /dev/null +++ b/perl-enum.spec @@ -0,0 +1,83 @@ +# +# spec file for package perl-enum (Version 1.016) +# +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# 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 http://bugs.opensuse.org/ +# + +Name: perl-enum +Version: 1.016 +Release: 1 +License: Permission to use, modify, and redistribute this module granted under the same terms as *Perl*. +%define cpan_name enum +Summary: C style enumerated types and bitmask flags in Perl +Url: http://search.cpan.org/dist/enum/ +Group: Development/Libraries/Perl +Source: http://www.cpan.org/authors/id/Z/ZE/ZENIN/%{cpan_name}-%{version}.tar.gz +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: perl +BuildRequires: perl-macros +%{perl_requires} + +%description +Defines a set of symbolic constants with ordered numeric values ala *C* +*enum* types. + +Now capable of creating creating ordered bitmask constants as well. See the +*BITMASKS* section for details. + +What are they good for? Typical uses would be for giving mnemonic names to +indexes of arrays. Such arrays might be a list of months, days, or a return +value index from a function such as localtime(): + + use enum qw( + :Months_=0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec + :Days_=0 Sun Mon Tue Wed Thu Fri Sat + :LC_=0 Sec Min Hour MDay Mon Year WDay YDay Isdst + ); + + if ((localtime)[LC_Mon] == Months_Jan) { + print "It's January!\n"; + } + if ((localtime)[LC_WDay] == Days_Fri) { + print "It's Friday!\n"; + } + +This not only reads easier, but can also be typo-checked at compile time +when run under *use strict*. That is, if you misspell *Days_Fri* as +*Days_Fry*, you'll generate a compile error. + +%prep +%setup -q -n %{cpan_name}-%{version} + +%build +%{__perl} Makefile.PL INSTALLDIRS=vendor +%{__make} %{?_smp_mflags} + +%check +%{__make} test + +%install +%perl_make_install +%perl_process_packlist +%perl_gen_filelist + +%clean +%{__rm} -rf %{buildroot} + +%files -f %{name}.files +%defattr(-,root,root,755) +%doc Changes README + +%changelog