%define upstream_name Catalyst-Component-ACCEPT_CONTEXT %define upstream_version 0.07 Name: perl-%{upstream_name} Version: %perl_convert_version %{upstream_version} Release: %mkrel 7 Summary: Make the current Catalyst context available in Models and Views License: GPL+ or Artistic Group: Development/Perl Url: https://metacpan.org/release/%{upstream_name} Source0: https://cpan.metacpan.org/modules/by-module/Catalyst/%{upstream_name}-%{upstream_version}.tar.gz BuildRequires: perl(Catalyst) BuildRequires: perl(Devel::Cycle) BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(inc::Module::Install) BuildRequires: perl(MRO::Compat) BuildRequires: perl(Scalar::Util) BuildArch: noarch %description Models and Views don't usually have access to the request object, since they probably don't really need it. Sometimes, however, having the request context available outside of Controllers makes your application cleaner. If that's the case, just use this module as a base class: package MyApp::Model::Foobar; use base qw|Catalyst::Component::ACCEPT_CONTEXT Catalyst::Model|; Then, you'll be able to get the current request object from within your model: sub do_something { my $self = shift; print "The current URL is ". $self->context->req->uri->as_string; } %prep %setup -q -n %{upstream_name}-%{upstream_version} %build %{__perl} Makefile.PL INSTALLDIRS=vendor %make_build %check %make_build test %install %make_install %files %doc Changes META.yml README %{_mandir}/man3/* %perl_vendorlib/* %changelog * Tue Mar 29 2022 umeabot <umeabot> 0.70.0-7.mga9 + Revision: 1831396 - Mageia 9 Mass Rebuild * Wed Feb 12 2020 umeabot <umeabot> 0.70.0-6.mga8 + Revision: 1503509 - Mageia 8 Mass Rebuild + wally <wally> - replace deprecated %%makeinstall_std * Thu Sep 20 2018 umeabot <umeabot> 0.70.0-5.mga7 + Revision: 1282062 - Mageia 7 Mass Rebuild * Mon Oct 09 2017 tv <tv> 0.70.0-4.mga7 + Revision: 1170426 - BR perl(inc::Module::Install) * Sat Jun 18 2016 pterjan <pterjan> 0.70.0-3.mga6 + Revision: 1022849 - Rebuild for perl 5.22.2 * Tue Feb 09 2016 umeabot <umeabot> 0.70.0-2.mga6 + Revision: 951344 - Mageia 6 Mass Rebuild * Wed Dec 24 2014 buchan <buchan> 0.70.0-1.mga5 + Revision: 805288 - imported package perl-Catalyst-Component-ACCEPT_CONTEXT * Wed Dec 24 2014 cpan2dist 0.07-1mga - initial mageia release, generated with cpan2dist