# # spec file for package perl-Class-Observable # # 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 Class-Observable Name: perl-Class-Observable Version: 2.4.0 Release: 0 # 2.004 -> normalize -> 2.4.0 %define cpan_version 2.004 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Allow other classes and objects to respond to events in yours URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/A/AR/ARISTOTLE/%{cpan_name}-%{cpan_version}.tar.gz Source1: cpanspec.yml Source100: README.md BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Class::ISA) >= 0.32 Requires: perl(Class::ISA) >= 0.32 Provides: perl(Class::Observable) = %{version} %undefine __perllib_provides %{perl_requires} %description If you have ever used Java, you may have run across the 'java.util.Observable' class and the 'java.util.Observer' interface. With them you can decouple an object from the one or more objects that wish to be notified whenever particular events occur. These events occur based on a contract with the observed item. They may occur at the beginning, in the middle or end of a method. In addition, the object *knows* that it is being observed. It just does not know how many or what types of objects are doing the observing. It can therefore control when the messages get sent to the obsevers. The behavior of the observers is up to you. However, be aware that we do not do any error handling from calls to the observers. If an observer throws a 'die', it will bubble up to the observed item and require handling there. So be careful. %prep %autosetup -n %{cpan_name}-%{cpan_version} %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