]>
Commit | Line | Data |
---|---|---|
0ccee64d | 1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
7dbf3cfc | 4 | |
0ccee64d | 5 | %define pdir JavaScript |
6 | %define pnam Minifier | |
7 | %include /usr/lib/rpm/macros.perl | |
8 | Summary: JavaScript::Minifier - Perl extension for minifying JavaScript code | |
0ccee64d | 9 | Name: perl-JavaScript-Minifier |
a66b9798 | 10 | Version: 1.09 |
0ccee64d | 11 | Release: 1 |
12 | # same as perl | |
13 | License: GPL v1+ or Artistic | |
14 | Group: Development/Languages/Perl | |
15 | Source0: http://www.cpan.org/modules/by-module/JavaScript/%{pdir}-%{pnam}-%{version}.tar.gz | |
a66b9798 | 16 | # Source0-md5: 63f58ce5929780e3bd5273eeadd56b25 |
7dbf3cfc | 17 | URL: http://search.cpan.org/dist/JavaScript-Minifier/ |
0ccee64d | 18 | BuildRequires: perl-devel >= 1:5.8.0 |
19 | BuildRequires: rpm-perlprov >= 4.1-13 | |
0ccee64d | 20 | BuildArch: noarch |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
22 | ||
23 | %description | |
a66b9798 AM |
24 | This module removes unnecessary whitespace from JavaScript code. The |
25 | primary requirement developing this module is to not break working | |
26 | code: if working JavaScript is in input then working JavaScript is | |
27 | output. It is ok if the input has missing semi-colons, snips like '++ | |
28 | +' or '12 .toString()', for example. Internet Explorer conditional | |
29 | comments are copied to the output but the code inside these comments | |
30 | will not be minified. | |
0ccee64d | 31 | |
a66b9798 AM |
32 | The ECMAScript specifications allow for many different whitespace |
33 | characters: space, horizontal tab, vertical tab, new line, carriage | |
34 | return, form feed, and paragraph separator. This module understands | |
35 | all of these as whitespace except for vertical tab and paragraph | |
36 | separator. These two types of whitespace are not minimized. | |
0ccee64d | 37 | |
a66b9798 AM |
38 | For static JavaScript files, it is recommended that you minify during |
39 | the build stage of web deployment. If you minify on-the-fly then it | |
40 | might be a good idea to cache the minified file. Minifying static | |
41 | files on-the-fly repeatedly is wasteful. | |
0ccee64d | 42 | |
43 | %prep | |
44 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
45 | ||
46 | %build | |
47 | %{__perl} Makefile.PL \ | |
48 | INSTALLDIRS=vendor | |
49 | %{__make} | |
50 | ||
51 | %{?with_tests:%{__make} test} | |
52 | ||
53 | %install | |
54 | rm -rf $RPM_BUILD_ROOT | |
0ccee64d | 55 | %{__make} pure_install \ |
56 | DESTDIR=$RPM_BUILD_ROOT | |
57 | ||
58 | %clean | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | ||
61 | %files | |
62 | %defattr(644,root,root,755) | |
63 | %doc Changes README | |
64 | %{perl_vendorlib}/JavaScript/*.pm | |
65 | %{_mandir}/man3/* |