{"library":"rpm-builder","title":"RPM Builder","description":"RPM Builder is a Node.js library designed to create Red Hat Package Manager (RPM) packages programmatically. It wraps the underlying `rpmbuild` system utility, abstracting away the complexities of direct command-line execution and spec file generation. The package allows developers to define package metadata, specify files, handle glob patterns, and exclude files using a simple JavaScript API. The current stable version is 1.2.1, released over six years ago, and the package is effectively abandoned, meaning no further updates, feature enhancements, or security patches are expected. Its primary differentiator is providing a native Node.js interface for RPM creation, which can be integrated into CI/CD pipelines for projects requiring RPM distribution artifacts. It simplifies the packaging process compared to manually creating `.spec` files and executing `rpmbuild` commands.","language":"javascript","status":"abandoned","last_verified":"Tue Apr 21","install":{"commands":["npm install rpm-builder"],"cli":null},"imports":["const buildRpm = require('rpm-builder');","require('rpm-builder')(options, callback);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const buildRpm = require('rpm-builder');\nconst path = require('path');\nconst fs = require('fs');\n\n// Create some dummy files for the RPM\nconst tempDir = path.join(__dirname, 'temp_app_files');\nfs.mkdirSync(tempDir, { recursive: true });\nfs.writeFileSync(path.join(tempDir, 'app.js'), 'console.log(\"Hello RPM!\");');\nfs.writeFileSync(path.join(tempDir, 'config.json'), '{ \"port\": 3000 }');\n\nconst options = {\n  name: 'my-node-application',\n  version: '1.0.0',\n  release: '1',\n  summary: 'A simple Node.js application packaged as an RPM',\n  description: 'This RPM contains a basic Node.js script and a configuration file.',\n  group: 'Development/Tools',\n  license: 'MIT',\n  vendor: 'MyCompany',\n  buildArch: 'noarch',\n  files: [\n    { src: path.join(tempDir, 'app.js'), dest: '/usr/local/bin/my-app/app.js' },\n    { src: path.join(tempDir, 'config.json'), dest: '/etc/my-app/config.json' }\n  ],\n  // Optional: Set a temporary directory, will be cleaned up by default\n  tempDir: path.join(__dirname, 'rpm_build_tmp'),\n  // Optional: Keep the temporary directory for inspection after build\n  keepTemp: false\n};\n\nbuildRpm(options, function(err, rpmPath) {\n  // Clean up dummy files after attempting RPM build\n  fs.rmSync(tempDir, { recursive: true, force: true });\n  if (options.tempDir && !options.keepTemp) {\n    fs.rmSync(options.tempDir, { recursive: true, force: true });\n  }\n\n  if (err) {\n    console.error('Failed to build RPM:', err);\n    return;\n  }\n  console.log('Successfully built RPM:', rpmPath);\n  // Example: mv ' + rpmPath + ' /path/to/my/rpms/new-package.rpm\n});\n","lang":"javascript","description":"This quickstart demonstrates how to use `rpm-builder` to create a basic RPM package containing a Node.js application script and a configuration file, including necessary temporary file setup and cleanup.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}