diff --git a/uglify-js.spec b/uglify-js.spec index 7ccb2cb..b0e7770 100644 --- a/uglify-js.spec +++ b/uglify-js.spec @@ -5,7 +5,7 @@ Name: uglify-js Version: 2.2.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: JavaScript parser, mangler/compressor and beautifier toolkit BuildArch: noarch @@ -15,8 +15,10 @@ License: BSD URL: https://github.com/mishoo/UglifyJS2 Source0: http://registry.npmjs.org/uglify-js/-/uglify-js-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch -BuildRequires: nodejs-devel +BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(optimist) @@ -55,29 +57,36 @@ rm -rf %buildroot mkdir -p %{buildroot}%{_datadir}/%{name} cp -pr lib/* %{buildroot}%{_datadir}/%{name}/ -mkdir -p %{buildroot}%{nodejs_sitelib}/%{name} -cp -pr bin tools package.json %{buildroot}%{nodejs_sitelib}/%{name} -ln -sf %{_datadir}/%{name} %{buildroot}%{nodejs_sitelib}/%{name}/lib +mkdir -p %{buildroot}%{nodejs_sitelib}/uglify-js@2 +cp -pr bin tools package.json %{buildroot}%{nodejs_sitelib}/uglify-js@2 +ln -sf %{_datadir}/%{name} %{buildroot}%{nodejs_sitelib}/uglify-js@2/lib mkdir -p %{buildroot}%{_bindir} -ln -sf ../lib/node_modules/uglify-js/bin/uglifyjs %{buildroot}%{_bindir}/uglifyjs +ln -sf ../lib/node_modules/uglify-js@2/bin/uglifyjs %{buildroot}%{_bindir}/uglifyjs %nodejs_symlink_deps +ln -sf uglify-js@2 %{buildroot}%{nodejs_sitelib}/uglify-js + %if 0%{?enable_tests} %check -mkdir -p node_modules -ln -sf %{nodejs_sitelib}/source-map node_modules/source-map -ln -sf %{nodejs_sitelib}/optimist node_modules/optimist +%nodejs_symlink_deps --check %__nodejs test/run-tests.js %endif %clean rm -rf %buildroot +%pretrans -p +st = posix.stat("%{nodejs_sitelib}/uglify-js") +if st and st.type == "directory" then + os.execute("rm -rf %{nodejs_sitelib}/uglify-js") +end + %files %defattr(-,root,root,-) -%{nodejs_sitelib}/%{name} +%{nodejs_sitelib}/uglify-js +%{nodejs_sitelib}/uglify-js@2 %{_bindir}/uglifyjs %files common @@ -86,6 +95,10 @@ rm -rf %buildroot %doc README.md %changelog +* Sun Jan 19 2014 Tom Hughes - 2.2.5-3 +- use new multi-version packaging rules +- update to latest nodejs packaging standards + * Sun Aug 04 2013 Fedora Release Engineering - 2.2.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild