-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,37 @@ | ||
import globby from "globby"; | ||
import { quote } from "./util.mjs"; | ||
|
||
export async function rpmspec(context, stagingDir, out, options = {}) { | ||
const pkg = { contributors: [], pacman: {}, ...context.pkg }; | ||
|
||
const properties = | ||
{ | ||
Name: pkg.name, | ||
Summary: pkg.description, | ||
License: pkg.license, | ||
Version: context.properties.pkgver.replace(/\-.*$/, ""), | ||
Release: context.properties.pkgrel | ||
}; | ||
|
||
|
||
out.write(`${Object.keys(properties) | ||
.filter(k => properties[k] !== undefined) | ||
.map(k => `${k}=${quote(properties[k])}`) | ||
.join("\n")} | ||
const pkg = { contributors: [], pacman: {}, ...context.pkg }; | ||
|
||
const properties = { | ||
Name: pkg.name, | ||
Summary: pkg.description, | ||
License: pkg.license, | ||
Version: context.properties.pkgver.replace(/\-.*$/, ""), | ||
Release: context.properties.pkgrel | ||
}; | ||
|
||
out.write(`${Object.keys(properties) | ||
.filter(k => properties[k] !== undefined) | ||
.map(k => `${k}=${quote(properties[k])}`) | ||
.join("\n")} | ||
%description | ||
This is my first RPM package, which does nothing. | ||
${pkg.description} | ||
%prep | ||
# we have no source, so nothing here | ||
%build | ||
cat > hello-world.sh <<EOF | ||
#!/usr/bin/bash | ||
echo Hello world | ||
EOF | ||
%install | ||
mkdir -p %{buildroot}/usr/bin/ | ||
install -m 755 hello-world.sh %{buildroot}/usr/bin/hello-world.sh | ||
%files | ||
/usr/bin/hello-world.sh | ||
%changelog | ||
# let's skip this for now | ||
`); | ||
|
||
for (const name of await globby("**/*", { cwd: stagingDir })) { | ||
out.write(name + "\n"); | ||
} | ||
|
||
out.end(); | ||
out.end(); | ||
} |