diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..e7c9cff --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +node-agent-base (6.0.2+~cs5.4.2-ok1) yangtze; urgency=medium + + * Build for openKylin. + + -- zhouganqing Fri, 17 Feb 2023 11:06:10 +0800 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..f3e3a5f --- /dev/null +++ b/debian/control @@ -0,0 +1,33 @@ +Source: node-agent-base +Section: javascript +Testsuite: autopkgtest-pkg-nodejs +Priority: optional +Maintainer: OpenKylin Developers +Build-Depends: debhelper-compat (= 13) + , dh-sequence-nodejs + , expect + , mocha + , node-debug (>= 4~) + , node-semver (>= 7~) + , node-types-mocha + , node-typescript + , node-types-node + , openssl +Standards-Version: 4.6.0 +Homepage: https://github.com/TooTallNate/node-agent-base#readme +Vcs-Git: https://gitee.com/openkylin/node-agent-base.git +Vcs-Browser: https://gitee.com/openkylin/node-agent-base +Rules-Requires-Root: no + +Package: node-agent-base +Architecture: all +Depends: ${misc:Depends} + , node-debug + , node-semver +Provides: ${nodejs:Provides} +Description: Turn a function into an http.Agent instance + This module provides an http.Agent generator. That is, you pass it an async + callback function, and it returns a new http.Agent instance that will invoke + the given callback function when sending outbound HTTP requests. + . + Node.js is an event-based server-side JavaScript engine. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..c3d7145 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: node-agent-base +Upstream-Contact: https://github.com/TooTallNate/node-agent-base/issues +Source: https://github.com/TooTallNate/node-agent-base + https://registry.npmjs.org/async-listen + https://registry.npmjs.org/@types/agent-base + +Files: * +Copyright: 2018, Nathan Rajlich (http://n8.io/) +License: Expat + +Files: types-*/* +Copyright: Microsoft Corporation +License: Expat + +Files: debian/* +Copyright: 2018 Per Andersson + 2020 Andrius Merkys + 2021 Vivek K J +License: Expat + +License: Expat + 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/debian/docs b/debian/docs new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.md diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..20097be --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,6 @@ +[DEFAULT] +pristine-tar=True +component=['async-listen', 'types-agent-base'] + +[import-orig] +filter=[ '.gitignore', '.travis.yml', '.git*' ] diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..97b5d75 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +dist/test usr/share/nodejs/agent-base/dist diff --git a/debian/make-snakeoil.exp b/debian/make-snakeoil.exp new file mode 100755 index 0000000..ae5b8de --- /dev/null +++ b/debian/make-snakeoil.exp @@ -0,0 +1,11 @@ +#!/usr/bin/expect -f + +spawn openssl req -new -x509 -days 3650 -nodes -sha256 -out test/ssl-cert-snakeoil.pem -keyout test/ssl-cert-snakeoil.key +send -- "\r" +send -- "\r" +send -- "\r" +send -- "\r" +send -- "\r" +send -- "\r" +send -- "\r" +expect eof diff --git a/debian/nodejs/extcopies b/debian/nodejs/extcopies new file mode 100644 index 0000000..e2546bf --- /dev/null +++ b/debian/nodejs/extcopies @@ -0,0 +1 @@ +@types/debug diff --git a/debian/nodejs/extlinks b/debian/nodejs/extlinks new file mode 100644 index 0000000..5a7e17d --- /dev/null +++ b/debian/nodejs/extlinks @@ -0,0 +1,4 @@ +@types/mocha +@types/ms +@types/node +@types/semver diff --git a/debian/nodejs/root_modules b/debian/nodejs/root_modules new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/debian/nodejs/root_modules @@ -0,0 +1 @@ +* diff --git a/debian/patches/fix-typescript.patch b/debian/patches/fix-typescript.patch new file mode 100644 index 0000000..231bc0f --- /dev/null +++ b/debian/patches/fix-typescript.patch @@ -0,0 +1,34 @@ +Description: ignore typescript ≥ 4.1 regression +Author: Xavier Guimard +Bug-Debian: https://bugs.debian.org/975794 +Forwarded: no +Last-Update: 2021-10-27 + +--- a/src/promisify.ts ++++ b/src/promisify.ts +@@ -24,6 +24,7 @@ + if (err) { + reject(err); + } else { ++ // @ts-ignore + resolve(rtn); + } + } +--- a/test/test.ts ++++ b/test/test.ts +@@ -250,6 +250,7 @@ + await req({ agent, ...info }); + } catch (err) { + gotError = true; ++// @ts-ignore + assert.equal(err.message, 'bad'); + } + +@@ -277,6 +278,7 @@ + await req({ agent, ...info }); + } catch (err) { + gotError = true; ++// @ts-ignore + assert.equal(err.message, 'bad'); + } + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..5c3bffe --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +snakeoil-path.patch +fix-typescript.patch diff --git a/debian/patches/snakeoil-path.patch b/debian/patches/snakeoil-path.patch new file mode 100644 index 0000000..655ae33 --- /dev/null +++ b/debian/patches/snakeoil-path.patch @@ -0,0 +1,13 @@ +--- a/test/test.ts ++++ b/test/test.ts +@@ -27,8 +27,8 @@ + }; + + const sslOptions = { +- key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), +- cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') ++ key: fs.readFileSync('test/ssl-cert-snakeoil.key'), ++ cert: fs.readFileSync('test/ssl-cert-snakeoil.pem') + }; + + function json(res: http.IncomingMessage): Promise { diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..6521d2b --- /dev/null +++ b/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_build: + tsc + +override_dh_clean: + dh_clean + rm -rf dist node_modules diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..4aceb10 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +unapply-patches diff --git a/debian/tests/pkg-js/files b/debian/tests/pkg-js/files new file mode 100644 index 0000000..4199a24 --- /dev/null +++ b/debian/tests/pkg-js/files @@ -0,0 +1,2 @@ +debian/make-snakeoil.exp +test/*.js diff --git a/debian/tests/pkg-js/test b/debian/tests/pkg-js/test new file mode 100644 index 0000000..0716a38 --- /dev/null +++ b/debian/tests/pkg-js/test @@ -0,0 +1,3 @@ +mkdir --parents test +debian/make-snakeoil.exp +mocha --reporter spec dist/test/*.js diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..299cdf0 --- /dev/null +++ b/debian/watch @@ -0,0 +1,15 @@ +version=4 +opts=\ +dversionmangle=auto,\ +filenamemangle=s/.*?(\d[\d\.-]*@ARCHIVE_EXT@)/node-agent-base-$1/ \ + https://github.com/TooTallNate/node-agent-base/releases .*/archive/.*/v?([\d\.]+).tar.gz group + +# It is not recommended use npmregistry. Please investigate more. +# Take a look at https://wiki.debian.org/debian/watch/ +opts="searchmode=plain,ctype=nodejs,component=async-listen,pgpmode=none" \ + https://registry.npmjs.org/async-listen https://registry.npmjs.org/async-listen/-/async-listen-([\d\.]+)@ARCHIVE_EXT@ checksum + +# It is not recommended use npmregistry. Please investigate more. +# Take a look at https://wiki.debian.org/debian/watch/ +opts="searchmode=plain,component=types-agent-base,ctype=nodejs,pgpmode=none" \ + https://registry.npmjs.org/@types/agent-base https://registry.npmjs.org/@types/agent-base/-/agent-base-([\d\.]+)@ARCHIVE_EXT@ checksum