deboa 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cjs/classes/Deboa.js +17 -11
- package/dist/cjs/types/Priority.js +4 -0
- package/dist/cjs/{classes → types/classes}/Deboa.d.ts +0 -1
- package/dist/cjs/{classes → types/classes}/DeboaFromFile.d.ts +0 -0
- package/dist/cjs/types/index.d.ts +4 -9
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/{IAddTarEntriesParams.d.ts → types/IAddTarEntriesParams.d.ts} +0 -0
- package/dist/cjs/types/{IControlFileOptions.d.ts → types/IControlFileOptions.d.ts} +2 -1
- package/dist/cjs/types/{IDeboa.d.ts → types/IDeboa.d.ts} +11 -1
- package/dist/cjs/types/{IDeboaFromFile.d.ts → types/IDeboaFromFile.d.ts} +0 -0
- package/dist/cjs/types/{INormalizeOptionsLength.d.ts → types/INormalizeOptionsLength.d.ts} +0 -0
- package/dist/cjs/types/{IWriteFileFromLinesArgs.d.ts → types/IWriteFileFromLinesArgs.d.ts} +0 -0
- package/dist/cjs/types/{IWriteToArchive.d.ts → types/IWriteToArchive.d.ts} +0 -0
- package/dist/cjs/types/{MaintainerScript.d.ts → types/MaintainerScript.d.ts} +0 -0
- package/dist/cjs/types/types/Priority.d.ts +1 -0
- package/dist/cjs/types/{Section.d.ts → types/Section.d.ts} +0 -0
- package/dist/cjs/types/types/index.d.ts +10 -0
- package/dist/cjs/{utils → types/utils}/addTarEntries.d.ts +0 -0
- package/dist/cjs/{utils → types/utils}/createFileHeader.d.ts +0 -0
- package/dist/cjs/{utils → types/utils}/writeFileFromLines.d.ts +0 -0
- package/dist/cjs/{utils → types/utils}/writeToArchive.d.ts +0 -0
- package/dist/esm/classes/Deboa.js +14 -2
- package/dist/esm/types/Priority.js +1 -0
- package/dist/esm/{classes → types/classes}/Deboa.d.ts +0 -1
- package/dist/esm/{classes → types/classes}/DeboaFromFile.d.ts +0 -0
- package/dist/esm/types/index.d.ts +4 -9
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/{IAddTarEntriesParams.d.ts → types/IAddTarEntriesParams.d.ts} +0 -0
- package/dist/esm/types/{IControlFileOptions.d.ts → types/IControlFileOptions.d.ts} +2 -1
- package/dist/esm/types/{IDeboa.d.ts → types/IDeboa.d.ts} +11 -1
- package/dist/esm/types/{IDeboaFromFile.d.ts → types/IDeboaFromFile.d.ts} +0 -0
- package/dist/esm/types/{INormalizeOptionsLength.d.ts → types/INormalizeOptionsLength.d.ts} +0 -0
- package/dist/esm/types/{IWriteFileFromLinesArgs.d.ts → types/IWriteFileFromLinesArgs.d.ts} +0 -0
- package/dist/esm/types/{IWriteToArchive.d.ts → types/IWriteToArchive.d.ts} +0 -0
- package/dist/esm/types/{MaintainerScript.d.ts → types/MaintainerScript.d.ts} +0 -0
- package/dist/esm/types/types/Priority.d.ts +1 -0
- package/dist/esm/types/{Section.d.ts → types/Section.d.ts} +0 -0
- package/dist/esm/types/types/index.d.ts +10 -0
- package/dist/esm/{utils → types/utils}/addTarEntries.d.ts +0 -0
- package/dist/esm/{utils → types/utils}/createFileHeader.d.ts +0 -0
- package/dist/esm/{utils → types/utils}/writeFileFromLines.d.ts +0 -0
- package/dist/esm/{utils → types/utils}/writeToArchive.d.ts +0 -0
- package/package.json +1 -1
- package/dist/cjs/index.d.ts +0 -4
- package/dist/esm/index.d.ts +0 -4
package/README.md
CHANGED
|
@@ -96,6 +96,7 @@ For more details, please see the [IDeboa interface](https://github.com/erikian/d
|
|
|
96
96
|
- `beforePackage`: runs after the files are copied to the temporary directory and before they're packaged. You can use this to add/delete/rename any files before they're packaged.
|
|
97
97
|
- `controlFileOptions`: additional control file fields. See the [IControlFileOptions interface](https://github.com/erikian/deboa/blob/main/src/types/IControlFileOptions.ts) for details.
|
|
98
98
|
- `icon`: path to the image you want to use as your app icon.
|
|
99
|
+
- `installationRoot`: directory your files will be installed to. Defaults to `/usr/lib/${packageName}`.
|
|
99
100
|
- `modifyTarHeader`: allows you to modify the header of a file before it's added to the `data` tar archive. The main use case
|
|
100
101
|
for this option is setting permissions in order to make files executable when creating a .deb on Windows:
|
|
101
102
|
|
|
@@ -2,15 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
default: ()=>_default,
|
|
13
|
-
Deboa: ()=>Deboa
|
|
5
|
+
Object.defineProperty(exports, "Deboa", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>Deboa
|
|
14
8
|
});
|
|
15
9
|
const _events = require("events");
|
|
16
10
|
const _os = /*#__PURE__*/ _interopRequireDefault(require("os"));
|
|
@@ -156,7 +150,13 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
156
150
|
this.#outputFile = _path.default.join(this.targetDir, `${packageName}_${version}_${architecture}.deb`);
|
|
157
151
|
this.#controlFolderDestination = _path.default.join(this.#tempDir, 'control');
|
|
158
152
|
this.#dataFolderDestination = _path.default.join(this.#tempDir, 'data');
|
|
159
|
-
this.#appFolderDestination = _path.default.join(this.#dataFolderDestination,
|
|
153
|
+
this.#appFolderDestination = _path.default.join(this.#dataFolderDestination, ...options.installationRoot ? [
|
|
154
|
+
options.installationRoot
|
|
155
|
+
] : [
|
|
156
|
+
'usr',
|
|
157
|
+
'lib',
|
|
158
|
+
packageName
|
|
159
|
+
]);
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
162
|
* Ensures that all required options are present and that the `packageName`
|
|
@@ -272,6 +272,13 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
272
272
|
const controlFileWriteStream = _fs.default.createWriteStream(controlFileLocation);
|
|
273
273
|
_tarFs.default.pack(this.#dataFolderDestination, {
|
|
274
274
|
map: (header)=>{
|
|
275
|
+
// Why: while undocumented, this header accepts options for the header passed to tar-stream's pack function
|
|
276
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
277
|
+
// @ts-ignore
|
|
278
|
+
header.gname = 'root';
|
|
279
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
280
|
+
// @ts-ignore
|
|
281
|
+
header.uname = 'root';
|
|
275
282
|
// sensible defaults for Windows users
|
|
276
283
|
if (process.platform === 'win32') {
|
|
277
284
|
const defaultFilePermission = parseInt('0644', 8);
|
|
@@ -494,4 +501,3 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
494
501
|
}
|
|
495
502
|
}
|
|
496
503
|
}
|
|
497
|
-
var _default = Deboa;
|
|
File without changes
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './INormalizeOptionsLength';
|
|
6
|
-
export * from './IWriteFileFromLinesArgs';
|
|
7
|
-
export * from './IWriteToArchive';
|
|
8
|
-
export * from './MaintainerScript';
|
|
9
|
-
export * from './Section';
|
|
1
|
+
import { Deboa } from './classes/Deboa';
|
|
2
|
+
import { DeboaFromFile } from './classes/DeboaFromFile';
|
|
3
|
+
export { Deboa, DeboaFromFile };
|
|
4
|
+
export * from './types';
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -10,6 +10,7 @@ _exportStar(require("./INormalizeOptionsLength"), exports);
|
|
|
10
10
|
_exportStar(require("./IWriteFileFromLinesArgs"), exports);
|
|
11
11
|
_exportStar(require("./IWriteToArchive"), exports);
|
|
12
12
|
_exportStar(require("./MaintainerScript"), exports);
|
|
13
|
+
_exportStar(require("./Priority"), exports);
|
|
13
14
|
_exportStar(require("./Section"), exports);
|
|
14
15
|
function _exportStar(from, to) {
|
|
15
16
|
Object.keys(from).forEach(function(k) {
|
|
File without changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MaintainerScript } from './MaintainerScript';
|
|
2
|
+
import { Priority } from './Priority';
|
|
2
3
|
import { Section } from './Section';
|
|
3
4
|
/**
|
|
4
5
|
* The descriptions are mostly just shameless copies from the following docs:
|
|
@@ -90,7 +91,7 @@ export interface IControlFileOptions {
|
|
|
90
91
|
*
|
|
91
92
|
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-priority}
|
|
92
93
|
*/
|
|
93
|
-
priority?:
|
|
94
|
+
priority?: Priority;
|
|
94
95
|
/**
|
|
95
96
|
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
96
97
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Headers as
|
|
1
|
+
import type { Headers as OriginalTarFSHeader } from 'tar-fs';
|
|
2
2
|
import type { Headers as TarStreamHeader } from 'tar-stream';
|
|
3
3
|
import { IControlFileOptions } from './IControlFileOptions';
|
|
4
|
+
declare type TarFSHeader = OriginalTarFSHeader & Pick<TarStreamHeader, 'uname' | 'gname'>;
|
|
4
5
|
/**
|
|
5
6
|
* @property {IDeboa["additionalTarEntries"]} [additionalTarEntries] -
|
|
6
7
|
* Additional entries to be added to the .tar archive. This is useful for
|
|
@@ -33,6 +34,10 @@ import { IControlFileOptions } from './IControlFileOptions';
|
|
|
33
34
|
* /usr/share/pixmaps. Optional.
|
|
34
35
|
*
|
|
35
36
|
*
|
|
37
|
+
* @property {IDeboa["installationRoot"]} [installationRoot] -
|
|
38
|
+
* Directory your files will be installed to. Defaults to `/usr/lib/${packageName}`.
|
|
39
|
+
*
|
|
40
|
+
*
|
|
36
41
|
* @property {IDeboa["modifyTarHeader"]} [modifyTarHeader] -
|
|
37
42
|
* This callback makes it possible to modify file headers before they're
|
|
38
43
|
* written to the .tar archive, which is useful for setting permissions.
|
|
@@ -92,6 +97,10 @@ export interface IDeboa {
|
|
|
92
97
|
* /usr/share/pixmaps. Optional.
|
|
93
98
|
*/
|
|
94
99
|
icon?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Directory your files will be installed to. Defaults to `/usr/lib/${packageName}`.
|
|
102
|
+
*/
|
|
103
|
+
installationRoot?: string;
|
|
95
104
|
/**
|
|
96
105
|
* This callback makes it possible to modify file headers before they're
|
|
97
106
|
* written to the .tar archive, which is useful for setting permissions.
|
|
@@ -121,3 +130,4 @@ export interface IDeboa {
|
|
|
121
130
|
*/
|
|
122
131
|
targetDir: string;
|
|
123
132
|
}
|
|
133
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type Priority = 'required' | 'important' | 'standard' | 'optional';
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './IAddTarEntriesParams';
|
|
2
|
+
export * from './IControlFileOptions';
|
|
3
|
+
export * from './IDeboa';
|
|
4
|
+
export * from './IDeboaFromFile';
|
|
5
|
+
export * from './INormalizeOptionsLength';
|
|
6
|
+
export * from './IWriteFileFromLinesArgs';
|
|
7
|
+
export * from './IWriteToArchive';
|
|
8
|
+
export * from './MaintainerScript';
|
|
9
|
+
export * from './Priority';
|
|
10
|
+
export * from './Section';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -98,7 +98,13 @@ import { addTarEntries } from '../utils/addTarEntries';
|
|
|
98
98
|
this.#outputFile = path.join(this.targetDir, `${packageName}_${version}_${architecture}.deb`);
|
|
99
99
|
this.#controlFolderDestination = path.join(this.#tempDir, 'control');
|
|
100
100
|
this.#dataFolderDestination = path.join(this.#tempDir, 'data');
|
|
101
|
-
this.#appFolderDestination = path.join(this.#dataFolderDestination,
|
|
101
|
+
this.#appFolderDestination = path.join(this.#dataFolderDestination, ...options.installationRoot ? [
|
|
102
|
+
options.installationRoot
|
|
103
|
+
] : [
|
|
104
|
+
'usr',
|
|
105
|
+
'lib',
|
|
106
|
+
packageName
|
|
107
|
+
]);
|
|
102
108
|
}
|
|
103
109
|
/**
|
|
104
110
|
* Ensures that all required options are present and that the `packageName`
|
|
@@ -214,6 +220,13 @@ import { addTarEntries } from '../utils/addTarEntries';
|
|
|
214
220
|
const controlFileWriteStream = fs.createWriteStream(controlFileLocation);
|
|
215
221
|
tar.pack(this.#dataFolderDestination, {
|
|
216
222
|
map: (header)=>{
|
|
223
|
+
// Why: while undocumented, this header accepts options for the header passed to tar-stream's pack function
|
|
224
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
225
|
+
// @ts-ignore
|
|
226
|
+
header.gname = 'root';
|
|
227
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
228
|
+
// @ts-ignore
|
|
229
|
+
header.uname = 'root';
|
|
217
230
|
// sensible defaults for Windows users
|
|
218
231
|
if (process.platform === 'win32') {
|
|
219
232
|
const defaultFilePermission = parseInt('0644', 8);
|
|
@@ -437,4 +450,3 @@ import { addTarEntries } from '../utils/addTarEntries';
|
|
|
437
450
|
}
|
|
438
451
|
}
|
|
439
452
|
export { Deboa };
|
|
440
|
-
export default Deboa;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './INormalizeOptionsLength';
|
|
6
|
-
export * from './IWriteFileFromLinesArgs';
|
|
7
|
-
export * from './IWriteToArchive';
|
|
8
|
-
export * from './MaintainerScript';
|
|
9
|
-
export * from './Section';
|
|
1
|
+
import { Deboa } from './classes/Deboa';
|
|
2
|
+
import { DeboaFromFile } from './classes/DeboaFromFile';
|
|
3
|
+
export { Deboa, DeboaFromFile };
|
|
4
|
+
export * from './types';
|
package/dist/esm/types/index.js
CHANGED
|
File without changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MaintainerScript } from './MaintainerScript';
|
|
2
|
+
import { Priority } from './Priority';
|
|
2
3
|
import { Section } from './Section';
|
|
3
4
|
/**
|
|
4
5
|
* The descriptions are mostly just shameless copies from the following docs:
|
|
@@ -90,7 +91,7 @@ export interface IControlFileOptions {
|
|
|
90
91
|
*
|
|
91
92
|
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-priority}
|
|
92
93
|
*/
|
|
93
|
-
priority?:
|
|
94
|
+
priority?: Priority;
|
|
94
95
|
/**
|
|
95
96
|
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
96
97
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Headers as
|
|
1
|
+
import type { Headers as OriginalTarFSHeader } from 'tar-fs';
|
|
2
2
|
import type { Headers as TarStreamHeader } from 'tar-stream';
|
|
3
3
|
import { IControlFileOptions } from './IControlFileOptions';
|
|
4
|
+
declare type TarFSHeader = OriginalTarFSHeader & Pick<TarStreamHeader, 'uname' | 'gname'>;
|
|
4
5
|
/**
|
|
5
6
|
* @property {IDeboa["additionalTarEntries"]} [additionalTarEntries] -
|
|
6
7
|
* Additional entries to be added to the .tar archive. This is useful for
|
|
@@ -33,6 +34,10 @@ import { IControlFileOptions } from './IControlFileOptions';
|
|
|
33
34
|
* /usr/share/pixmaps. Optional.
|
|
34
35
|
*
|
|
35
36
|
*
|
|
37
|
+
* @property {IDeboa["installationRoot"]} [installationRoot] -
|
|
38
|
+
* Directory your files will be installed to. Defaults to `/usr/lib/${packageName}`.
|
|
39
|
+
*
|
|
40
|
+
*
|
|
36
41
|
* @property {IDeboa["modifyTarHeader"]} [modifyTarHeader] -
|
|
37
42
|
* This callback makes it possible to modify file headers before they're
|
|
38
43
|
* written to the .tar archive, which is useful for setting permissions.
|
|
@@ -92,6 +97,10 @@ export interface IDeboa {
|
|
|
92
97
|
* /usr/share/pixmaps. Optional.
|
|
93
98
|
*/
|
|
94
99
|
icon?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Directory your files will be installed to. Defaults to `/usr/lib/${packageName}`.
|
|
102
|
+
*/
|
|
103
|
+
installationRoot?: string;
|
|
95
104
|
/**
|
|
96
105
|
* This callback makes it possible to modify file headers before they're
|
|
97
106
|
* written to the .tar archive, which is useful for setting permissions.
|
|
@@ -121,3 +130,4 @@ export interface IDeboa {
|
|
|
121
130
|
*/
|
|
122
131
|
targetDir: string;
|
|
123
132
|
}
|
|
133
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type Priority = 'required' | 'important' | 'standard' | 'optional';
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './IAddTarEntriesParams';
|
|
2
|
+
export * from './IControlFileOptions';
|
|
3
|
+
export * from './IDeboa';
|
|
4
|
+
export * from './IDeboaFromFile';
|
|
5
|
+
export * from './INormalizeOptionsLength';
|
|
6
|
+
export * from './IWriteFileFromLinesArgs';
|
|
7
|
+
export * from './IWriteToArchive';
|
|
8
|
+
export * from './MaintainerScript';
|
|
9
|
+
export * from './Priority';
|
|
10
|
+
export * from './Section';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
package/dist/cjs/index.d.ts
DELETED
package/dist/esm/index.d.ts
DELETED