64 lines
1.8 KiB
RPMSpec
64 lines
1.8 KiB
RPMSpec
|
|
%{?nodejs_find_provides_and_requires}
|
||
|
|
%global enable_tests 1
|
||
|
|
Name: nodejs-shelljs
|
||
|
|
Version: 0.7.3
|
||
|
|
Release: 1
|
||
|
|
Summary: Portable Unix shell commands for Node.js
|
||
|
|
License: BSD and MIT
|
||
|
|
URL: http://github.com/arturadib/shelljs
|
||
|
|
Source0: http://registry.npmjs.org/shelljs/-/shelljs-%{version}.tgz
|
||
|
|
#git clone http://github.com/arturadib/shelljs
|
||
|
|
#cd shelljs
|
||
|
|
#git archive --prefix="test/" --format=tar tags/v%{version}:test/ | bzip2 > tests-%{version}.tar.bz2
|
||
|
|
Source1: tests-%{version}.tar.bz2
|
||
|
|
Patch0: nodejs-shelljs_fix-tests.patch
|
||
|
|
BuildArch: noarch
|
||
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
||
|
|
BuildRequires: nodejs-packaging
|
||
|
|
%if 0%{?enable_tests}
|
||
|
|
BuildRequires: coffee-script npm(glob)
|
||
|
|
%endif
|
||
|
|
%description
|
||
|
|
%{summary}.
|
||
|
|
|
||
|
|
%prep
|
||
|
|
%setup -q -n package
|
||
|
|
%setup -q -T -D -a 1 -n package
|
||
|
|
%patch0 -p1
|
||
|
|
sed -i '1s/env //' bin/shjs
|
||
|
|
%nodejs_fixdep glob
|
||
|
|
|
||
|
|
%build
|
||
|
|
|
||
|
|
%install
|
||
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/shelljs
|
||
|
|
cp -pr package.json global.js make.js shell.js src/ \
|
||
|
|
%{buildroot}%{nodejs_sitelib}/shelljs
|
||
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/shelljs/bin
|
||
|
|
install -p -m0755 bin/shjs \
|
||
|
|
%{buildroot}%{nodejs_sitelib}/shelljs/bin
|
||
|
|
mkdir -p %{buildroot}%{_bindir}
|
||
|
|
ln -sf %{nodejs_sitelib}/shelljs/bin/shjs \
|
||
|
|
%{buildroot}%{_bindir}/shjs
|
||
|
|
%nodejs_symlink_deps
|
||
|
|
|
||
|
|
%check
|
||
|
|
%nodejs_symlink_deps --check
|
||
|
|
%{__nodejs} -e 'require("./")'
|
||
|
|
%if 0%{?enable_tests}
|
||
|
|
%__nodejs scripts/run-tests
|
||
|
|
%else
|
||
|
|
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
|
||
|
|
%endif
|
||
|
|
|
||
|
|
%files
|
||
|
|
%{!?_licensedir:%global license %doc}
|
||
|
|
%license LICENSE
|
||
|
|
%doc README.md MAINTAINERS
|
||
|
|
%{nodejs_sitelib}/shelljs
|
||
|
|
%{_bindir}/shjs
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Fri Aug 21 2020 wangyue <wangyue92@huawei.com> - 0.7.3-1
|
||
|
|
- package init
|