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 URL: http://search.cpan.org/dist/JavaScript-Minifier/
18 BuildRequires: perl-devel >= 1:5.8.0
19 BuildRequires: rpm-perlprov >= 4.1-13
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
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.
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.
44 %setup -q -n %{pdir}-%{pnam}-%{version}
47 %{__perl} Makefile.PL \
51 %{?with_tests:%{__make} test}
54 rm -rf $RPM_BUILD_ROOT
55 %{__make} pure_install \
56 DESTDIR=$RPM_BUILD_ROOT
59 rm -rf $RPM_BUILD_ROOT
62 %defattr(644,root,root,755)
64 %{perl_vendorlib}/JavaScript/*.pm