# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify Alma, CentOS, CentOS Stream and Rocky Linux as rhel %if "%{__distinit}" == "a" || "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "cs" || "%{__distinit}" == "rl" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif Name: perl-Variable-Magic Version: 0.64 Release: 2.%{__distinit}%{__distvers} Summary: Associate user-defined magic to variables from Perl License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Variable-Magic Source0: https://cpan.metacpan.org/modules/by-module/Variable/Variable-Magic-%{version}.tar.gz # Module Build BuildRequires: coreutils BuildRequires: findutils BuildRequires: gcc BuildRequires: make BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(Config) BuildRequires: perl(ExtUtils::MakeMaker) # Module Runtime BuildRequires: perl(base) BuildRequires: perl(Carp) BuildRequires: perl(Exporter) BuildRequires: perl(strict) BuildRequires: perl(warnings) BuildRequires: perl(XSLoader) # Test Suite BuildRequires: perl(B::Deparse) BuildRequires: perl(bytes) BuildRequires: perl(File::Spec) BuildRequires: perl(lib) BuildRequires: perl(POSIX) BuildRequires: perl(Test::More) BuildRequires: perl(vars) # Optional Tests BuildRequires: perl(Hash::Util::FieldHash) BuildRequires: perl(IO::Handle) BuildRequires: perl(IO::Select) BuildRequires: perl(IPC::Open3) BuildRequires: perl(Perl::Destruct::Level) BuildRequires: perl(Socket) BuildRequires: perl(Symbol) BuildRequires: perl(threads) BuildRequires: perl(threads::shared) BuildRequires: perl(Tie::Array) BuildRequires: perl(Tie::Hash) # Dependencies %if 0%{?fedora} < 38 && 0%{?rhel} < 10 Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %endif Requires: perl(Carp) Requires: perl(Exporter) Requires: perl(XSLoader) # Avoid provides of private shared objects %{?perl_default_filter} %description Magic is Perl way of enhancing objects. This mechanism let the user add extra data to any variable and hook syntactical operations (such as access, assignation or destruction) that can be applied to it. With this module, you can add your own magic to any variable without the pain of the C API. %prep %setup -q -n Variable-Magic-%{version} %build perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} find %{buildroot} -type f -name .packlist -delete find %{buildroot} -type f -name '*.bs' -empty -delete %{_fixperms} -c %{buildroot} %check make test %files %doc Changes CONTRIBUTING README %{perl_vendorarch}/auto/Variable/ %{perl_vendorarch}/Variable/ %{_mandir}/man3/Variable::Magic.3* %changelog * Thu Jun 13 2024 Paul Howarth <paul@city-fan.org> - 0.64-2 - Perl 5.40 rebuild * Tue Mar 19 2024 Paul Howarth <paul@city-fan.org> - 0.64-1 - Update to 0.64 (rhbz#2270204) - This is a maintenance release; the code contains no functional change - Contributing guidelines are now listed in the new CONTRIBUTING file - Fix for t/18-opinfo.t broken under blead (CPAN RT#151104) * Tue Jul 11 2023 Paul Howarth <paul@city-fan.org> - 0.63-3 - Perl 5.38 rebuild * Wed Sep 21 2022 Paul Howarth <paul@city-fan.org> - 0.63-1 - Update to 0.63 - Add support for 5.37.3's PADSV_STORE optimization; B.pm-related tests have been taught about this new thing (CPAN RT#144052) - Updated contact information - Use SPDX-format license tag * Wed Jun 1 2022 Paul Howarth <paul@city-fan.org> - 0.62-16 - Perl 5.36 rebuild * Fri May 21 2021 Paul Howarth <paul@city-fan.org> - 0.62-13 - Perl 5.34 rebuild * Thu Jun 25 2020 Paul Howarth <paul@city-fan.org> - 0.62-10 - Perl 5.32 rebuild * Fri May 31 2019 Paul Howarth <paul@city-fan.org> - 0.62-7 - Perl 5.30 rebuild * Wed Jun 27 2018 Paul Howarth <paul@city-fan.org> - 0.62-4 - Perl 5.28 rebuild * Mon Nov 6 2017 Paul Howarth <paul@city-fan.org> - 0.62-1 - Update to 0.62 - Fix compatibility with CV-in-stash optimization (CPAN RT#123314) * Fri Aug 4 2017 Paul Howarth <paul@city-fan.org> - 0.61-4 - BR: perl-generators unconditionally - BR: perl-interpreter rather than perl * Sun Jun 4 2017 Paul Howarth <paul@city-fan.org> - 0.61-2 - Drop support for EOL distributions prior to F-13 - Drop BuildRoot: and Group: tags - Drop explicit buildroot cleaning in %%install section - Drop explicit %%clean section - BR: perl-devel and perl(Hash::Util::FieldHash) unconditionally * Tue Jan 24 2017 Paul Howarth <paul@city-fan.org> - 0.61-1 - Update to 0.61 - Latest blead stack unwind work caused infinite loop in a test (CPAN RT#115792) * Wed Sep 7 2016 Paul Howarth <paul@city-fan.org> - 0.60-1 - Update to 0.60 - A large chunk of boilerplate XS code, which is also used in other XS modules, has been factored out of the main .xs file to a collection of .h files in the xsh subdirectory - Bleadperl v5.25.3-266-g1d7e644 broke V::M (CPAN RT#128989); Len magic is no longer called for negative array indices fetches, so the relevant tests are now skipped - Fix FTBFS when perl is not in the minimal buildroot * Tue May 17 2016 Paul Howarth <paul@city-fan.org> - 0.59-3 - BR: perl-generators where available - Simplify find commands with -empty and -delete * Tue Oct 6 2015 Paul Howarth <paul@city-fan.org> - 0.59-1 - Update to 0.59 - The magic callbacks are now always executed in a new stack; this should have no negative impact (performance-wise or behaviour-wise) on your code, but may actually fix some obscure bugs - Fix crash during install of Variable-Magic-0.58 running "t/18-opinfo.t" (CPAN RT#107294); a recent change in the core implementation of transliterations caused an undefined behaviour when it interacted with this module, which resulted in visible stack corruption on Win32 perls compiled with MSVC when the op_info feature was enabled - The object op_info feature will now handle correctly Unicode transliteration, multideref and custom ops - Explicitly BR: perl-devel, needed for EXTERN.h * Wed Jul 22 2015 Paul Howarth <paul@city-fan.org> - 0.58-1 - Update to 0.58 - If a non-len magic callback returns a reference, it will now only be freed at the end of the statement that caused the magic to trigger; this allows the user to attach free magic (or a plain destructor) to a token returned from the callbacks in order to defer an action after the magic is processed by perl - Fixed test failures of threads tests on systems with harsh resource constraints causing the threads to exit() during run * Wed Jun 17 2015 Paul Howarth <paul@city-fan.org> - 0.57-2 - Perl 5.22 rebuild * Sat Apr 18 2015 Paul Howarth <paul@city-fan.org> - 0.57-1 - Update to 0.57 - The new environment variable to enable thread tests on older perls is PERL_FORCE_TEST_THREADS; note that this variable should only be turned on by authors - Fix: Segfaults when the module is loaded by several threads (or Windows emulated processes) ran in parallel - Fix: Segfaults when the module is loaded in a thread, which spawns itself a new thread, and that child thread outlives its parent - Fix: Small memory leaks of structures required for thread safety - Fix: Update the Windows ActivePerl + gcc 3.4 workaround for ExtUtils::MakeMaker 7.04 - Test: The global destruction test will now be exercised on any perl that has DEBUGGING set - Test: Optional capturing tests in t/17-ctl.t that were only run when Capture::Tiny was present were converted to an IPC::Open3 based helper and will now be run everywhere * Wed Mar 11 2015 Paul Howarth <paul@city-fan.org> - 0.56-1 - Update to 0.56 - Remove lvalue uses of ERRSV (CPAN RT#101410) - Test: $ENV{$Config{ldlibpthname}} is now preserved on all platforms, which will address failures of t/17-ctl.t with unusual compilers (like icc) that link all their compiled objects to their own libraries - Test: The global destruction test is now only run on perl 5.13.4 and higher, and only if either Perl::Destruct::Level is installed or PERL_DESTRUCT_LEVEL is set and the perl is a debugging perl; this will solve rare crashes of t/15-self.t on perl 5.13.3 and older * Tue Oct 21 2014 Paul Howarth <paul@city-fan.org> - 0.55-1 - Update to 0.55 - Fix test failure in t/18-opinfo.t due to change in perl 5 blead; the new METHOP op class added in perl 5.21.5 is now supported * Thu Sep 25 2014 Paul Howarth <paul@city-fan.org> - 0.54-1 - Update to 0.54 - The new constant VMG_COMPAT_CODE_COPY_CLONE evaluates to true if your perl calls 'copy' magic when a magical code prototype is cloned, which is currently the case for perl 5.17.0 and above - Copy magic on subs put raw CV in $_[3]; $_[3] will now contain a reference to the cloned code when 'copy' magic is called for a coderef (CPAN RT#90205) - t/35-stash.t has been taught about perl 5.21.4 - Tests using run_perl() in t/17-ctl.t will no longer fail on Android - Classify buildreqs by usage * Wed Sep 10 2014 Paul Howarth <paul@city-fan.org> - 0.53-4 - Drop %%defattr, redundant since rpm 4.4 * Sun Sep 1 2013 Paul Howarth <paul@city-fan.org> - 0.53-1 - Update to 0.53 - This is a maintenance release; the code contains no functional change - Fix typo (CPAN RT#86338) - Author tests are no longer bundled with this distribution - Drop buildreqs only needed for author tests * Tue Jul 23 2013 Paul Howarth <paul@city-fan.org> - 0.52-3 - Perl 5.18 rebuild * Fri Jul 5 2013 Paul Howarth <paul@city-fan.org> - 0.52-2 - Don't BR: perl(Test::Kwalitee) when bootstrapping * Mon Nov 5 2012 Paul Howarth <paul@city-fan.org> - 0.52-1 - Update to 0.52 - The new constant VMG_COMPAT_SCALAR_NOLEN evaluates to true when your perl does not call 'len' magic for scalars, which is the case for perl 5.17.4 and above (CPAN RT#80388) - t/35-stash.t has been taught about perl 5.17.4 - Author tests overhaul - Bump module version requirements for author tests * Tue Aug 21 2012 Paul Howarth <paul@city-fan.org> - 0.51-1 - Update to 0.51 - It is now safe to call dispell() from inside 'free', 'copy' and 'uvar' callbacks to dispell the magic currently in use - Exceptions thrown from inside a 'free' callback are now always consistently propagated outside of the callback; they used to be lost when the 'free' callback was invoked at the end of an eval block or string - The 'reset RMG flag' workaround used to allow wizards with both 'uvar' and 'clear' magics to be cast onto a hash, has been made thread-safe * Thu Jul 12 2012 Paul Howarth <paul@city-fan.org> - 0.50-2 - Perl 5.16 rebuild * Mon Jun 25 2012 Paul Howarth <paul@city-fan.org> - 0.50-1 - Update to 0.50 - Less memory is leaked when a wizard is freed during global destruction, or when an exception is thrown from a 'free' callback - Fixed CPAN RT#77991: t/17-ctl.t fails with ActivePerl 5.14 and 5.16 - t/35-stash.t has been taught about perl 5.17.1 - Many documentation clarifications - BR: perl(threads) and perl(threads::shared) * Wed Jun 6 2012 Paul Howarth <paul@city-fan.org> - 0.49-1 - Update to 0.49 - This is a maintenance release - the code contains no functional change; satisfied users of version 0.48 can skip this update - Fix CPAN RT#77644: t/17_ctl.t fails in test 44 since 5.17.0 - t/99-kwalitee.t will be skipped when only problematic versions of its dependencies are available - Don't need to remove empty directories from the buildroot - Drop BR: perl(strict) and perl(warnings) as they're not dual-lived - Drop support for old distributions prior to FC-3: - Don't need to define %%{perl_vendorarch} - Use DESTDIR rather than PERL_INSTALL_ROOT - Use %%{_fixperms} macro rather than our own chmod incantation * Sat Feb 18 2012 Paul Howarth <paul@city-fan.org> - 0.48-1 - Update to 0.48 - You can now pass a reference to undef as the magic callback in order to install a no-op callback - BR: perl(base), perl(strict) and perl(warnings) * Thu Oct 27 2011 Paul Howarth <paul@city-fan.org> - 0.47-1 - Update to 0.47 - The new constant VMG_COMPAT_HASH_DELETE_NOUVAR_VOID evaluates to true when "delete $hash{key}" does not call 'delete' uvar magic in void context - The MAGIC tokens created by this module no longer use the mg_private member for storing a "magical" signature - Triggering magic in a thread on a variable cloned from the main interpreter, and when the wizard already went out of scope, will no longer segfault - The pointer table is no longer needed to ensure thread safety; the size of the object code is about 8% smaller for threaded perls - Threads tests will not fail any more if resource constraints prevent the system from creating all the required threads * Tue Jun 21 2011 Paul Howarth <paul@city-fan.org> - 0.46-4 - Rebuild for perl 5.14.1 in Rawhide - Fix dist tag for CentOS 6 and Scientific Linux * Fri Apr 29 2011 Paul Howarth <paul@city-fan.org> - 0.46-3 - Import from Fedora * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.46-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Mon Jan 24 2011 Emmanuel Seyman <emmanuel.seyman@club-internet.fr> - 0.46-1 - Update to 0.46 * Mon Nov 22 2010 Emmanuel Seyman <emmanuel.seyman@club-internet.fr> - 0.45-1 - Update to 0.45 * Wed Sep 29 2010 jkeating - 0.44-2 - Rebuilt for gcc bug 634757 * Sat Sep 25 2010 Emmanuel Seyman <emmanuel.seyman@club-internet.fr> - 0.44-1 - Update to 0.44 * Sat Jun 26 2010 Emmanuel Seyman <emmanuel.seyman@club-internet.fr> - 0.43-1 - Update to 0.43 * Wed May 19 2010 Emmanuel Seyman <emmanuel.seyman@club-internet.fr> - 0.42-1 - Update to 0.42 * Fri May 07 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.41-2 - Mass rebuild with perl-5.12.0 * Sun Apr 11 2010 Emmanuel Seyman <emmanuel.seyman@club-internet.fr> - 0.41-1 - Update to 0.41 * Mon Dec 7 2009 Stepan Kasal <skasal@redhat.com> - 0.37-2 - Rebuild against perl 5.10.1 * Sun Sep 27 2009 Chris Weyl <cweyl@alumni.drew.edu> - 0.37-1 - Auto-update to 0.37 (by cpan-spec-update 0.01) * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.34-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Sat May 16 2009 Chris Weyl <cweyl@alumni.drew.edu> - 0.34-1 - Update to 0.34 (for B::Hooks::EndOfScope 0.08) - Filter private Perl .so's * Mon Mar 9 2009 Allisson Azevedo <allisson@gmail.com> - 0.32-1 - Update to 0.32 * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.30-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Feb 14 2009 Allisson Azevedo <allisson@gmail.com> - 0.30-1 - Initial rpm release