]> git.pld-linux.org Git - SPECS.git/blob - perl-aliased.spec
SPECS updated Mon 29 Apr 22:05:02 CEST 2024
[SPECS.git] / perl-aliased.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # do not perform "make test"
4
5 %define pdir    aliased
6 Summary:        aliased - use shorter versions of class names
7 Summary(pl.UTF-8):      aliased - używanie krótszych wersji nazw klas
8 Name:           perl-aliased
9 Version:        0.34
10 Release:        1
11 # same as perl
12 License:        GPL v1+ or Artistic
13 Group:          Development/Languages/Perl
14 Source0:        https://www.cpan.org/modules/by-authors/id/E/ET/ETHER/%{pdir}-%{version}.tar.gz
15 # Source0-md5:  f7f659f689699a87115da1262eb6edc6
16 URL:            https://metacpan.org/dist/aliased
17 BuildRequires:  perl-Module-Build-Tiny >= 0.039
18 BuildRequires:  perl-devel >= 1:5.8.0
19 BuildRequires:  rpm-perlprov >= 4.1-13
20 BuildRequires:  rpmbuild(macros) >= 1.745
21 %if %{with tests}
22 BuildRequires:  perl-Test-Simple
23 %endif
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 aliased is simple in concept but is a rather handy module. It loads
29 the class you specify and exports into your namespace a subroutine
30 that returns the class name. You can explicitly alias the class to
31 another name or, if you prefer, you can do so implicitly. In the
32 latter case, the name of the subroutine is the last part of the class
33 name. Thus, it does something similar to the following:
34
35   #use aliased 'Some::Annoyingly::Long::Module::Name::Customer';
36
37   use Some::Annoyingly::Long::Module::Name::Customer;
38   sub Customer {
39     return 'Some::Annoyingly::Long::Module::Name::Customer';
40   }
41   my $cust = Customer->new;
42
43 This module is useful if you prefer a shorter name for a class. It's
44 also handy if a class has been renamed.
45
46 %description -l pl.UTF-8
47 aliased jest prostym w założeniach, ale dosyć poręcznym modułem.
48 Ładuje podaną klasę i eksportuje do przestrzeni nazw funkcję
49 zwracającą nazwę tej klasy. Można nadać klasie alias jawnie lub
50 domyślnie - w drugim przypadku nazwa funkcji będzie ostatnią częścią
51 nazwy klasy. Czyli robi to coś podobnego do:
52
53   #use aliased 'Jakas::Strasznie::Dluga::Nazwa::Modulu::Customer';
54
55   use Jakas::Strasznie::Dluga::Nazwa::Modulu::Customer;
56   sub Customer {
57     return 'Jakas::Strasznie::Dluga::Nazwa::Modulu::Customer';
58   }
59   my $cust = Customer->new;
60
61 Ten moduł jest przydatny, kiedy wolimy mieć klasę dostępną pod krótszą
62 nazwą, a także w przypadku, kiedy nazwa klasy została zmieniona.
63
64 %prep
65 %setup -q -n %{pdir}-%{version}
66
67 %build
68 %{__perl} Makefile.PL \
69         INSTALLDIRS=vendor
70 %{__make}
71 %{?with_tests:%{__make} test}
72
73 %install
74 rm -rf $RPM_BUILD_ROOT
75 %{__make} pure_install \
76         DESTDIR=$RPM_BUILD_ROOT
77
78 %clean
79 rm -rf $RPM_BUILD_ROOT
80
81 %files
82 %defattr(644,root,root,755)
83 %doc Changes README
84 %{perl_vendorlib}/aliased.pm
85 %{_mandir}/man3/aliased.3pm*
This page took 0.772485 seconds and 3 git commands to generate.