npm-pkgbuild 7.11.0 → 7.11.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/output/rpm.mjs +13 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "7.11.0",
3
+ "version": "7.11.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,12 +33,12 @@ export class RPM extends Packager {
33
33
  const tmp = await this.tmpdir;
34
34
 
35
35
  await Promise.all(
36
- ["staging", "RPMS", "SRPMS", "SOURCES", "SPECS"].map(d =>
36
+ ["BUILDROOT", "RPMS", "SRPMS", "SOURCES", "SPECS"].map(d =>
37
37
  mkdir(join(tmp, d))
38
38
  )
39
39
  );
40
40
 
41
- const staging = join(tmp, "staging");
41
+ const staging = join(tmp, "BUILDROOT");
42
42
 
43
43
  const fp = fieldProvider(properties, fields, mandatoryFields);
44
44
 
@@ -46,7 +46,9 @@ export class RPM extends Packager {
46
46
 
47
47
  async function* trailingLines() {
48
48
  for (const [name, options] of Object.entries(sections)) {
49
- yield `%${name}\n\n`;
49
+ if(options.mandatory) {
50
+ yield `%${name}\n\n`;
51
+ }
50
52
  }
51
53
  }
52
54
 
@@ -69,6 +71,7 @@ export class RPM extends Packager {
69
71
  const rpmbuild = await execa("rpmbuild", [
70
72
  "--define",
71
73
  `_topdir ${tmp}`,
74
+ // "--buildroot", staging,
72
75
  "-vv",
73
76
  "-bb",
74
77
  join(staging, specFileName)
@@ -110,11 +113,11 @@ const fields = {
110
113
  };
111
114
 
112
115
  const sections = {
113
- description: {},
114
- prep: {},
115
- build: {},
116
- install: {},
117
- check: {},
118
- files: {},
119
- changelog: {}
116
+ description: { mandatory: true },
117
+ prep: { mandatory: false },
118
+ build: { mandatory: false },
119
+ install: { mandatory: false },
120
+ check: { mandatory: false },
121
+ files: { mandatory: true },
122
+ changelog: { mandatory: false }
120
123
  };