3 %bcond_without tests # do not perform "make test"
5 %define pdir JavaScript
7 Summary: JavaScript::Minifier - Perl extension for minifying JavaScript code
8 Name: perl-JavaScript-Minifier
12 License: GPL v1+ or Artistic
13 Group: Development/Languages/Perl
14 Source0: http://www.cpan.org/modules/by-module/JavaScript/%{pdir}-%{pnam}-%{version}.tar.gz
15 # Source0-md5: 91e4cf0a4f5e317d5a5a8cf6d55700ac
16 URL: http://search.cpan.org/dist/JavaScript-Minifier/
17 BuildRequires: perl-devel >= 1:5.8.0
18 BuildRequires: rpm-perlprov >= 4.1-13
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 This module removes unnecessary whitespace from JavaScript code. The
24 primary requirement developing this module is to not break working
25 code: if working JavaScript is in input then working JavaScript is
26 output. It is ok if the input has missing semi-colons, snips like '++
27 +' or '12 .toString()', for example. Internet Explorer conditional
28 comments are copied to the output but the code inside these comments
31 The ECMAScript specifications allow for many different whitespace
32 characters: space, horizontal tab, vertical tab, new line, carriage
33 return, form feed, and paragraph separator. This module understands
34 all of these as whitespace except for vertical tab and paragraph
35 separator. These two types of whitespace are not minimized.
37 For static JavaScript files, it is recommended that you minify during
38 the build stage of web deployment. If you minify on-the-fly then it
39 might be a good idea to cache the minified file. Minifying static
40 files on-the-fly repeatedly is wasteful.
43 %setup -q -n %{pdir}-%{pnam}-%{version}
46 %{__perl} Makefile.PL \
50 %{?with_tests:%{__make} test}
53 rm -rf $RPM_BUILD_ROOT
54 %{__make} pure_install \
55 DESTDIR=$RPM_BUILD_ROOT
58 rm -rf $RPM_BUILD_ROOT
61 %defattr(644,root,root,755)
63 %{perl_vendorlib}/JavaScript/*.pm