]>
Commit | Line | Data |
---|---|---|
3b0666be ER |
1 | # |
2 | # Conditional build: | |
3b0666be | 3 | %bcond_without tests # do not perform "make test" |
4dc9d358 | 4 | |
3b0666be ER |
5 | %define pdir File |
6 | %define pnam ShareDir | |
7 | Summary: File::ShareDir - Locate per-dist and per-module shared files | |
3d7fa52c | 8 | Summary(pl.UTF-8): File::ShareDir - położenie plików współdzielonych w dystrybucji i module |
3b0666be | 9 | Name: perl-File-ShareDir |
f6066c64 | 10 | Version: 1.118 |
82cc76ea | 11 | Release: 1 |
3b0666be ER |
12 | # same as perl |
13 | License: GPL v1+ or Artistic | |
14 | Group: Development/Languages/Perl | |
15 | Source0: http://www.cpan.org/modules/by-module/File/%{pdir}-%{pnam}-%{version}.tar.gz | |
f6066c64 | 16 | # Source0-md5: 0084f730f4e3d4d89703d92b3ea82f54 |
82cc76ea JB |
17 | URL: https://metacpan.org/release/File-ShareDir |
18 | BuildRequires: perl-devel >= 1:5.8.1 | |
3b0666be | 19 | BuildRequires: rpm-perlprov >= 4.1-13 |
66525c1f | 20 | BuildRequires: rpmbuild(macros) >= 1.745 |
3d7fa52c | 21 | %if %{with tests} |
82cc76ea JB |
22 | BuildRequires: perl(File::Path) >= 2.08 |
23 | BuildRequires: perl(File::Spec) >= 0.80 | |
3d7fa52c | 24 | BuildRequires: perl-Class-Inspector >= 1.12 |
82cc76ea | 25 | BuildRequires: perl-File-ShareDir-Install >= 0.13 |
3d7fa52c | 26 | BuildRequires: perl-Params-Util >= 0.07 |
82cc76ea | 27 | BuildRequires: perl-Test-Simple >= 0.90 |
3b0666be ER |
28 | %endif |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | The intent of File::ShareDir is to provide a companion to | |
34 | Class::Inspector and File::HomeDir, modules that take a process that | |
35 | is well-known by advanced Perl developers but gets a little tricky, | |
36 | and make it more available to the larger Perl community. | |
37 | ||
38 | Quite often you want or need your Perl module (CPAN or otherwise) to | |
39 | have access to a large amount of read-only data that is stored on the | |
40 | file-system at run-time. | |
41 | ||
3d7fa52c | 42 | On a Linux-like system, this would be in a place such as /usr/share, |
3b0666be ER |
43 | however Perl runs on a wide variety of different systems, and so the |
44 | use of any one location is unreliable. | |
45 | ||
46 | Perl provides a little-known method for doing this, but almost nobody | |
47 | is aware that it exists. As a result, module authors often go through | |
48 | some very strange ways to make the data available to their code. | |
49 | ||
3d7fa52c JB |
50 | %description -l pl.UTF-8 |
51 | Celem File::ShareDir jest zapewnienie modułu towarzyszącego modułom | |
52 | Class::Inspector oraz File::HomeDir (wykonujących zadania dobrze znane | |
53 | zaawansowanym programistom Perla, ale wymagających sztuczek), będącego | |
54 | bardziej przystępnym dla społeczności Perla. | |
55 | ||
56 | Często istnieje potrzeba, aby moduł Perla (z CPAN lub innego źródła) | |
57 | miał dostęp do dużych ilości danych tylko do odczytu, przechowywanych | |
58 | w systemie plików. | |
59 | ||
60 | Na systemach linuksowych takie dane zwykle znajdują się miejscu typu | |
61 | /usr/share, ale Perla działa na wielu różnych systemach i użycie | |
62 | jednego miejsca nie jest wiarygodne. | |
63 | ||
64 | Perl udostępnia w takim celu mało znaną metodę, ale mało kto o niej | |
65 | wie. W efekcie autorzy modułów w różny dziwny sposób sprawiają, by ich | |
66 | dane były dostępne dla kodu. | |
3b0666be ER |
67 | |
68 | %prep | |
69 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
70 | ||
71 | %build | |
72 | %{__perl} Makefile.PL \ | |
73 | INSTALLDIRS=vendor | |
74 | %{__make} | |
75 | ||
76 | %{?with_tests:%{__make} test} | |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %{__make} pure_install \ | |
82 | DESTDIR=$RPM_BUILD_ROOT | |
83 | ||
82cc76ea JB |
84 | %{__rm} $RPM_BUILD_ROOT%{perl_vendorlib}/auto/share/{dist/File-ShareDir/{sample.txt,subdir/sample.txt},module/File-ShareDir/test_file.txt} |
85 | ||
3b0666be ER |
86 | %clean |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %files | |
90 | %defattr(644,root,root,755) | |
82cc76ea | 91 | %doc Changes README.md |
3d7fa52c | 92 | %{perl_vendorlib}/File/ShareDir.pm |
3d7fa52c JB |
93 | %dir %{perl_vendorlib}/auto/share/module |
94 | %{_mandir}/man3/File::ShareDir.3pm* |