!1 package init

Merge pull request !1 from jackie_wu123/master
This commit is contained in:
openeuler-ci-bot 2020-08-21 15:02:13 +08:00 committed by Gitee
commit 1d94b90639
4 changed files with 64 additions and 0 deletions

49
nodejs-os-homedir.spec Normal file
View File

@ -0,0 +1,49 @@
%{?nodejs_find_provides_and_requires}
%global packagename os-homedir
%global enable_tests 0
Name: nodejs-os-homedir
Version: 1.0.1
Release: 1
Summary: An io.js 2.3.0 os.homedir() ponyfill
License: MIT
URL: https://github.com/sindresorhus/os-homedir
Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
Source1: https://raw.githubusercontent.com/sindresorhus/os-homedir/v%{version}/test.js
ExclusiveArch: %{nodejs_arches} noarch
BuildArch: noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: ava
%endif
Requires: nodejs
%description
An io.js 2.3.0 os.homedir() ponyfill
%prep
%setup -q -n package
cp -p %{SOURCE1} .
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
cp -pr package.json index.js \
%{buildroot}%{nodejs_sitelib}/%{packagename}
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%__nodejs test.js
%endif
%files
%{!?_licensedir:%global license %doc}
%doc *.md
%license license
%{nodejs_sitelib}/%{packagename}
%changelog
* Mon Aug 17 2020 wutao <wutao61@huawei.com> - 1.0.1-1
- Package init

4
nodejs-os-homedir.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: sindresorhus/os-homedir
tag_prefix: "^v"
seperator: "."

BIN
os-homedir-1.0.1.tgz Normal file

Binary file not shown.

11
test.js Normal file
View File

@ -0,0 +1,11 @@
'use strict';
var test = require('ava');
var pathExists = require('path-exists');
var osHomedir = require('./');
test(function (t) {
var homeDir = osHomedir();
t.assert(homeDir.length > 0);
t.assert(pathExists.sync(homeDir));
t.end();
});