The package rpms/nodejs-get-pkg-repo.git has added or updated architecture specific
content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/nodejs-get-pkg-repo.git/commit/?i....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit a5d6705cd9f60e5469308b21e7a4b7c976af7b71
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Wed May 24 18:38:38 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..50546aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/get-pkg-repo-1.3.0.tgz
diff --git a/LICENSE-MIT b/LICENSE-MIT
new file mode 100644
index 0000000..0127a3a
--- /dev/null
+++ b/LICENSE-MIT
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/nodejs-get-pkg-repo.spec b/nodejs-get-pkg-repo.spec
new file mode 100644
index 0000000..d32ad42
--- /dev/null
+++ b/nodejs-get-pkg-repo.spec
@@ -0,0 +1,68 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename get-pkg-repo
+%global enable_tests 1
+
+Name: nodejs-get-pkg-repo
+Version: 1.3.0
+Release: 1%{?dist}
+Summary: Get normalized repository from package json data
+
+License: MIT
+URL:
https://github.com/stevemao/get-pkg-repo
+Source0:
https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
+# The test files are not included in the npm tarball.
+Source1:
https://raw.githubusercontent.com/stevemao/get-pkg-repo/v%{version}/test.js
+Source2: LICENSE-MIT
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(parse-github-repo-url)
+%if 0%{?enable_tests}
+BuildRequires: mocha
+BuildRequires: npm(hosted-git-info)
+BuildRequires: npm(normalize-package-data)
+
+%endif
+
+%description
+Get normalized repository from package json data
+
+
+%prep
+%autosetup -n package
+# setup the tests
+cp -p %{SOURCE1} .
+cp -p %{SOURCE2} .
+
+sed -i '1s/env //' cli.js
+
+%build
+# nothing to do!
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
+cp -pr package.json typos.json index.js cli.js \
+ %{buildroot}%{nodejs_sitelib}/%{packagename}
+
+%nodejs_symlink_deps
+
+%check
+%nodejs_symlink_deps --check
+%{__nodejs} -e 'require("./")'
+%if 0%{?enable_tests}
+%{_bindir}/mocha -R spec
+%else
+%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
+%endif
+
+%files
+%doc README.md
+%license LICENSE-MIT
+%{nodejs_sitelib}/%{packagename}
+
+%changelog
+* Sun May 7 2017 Jared Smith <jsmith(a)fedoraproject.org> - 1.3.0-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..2abb969 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (get-pkg-repo-1.3.0.tgz) =
31ff32a410d4da9bbf1f26dab96c7c11fb760c9180d48796cb7c2760ff7916727594fc95a8130c2b3b45ac279dd8fbeade95ae3dbcef3066437b4ee9a7fe5507
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..3fbda0c
--- /dev/null
+++ b/test.js
@@ -0,0 +1,185 @@
+'use strict';
+var assert = require('assert');
+var getPkgRepo = require('./');
+var parse = function(url, fix) {
+ return getPkgRepo({
+ repository: {url: url}
+ }, fix);
+};
+
+var assertRepo = function(repo, expected) {
+ assert.strictEqual(repo.browse(), expected.browse);
+ assert.strictEqual(repo.domain, expected.domain);
+ assert.strictEqual(repo.type, expected.type);
+ assert.strictEqual(repo.user, expected.user);
+ assert.strictEqual(repo.project, expected.project);
+};
+
+it('should parse github http', function() {
+ var repo =
parse('http://github.com/a/b');
+ assertRepo(repo, {
+ browse: 'https://github.com/a/b',
+ domain: 'github.com',
+ type: 'github',
+ user: 'a',
+ project: 'b'
+ });
+});
+
+it('should parse github https', function() {
+ var repo =
parse('https://github.com/a/b');
+ assertRepo(repo, {
+ browse: 'https://github.com/a/b',
+ domain: 'github.com',
+ type: 'github',
+ user: 'a',
+ project: 'b'
+ });
+});
+
+it('should parse github ssh', function() {
+ var repo = parse('git@github.com:joyent/node.git');
+ assertRepo(repo, {
+ browse: 'https://github.com/joyent/node',
+ domain: 'github.com',
+ type: 'github',
+ user: 'joyent',
+ project: 'node'
+ });
+});
+
+it('should parse private gitlab ssh', function() {
+ var repo = parse('git@gitlab.team.com:username/test.git');
+ assertRepo(repo, {
+ browse: 'https://gitlab.team.com/username/test',
+ domain: 'gitlab.team.com',
+ type: 'gitlab',
+ user: 'username',
+ project: 'test'
+ });
+});
+
+it('should parse github short', function() {
+ var repo = parse('a/b');
+ assertRepo(repo, {
+ browse: 'https://github.com/a/b',
+ domain: 'github.com',
+ type: 'github',
+ user: 'a',
+ project: 'b'
+ });
+});
+
+it('should parse bitbucket', function() {
+ var repo =
parse('https://bitbucket.org/a/b.git');
+ assertRepo(repo, {
+ browse: 'https://bitbucket.org/a/b',
+ domain: 'bitbucket.org',
+ type: 'bitbucket',
+ user: 'a',
+ project: 'b'
+ });
+});
+
+it('should parse svn', function() {
+ var repo = parse('svn://a/b');
+ assertRepo(repo, {
+ browse: 'http://a/b',
+ domain: 'a'
+ });
+});
+
+it('should parse https', function() {
+ var repo = parse('https://a/b');
+ assertRepo(repo, {
+ browse: 'https://a/b',
+ domain: 'a'
+ });
+});
+
+it('should parse a url with an @', function() {
+ var repo = parse('a(a)b.com');
+ assertRepo(repo, {
+ browse: 'http://a@b.com'
+ });
+});
+
+it('should fix bad protocal', function() {
+ var repo = parse('badprotocol://a/b');
+ assertRepo(repo, {
+ browse: 'http://a/b',
+ domain: 'a'
+ });
+});
+
+it('should work with a json', function() {
+ var jsonData = JSON.stringify({
+ repository: {
+ url: 'http://github.com/a/b'
+ }
+ });
+ var repo = getPkgRepo(jsonData);
+ assertRepo(repo, {
+ browse: 'https://github.com/a/b',
+ domain: 'github.com',
+ type: 'github',
+ user: 'a',
+ project: 'b'
+ });
+});
+
+it('should work if there is a typo', function() {
+ var repo = getPkgRepo({repo: 'a/b'}, true);
+ assertRepo(repo, {
+ browse: 'https://github.com/a/b',
+ domain: 'github.com',
+ type: 'github',
+ user: 'a',
+ project: 'b'
+ });
+});
+
+it('should error if cannot get repository', function() {
+ assert.throws(function() {
+ getPkgRepo({});
+ });
+});
+
+it('should parse github enterprise http url', function() {
+ var url = 'http://github.mycompany.dev/user/myRepo';
+ var repo = parse(url);
+ assertRepo(repo, {
+ browse: 'http://github.mycompany.dev/user/myRepo',
+ domain: 'github.mycompany.dev',
+ user: 'user',
+ project: 'myRepo',
+ type: 'github'
+ });
+});
+
+it('should parse simple unknown host', function() {
+ var url = 'https://unknown-host/';
+ var repo = parse(url);
+ assertRepo(repo, {
+ browse: 'https://unknown-host',
+ domain: 'unknown-host'
+ });
+});
+
+it('should parse complex unknown host', function() {
+ var url =
'https://stash.local/scm/conventional-changelog/conventional-changelog.git';
+ var repo = parse(url);
+ assertRepo(repo, {
+ browse:
'https://stash.local/scm/conventional-changelog/conventional-changelog',
+ domain: 'stash.local'
+ });
+});
+
+it('should parse weird unknown host', function() {
+ var url = 'https://unknown-host/.git';
+ var repo = parse(url);
+ assertRepo(repo, {
+ browse: 'https://unknown-host',
+ domain: 'unknown-host'
+ });
+});