Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > 61ca6cdf2221b2f7c974404c1dcbd06e > files > 2

uglify-js-2.4.24-3.mga5.src.rpm

%{?nodejs_find_provides_and_requires}

#enable/disable tests in case the deps aren't there
%global enable_tests 0

%global installdir  %{_datadir}/javascript

Name:           uglify-js
Version:        2.4.24
Release:        %mkrel 3
Summary:        JavaScript parser, mangler/compressor and beautifier toolkit
BuildArch:      noarch

Group:          Development/Other
#no license file included; BSD license in source header
License:        BSD
URL:            https://github.com/mishoo/UglifyJS2
Source0:        http://registry.npmjs.org/uglify-js/-/UglifyJS2-%{version}.tar.gz
Patch0:         yargs-version.patch
BuildArch:  noarch

Provides:       nodejs-uglify-js = %{version}-%{release}

BuildRequires:  nodejs-packaging

%if 0%{?enable_tests}
BuildRequires:  npm(async)
BuildRequires:  npm(optimist)
BuildRequires:  npm(source-map)
%endif

Requires: js-uglify = %{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 -n js-uglify
Summary: JavaScript parser, mangler/compressor and beautifier toolkit - core library
Group: Development/Other

Obsoletes: uglify-js-common < 2.2.5-4
Provides: uglify-js-common = %{version}-%{release}

%description -n js-uglify
JavaScript parser, mangler/compressor and beautifier toolkit.

This package ships a JavaScript library suitable for use by any JavaScript
runtime.

%prep
%setup -q -n UglifyJS2-%{version}


%nodejs_fixdep optimist 0.4.x
%nodejs_fixdep yargs ^3.28.x
%nodejs_fixdep source-map ^0.5.x

%build
#nothing to do

%install
mkdir -p %{buildroot}%{installdir}/%{name}-2
cp -pr lib/* %{buildroot}%{installdir}/%{name}-2
ln -sf %{name}-2 %{buildroot}%{installdir}/%{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 %{installdir}/%{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

%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

%pretrans -n js-uglify -p <lua>
st = posix.stat("%{_datadir}/%{name}")
if st and st.type == "directory" then
  os.execute("rm -rf %{_datadir}/%{name}")
end

%files
%{nodejs_sitelib}/uglify-js
%{nodejs_sitelib}/uglify-js@2
%{_bindir}/uglifyjs

%files -n js-uglify
%doc LICENSE README.md
%{installdir}/%{name}-2
%{installdir}/%{name}
%{_datadir}/%{name}
%doc LICENSE README.md



%changelog
* Thu Nov 05 2015 spuhler <spuhler> 2.4.24-3.mga5
+ Revision: 898028
- fixed deps
- removed vers. patch and put the change into the spec file
- added yargs-version.patch
- upgrade to vers. 2.4.24
  * this fixes Bug 16643

* Wed Oct 15 2014 umeabot <umeabot> 2.4.13-4.mga5
+ Revision: 748755
- Second Mageia 5 Mass Rebuild

* Fri Sep 26 2014 tv <tv> 2.4.13-3.mga5
+ Revision: 725271
- rebuild for bogus file deps

* Tue Sep 16 2014 umeabot <umeabot> 2.4.13-2.mga5
+ Revision: 690027
- Mageia 5 Mass Rebuild

* Wed Jul 23 2014 joequant <joequant> 2.4.13-1.mga5
+ Revision: 655966
- fix category
- imported package uglify-js