#enable/disable tests in case the deps aren't there %global enable_tests 0 Name: uglify-js1 Version: 1.3.4 Release: 1%{?dist} Summary: JavaScript parser, mangler/compressor and beautifier toolkit BuildArch: noarch Group: Development/Tools # BSD license in README.html License: BSD URL: https://github.com/mishoo/UglifyJS Source0: http://registry.npmjs.org/uglify-js/-/uglify-js-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: nodejs-devel %if 0%{?enable_tests} BuildRequires: npm(nodeunit) %endif Requires: %{name}-common == %{version}-%{release} %description JavaScript parser, mangler/compressor and beautifier toolkit. This is the classic 1.x version of uglify-js. Consider using the new version provided in the uglify-js package. This package ships the uglifyjs command-line tool and a library suitable for use within Node.js. %package common Summary: JavaScript parser, mangler/compressor and beautifier toolkit - core library Group: System Environment/Libraries %description common JavaScript parser, mangler/compressor and beautifier toolkit. This is the classic 1.x version of uglify-js. Consider using the new version provided in the uglify-js package. This package ships a JavaScript library suitable for use by any JavaScript runtime. %prep %setup -q -n package %build #nothing to do %install rm -rf %buildroot mkdir -p %{buildroot}%{_datadir}/%{name} cp -pr lib/* %{buildroot}%{_datadir}/%{name}/ mkdir -p %{buildroot}%{nodejs_sitelib}/%{name} cp -pr bin package.json uglify-js.js %{buildroot}%{nodejs_sitelib}/%{name} ln -sf %{_datadir}/%{name} %{buildroot}%{nodejs_sitelib}/%{name}/lib mkdir -p %{buildroot}%{_bindir} ln -sf ../lib/node_modules/uglify-js1/bin/uglifyjs %{buildroot}%{_bindir}/uglifyjs1 #nodejs-symlink-deps is not called because this package does not have any #dependencies and can be used outside of node %if 0%{?enable_tests} %check nodeunit test/unit/scripts.js && test/testparser.js && test/testconsolidator.js %endif %clean rm -rf %buildroot %files %defattr(-,root,root,-) %{nodejs_sitelib}/%{name} %{_bindir}/uglifyjs1 %files common %defattr(-,root,root,-) %{_datadir}/%{name} %doc README.html README.org docstyle.css %changelog * Fri Feb 01 2013 T.C. Hollingsworth - 1.3.4 - initial package based on the uglify-js (2.x) pacakge