3 %bcond_without tests # do not perform "make test"
5 %define pdir JavaScript
7 %include /usr/lib/rpm/macros.perl
8 Summary: JavaScript::Minifier - Perl extension for minifying JavaScript code
9 Name: perl-JavaScript-Minifier
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
16 # Source0-md5: 63f58ce5929780e3bd5273eeadd56b25
17 # generic URL, check or change before uncommenting
18 #URL: http://search.cpan.org/dist/JavaScript-Minifier/
19 BuildRequires: perl-devel >= 1:5.8.0
20 BuildRequires: rpm-perlprov >= 4.1-13
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 This module removes unnecessary whitespace from JavaScript code. The
28 primary requirement developing this module is to not break working
29 code: if working JavaScript is in input then working JavaScript is
30 output. It is ok if the input has missing semi-colons, snips like '++
31 +' or '12 .toString()', for example. Internet Explorer conditional
32 comments are copied to the output but the code inside these comments
35 The ECMAScript specifications allow for many different whitespace
36 characters: space, horizontal tab, vertical tab, new line, carriage
37 return, form feed, and paragraph separator. This module understands
38 all of these as whitespace except for vertical tab and paragraph
39 separator. These two types of whitespace are not minimized.
41 For static JavaScript files, it is recommended that you minify during
42 the build stage of web deployment. If you minify on-the-fly then it
43 might be a good idea to cache the minified file. Minifying static
44 files on-the-fly repeatedly is wasteful.
47 %setup -q -n %{pdir}-%{pnam}-%{version}
50 %{__perl} Makefile.PL \
54 %{?with_tests:%{__make} test}
57 rm -rf $RPM_BUILD_ROOT
59 %{__make} pure_install \
60 DESTDIR=$RPM_BUILD_ROOT
63 rm -rf $RPM_BUILD_ROOT
66 %defattr(644,root,root,755)
68 %{perl_vendorlib}/JavaScript/*.pm