port to new JS guidelines

- provide the nodejs- form
epel9
T.C. Hollingsworth 11 years ago
parent 22cd933752
commit 8f5c5b4186

@ -5,7 +5,7 @@
Name: uglify-js
Version: 2.2.5
Release: 3%{?dist}
Release: 4%{?dist}
Summary: JavaScript parser, mangler/compressor and beautifier toolkit
BuildArch: noarch
@ -18,14 +18,17 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
Provides: nodejs-uglify-js = %{version}-%{release}
BuildRequires: nodejs-packaging
BuildRequires: web-assets-devel
%if 0%{?enable_tests}
BuildRequires: npm(optimist)
BuildRequires: npm(source-map)
%endif
Requires: %{name}-common == %{version}-%{release}
Requires: js-uglify = %{version}-%{release}
%description
JavaScript parser, mangler/compressor and beautifier toolkit.
@ -33,11 +36,15 @@ 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
%package -n js-uglify
Summary: JavaScript parser, mangler/compressor and beautifier toolkit - core library
Group: System Environment/Libraries
%description common
Obsoletes: uglify-js-common < 2.2.5-4
Provides: uglify-js-common = %{version}-%{release}
Requires: web-assets-filesystem
%description -n js-uglify
JavaScript parser, mangler/compressor and beautifier toolkit.
This package ships a JavaScript library suitable for use by any JavaScript
@ -54,12 +61,17 @@ runtime.
%install
rm -rf %buildroot
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -pr lib/* %{buildroot}%{_datadir}/%{name}/
mkdir -p %{buildroot}%{_jsdir}/%{name}-2
cp -pr lib/* %{buildroot}%{_jsdir}/%{name}-2
ln -sf %{name}-2 %{buildroot}%{_jsdir}/%{name}
#compat symlink
mkdir -p %{buildroot}%{_datadir}
ln -sf javascript/%{name} %{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
ln -sf %{_jsdir}/%{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
@ -83,18 +95,30 @@ if st and st.type == "directory" then
os.execute("rm -rf %{nodejs_sitelib}/uglify-js")
end
st = posix.stat("%{_datadir}/%{name}")
if st and st.type == "directory" then
os.execute("rm -rf %{_datadir}/%{name}")
end
%files
%defattr(-,root,root,-)
%{nodejs_sitelib}/uglify-js
%{nodejs_sitelib}/uglify-js@2
%{_bindir}/uglifyjs
%files common
%files -n js-uglify
%defattr(-,root,root,-)
%{_jsdir}/%{name}-2
%{_jsdir}/%{name}
%{_datadir}/%{name}
%doc README.md
%changelog
* Mon Jan 20 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.2.5-4
- port to new JS guidelines
- provide the nodejs- form
* 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

Loading…
Cancel
Save