# # spec file for package perl-Catalyst-Plugin-Static-Simple # # 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 Catalyst-Plugin-Static-Simple Name: perl-Catalyst-Plugin-Static-Simple Version: 0.370.0 Release: 0 # 0.37 -> normalize -> 0.370.0 %define cpan_version 0.37 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Make serving static pages painless URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/I/IL/ILMARI/%{cpan_name}-%{cpan_version}.tar.gz Source1: cpanspec.yml Source100: README.md BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Catalyst::Runtime) >= 5.800.80 BuildRequires: perl(MIME::Types) >= 2.03 BuildRequires: perl(Moose) BuildRequires: perl(namespace::autoclean) Requires: perl(Catalyst::Runtime) >= 5.800.80 Requires: perl(MIME::Types) >= 2.03 Requires: perl(Moose) Requires: perl(namespace::autoclean) Provides: perl(Catalyst::Plugin::Static::Simple) = %{version} %undefine __perllib_provides %{perl_requires} %description The Static::Simple plugin is designed to make serving static content in your application during development quick and easy, without requiring a single line of code from you. This plugin detects static files by looking at the file extension in the URL (such as *.css* or *.png* or *.js*). The plugin uses the lightweight MIME::Types module to map file extensions to IANA-registered MIME types, and will serve your static files with the correct MIME type directly to the browser, without being processed through Catalyst. Note that actions mapped to paths using periods (.) will still operate properly. If the plugin can not find the file, the request is dispatched to your application instead. This means you are responsible for generating a '404' error if your application can not process the request: # handled by static::simple, not dispatched to your application /images/exists.png # static::simple will not find the file and let your application # handle the request. You are responsible for generating a file # or returning a 404 error /images/does_not_exist.png Though Static::Simple is designed to work out-of-the-box, you can tweak the operation by adding various configuration options. In a production environment, you will probably want to use your webserver to deliver static content; for an example see USING WITH APACHE, below. %prep %autosetup -n %{cpan_name}-%{cpan_version} find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644 %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 %license LICENSE %changelog