You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
uglify-js/uglify-js.spec

137 lines
3.8 KiB

%{?nodejs_find_provides_and_requires}
#enable/disable tests in case the deps aren't there
%global enable_tests 1
Name: uglify-js
Version: 2.2.5
Release: 3%{?dist}
Summary: JavaScript parser, mangler/compressor and beautifier toolkit
BuildArch: noarch
Group: Development/Tools
#no license file included; BSD license in source header
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-packaging
%if 0%{?enable_tests}
BuildRequires: npm(optimist)
BuildRequires: npm(source-map)
%endif
Requires: %{name}-common == %{version}-%{release}
%description
JavaScript parser, mangler/compressor and beautifier toolkit.
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 package ships a JavaScript library suitable for use by any JavaScript
runtime.
%prep
%setup -q -n package
%nodejs_fixdep optimist 0.4.x
%build
#nothing to do
%install
rm -rf %buildroot
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -pr lib/* %{buildroot}%{_datadir}/%{name}/
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@2/bin/uglifyjs %{buildroot}%{_bindir}/uglifyjs
%nodejs_symlink_deps
ln -sf uglify-js@2 %{buildroot}%{nodejs_sitelib}/uglify-js
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%__nodejs test/run-tests.js
%endif
%clean
rm -rf %buildroot
%pretrans -p <lua>
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}/uglify-js
%{nodejs_sitelib}/uglify-js@2
%{_bindir}/uglifyjs
%files common
%defattr(-,root,root,-)
%{_datadir}/%{name}
%doc README.md
%changelog
* Sun Jan 19 2014 Tom Hughes <tom@compton.nu> - 2.2.5-3
- use new multi-version packaging rules
- update to latest nodejs packaging standards
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Tue Apr 16 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.5-1
- new upstream release 2.2.5
* Tue Apr 16 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.4-3
- call nodejs_symlink_deps
- fix optimist dep for 0.4.0
* Wed Feb 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.4-2
- install tools dir
- enable tests
* Wed Feb 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.4-1
- new upstream release 2.2.4
* Fri Feb 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.3-6
- rearrange symlinks so dep generator works
* Fri Feb 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.3-5
- really fix install section
- conditionalize tests
* Thu Jan 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.3-4
- fix install section
* Thu Jan 31 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.3-3
- split off -common subpackage for use with other runtimes
* Fri Jan 18 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.3-2
- BuildRequire deps so tests work
* Tue Jan 08 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.3-1
- initial package generated by npm2rpm