|
|
|
@@ -0,0 +1,155 @@
|
|
|
|
|
#
|
|
|
|
|
# spec file for package perl-Class-Observable
|
|
|
|
|
#
|
|
|
|
|
# Copyright (c) 2009 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/
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
|
|
|
|
|
|
%define pren perl
|
|
|
|
|
%define mname Class-Observable
|
|
|
|
|
%define ver 1.04
|
|
|
|
|
|
|
|
|
|
%if !%( echo %{mname} | grep "-" >/dev/null; echo $? )
|
|
|
|
|
%define mpath %( echo %{mname} | sed -e "s,-,/,g")
|
|
|
|
|
%define mcnt %( echo %{mpath} | awk -F"/" '{print NF}' )
|
|
|
|
|
%define fname %(echo %{mname} | awk -F"-" '{print $1}')
|
|
|
|
|
%else
|
|
|
|
|
%define mpath %{mname}
|
|
|
|
|
%define mcnt 1
|
|
|
|
|
%define fname %{mname}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{?rel:0}%{!?rel:1}
|
|
|
|
|
%define rel 1
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
#Distribution: %dist
|
|
|
|
|
#Packager: %packager
|
|
|
|
|
#Vendor: %vendor
|
|
|
|
|
|
|
|
|
|
Name: %{pren}-%{mname}
|
|
|
|
|
Summary: %{mname} module for perl
|
|
|
|
|
Version: %{ver}
|
|
|
|
|
Release: %{rel}
|
|
|
|
|
License: artistic
|
|
|
|
|
Group: Applications/CPAN
|
|
|
|
|
Url: http://www.cpan.org
|
|
|
|
|
Source0: %{mname}-%{version}.tar.gz
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
BuildRequires: perl
|
|
|
|
|
#BuildRequires: perl(Module::Build)
|
|
|
|
|
BuildRequires: perl(Class::ISA) >= 0.32
|
|
|
|
|
BuildRequires: perl(Scalar::Util) >= 1.00
|
|
|
|
|
BuildRequires: perl(Test::More) >= 0.40
|
|
|
|
|
Requires: perl = %{perl_version}
|
|
|
|
|
Requires: perl(Class::ISA) >= 0.32
|
|
|
|
|
Requires: perl(Scalar::Util) >= 1.00
|
|
|
|
|
Provides: Class::Observable
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%description
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%{mname} module for perl
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
Throughout this documentation we refer to an 'observed item' or 'observable item'.
|
|
|
|
|
This ambiguity refers to the fact that both a class and an object can be observed.
|
|
|
|
|
The behavior when notifying observers is identical. The only difference comes in
|
|
|
|
|
which observers are notified.
|
|
|
|
|
(See "Observable Classes and Objects" for more information.)
|
|
|
|
|
|
|
|
|
|
Author: Chris Winters <chris@cwinters.com>
|
|
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%prep
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%setup -q -n %{mname}-%{version}
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%build
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL
|
|
|
|
|
%{__make}
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
%{__make} test
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%install
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%perl_make_install
|
|
|
|
|
%perl_process_packlist
|
|
|
|
|
|
|
|
|
|
FILES_FILE=%{mname}-%{version}-filelist
|
|
|
|
|
[ %{mcnt} -eq 1 ] && {
|
|
|
|
|
cat > $FILES_FILE << EOF
|
|
|
|
|
%dir %{perl_vendorarch}/auto/%{mpath}
|
|
|
|
|
EOF
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ %{mcnt} -gt 1 ] && {
|
|
|
|
|
dir_nm=(`echo %{mname} | sed -e "s,-, ,g"`)
|
|
|
|
|
ffind="${RPM_BUILD_ROOT}%{perl_vendorarch}/auto/"
|
|
|
|
|
perl_dir=%{perl_vendorarch}/auto/
|
|
|
|
|
i=0
|
|
|
|
|
while [ $i -lt %{mcnt} ]; do
|
|
|
|
|
if [ -d ${ffind}/${dir_nm[$i]} ]; then
|
|
|
|
|
cat >> $FILES_FILE << EOF
|
|
|
|
|
%dir ${perl_dir}/${dir_nm[$i]}
|
|
|
|
|
EOF
|
|
|
|
|
fi
|
|
|
|
|
ffind=${ffind}/${dir_nm[$i]}
|
|
|
|
|
perl_dir=${perl_dir}/${dir_nm[$i]}
|
|
|
|
|
i=$[$i+1]
|
|
|
|
|
done
|
|
|
|
|
cat >> $FILES_FILE << EOF
|
|
|
|
|
${perl_dir}
|
|
|
|
|
EOF
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%clean
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && %{__rm} -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%files -f %{mname}-%{version}-filelist
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%doc Changes README
|
|
|
|
|
%{_mandir}/man?/*
|
|
|
|
|
%{perl_vendorlib}/%{fname}
|
|
|
|
|
/var/adm/perl-modules/%{name}
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
%changelog
|
|
|
|
|
#----------------------------------------------------------------------------------
|
|
|
|
|
* Sun Feb 03 2008 - rpm@scorpio-it.net - 1.04
|
|
|
|
|
- first run
|