{"id":15406535,"url":"https://github.com/wwkimball/dynamic-package-builder","last_synced_at":"2026-05-17T08:31:39.797Z","repository":{"id":98583260,"uuid":"139222398","full_name":"wwkimball/dynamic-package-builder","owner":"wwkimball","description":"Extends the standard package specification file to enable dynamic construction","archived":false,"fork":false,"pushed_at":"2020-10-28T18:17:02.000Z","size":106,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-18T12:45:38.727Z","etag":null,"topics":["bash","bash-scripting","dynamic","rpm","rpm-builder","rpm-spec","rpmbuild","rpms"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wwkimball.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["wwkimball"]}},"created_at":"2018-06-30T05:38:06.000Z","updated_at":"2023-10-11T07:05:26.000Z","dependencies_parsed_at":"2023-03-25T12:03:07.708Z","dependency_job_id":null,"html_url":"https://github.com/wwkimball/dynamic-package-builder","commit_stats":{"total_commits":102,"total_committers":2,"mean_commits":51.0,"dds":0.0980392156862745,"last_synced_commit":"e903e121aea38f0e4274fd2a7eb10ae848a22d99"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wwkimball/dynamic-package-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwkimball%2Fdynamic-package-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwkimball%2Fdynamic-package-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwkimball%2Fdynamic-package-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwkimball%2Fdynamic-package-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wwkimball","download_url":"https://codeload.github.com/wwkimball/dynamic-package-builder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwkimball%2Fdynamic-package-builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33131878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T06:27:06.342Z","status":"ssl_error","status_checked_at":"2026-05-17T06:26:59.432Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-scripting","dynamic","rpm","rpm-builder","rpm-spec","rpmbuild","rpms"],"created_at":"2024-10-01T16:24:03.273Z","updated_at":"2026-05-17T08:31:39.781Z","avatar_url":"https://github.com/wwkimball.png","language":"Shell","funding_links":["https://github.com/sponsors/wwkimball"],"categories":[],"sub_categories":[],"readme":"# Dynamic Package Builder\nThis project extends the standard package specification file to enable dynamic\nconstruction.  Doing so allows for external configuration, boilerplate sharing,\ntemplates, and other dynamic content creation.  Extensible through contributed\nfunctions, this project also enables you to easily integrate RPM building into\nyour own workflows so that you can deliver binary packages as part of your\nroutine build process.\n\n## Coding For Fun\nThis project also serves as an example of some of bash's more interesting\ncapabilities as a programming language.  It demonstrates:\n\n  * complex text file parsing and templating\n  * recursive variable expansion\n  * passing associative arrays as parameters to functions\n  * restricting permissible values (via RegEx) for variable assignments\n  * dynamic code inclusion\n  * complex command-line parsing without using `getopt`\n  * merging configuration from many sources with priorities\n\nAs such, this project will run only on bash 4.3 or later.  Fear not if you don't\nhave a sufficient version of bash.  It is reasonably simple to compile and\ninstall a compatible version of bash from source to your build box or container.\n\n# Usage\nSynopsis:\n\n\tbuild-rpm-specs.sh [OPTIONS] [-- RPMBUILD_ARGS]\n\nIn the simplest use-case:\n\n  1. For your project, place your RPM specification file(s) into a top-level\n     SPECS subdirectory.\n  2. From the top-level directory of your project, clone (submodule) this\n     project and run `dynamic-package-builder/build-rpm-specs.sh` without any\n\t arguments.\n  3. Your binary and source packages will be written under the RPMS and SRPMS\n     subdirectories of your project.\n\nMore complex uses might add an external configuration file for the package\nspecification.  Further complexity -- and centralization of common configuration\nneeds -- usually breaks the external configuration up into several imports,\nsome dynamic so that the specification file can be dynamically constructed from\norganizational boilerplate files and shared settings.  No matter how complex the\npackage specification and its external templates and configuration files, you\nwould still likely just run `dynamic-package-builder/build-rpm-specs.sh` without\nany arguments.\n\nHowever, you can certainly pass any of the many supported parameters and flags\nto this script should you:\n\n  * opt not to store your package sources or specifications in top-level SOURCES\n    and SPECS directories, respectively;\n  * need to pass custom configuration to the `rpmbuild` command that you cannot\n  * otherwise represent in your specification file;\n  * control which packages (binary and source) are to be built;\n  * customize how temporary workspace files are handled; or\n  * otherwise control the behavior of this script.\n\nSee `build-rpm-specs.sh --help` for a detailed exploration of all capabilities.\nSee the tests for examples in varying degrees of complexity.\n\n# Extensions\nThis project extends legacy package specification files by enabling variable\nsubstitution from external sources as well as enabling external file injection.\nIt also enables external configuration files to perform dynamic value\nconstruction for the variables employed by package specification files.\n\n## Package Specification Files\nPackage specification files are extended by adding the following markup:\n\n  1. ${:VAR_NAME} is a simple variable substitution.\n  2. ${:VAR_NAME:=default} and ${:VAR_NAME:-default} are identical to\n     ${:VAR_NAME} except that 'default' becomes the value when VAR_NAME is\n     undefined or empty.\n  3. ${@FILE_CONCAT} copies the content of FILE_CONCAT verbatim into the spec\n     file.  Any variables or other file concatenations are processed.\n\nSubstitutions are performed recursively and repeatedly, allowing for late\ndefinitions, simple or complex embedding, and even dynamic variable and file\nname resolutions.\n\nSee `build-rpm-specs.sh --help SPECS` for more detail.\n\n## Configuration Files\nExternal configuration files allow for even more flexibility.  If you have\npackage specification file named my-project.spec, an optional external\nconfiguraiton file named my-project.conf will be automatically loaded and\nprocessed, if found in the same directory as the specification file.  These\nfeature-rich configuration files can dynamically populate the variables used\nwithin your specification file.  Such features include:\n\n  1. Flexible assignment operators -- your choice of \"key=value\", \"key =\n     value\", \"key:value\", or \"key: value\" -- allowing your team to use\n\t whichever style they are most comfortable with.\n  2. Flexible whitespace handling, allowing for vertical alignment if desired.\n  3. HEREDOC handling with optional indentation removal.\n  4. Comments using the # symbol.\n  5. Variable substitution.\n  6. Multi-pass resolution, allowing variables to be used before they are\n     defined.\n  7. Include files, enabling multiple configuration files to be used to\n     construct the whole configuration.\n  8. Recursive variable resolution, enabling dynamic variable and file name\n     construction.\n  9. External command execution to resolve values at run-time.\n  10. Read external file content as the value of a variable.\n  11. Read values from environment variables.\n\nSee `build-rpm-specs.sh --help CONFIGS` for more detail.\n\n## Contributed Functions\nThis project comes with some stock (example) contributed functions, including:\n\n  * getReleaseNumberForVersion:  provides logic that can generate the next\n    appropriate release number for a given package version.  This function\n\ttracks release numbers within a structured data file that is saved to a\n\tgiven directory.  The directory is subdivided by given package architecture\n\tand operating system.\n  * getVersionFromFileName:  provides logic that can identify the version of a\n    product from its file-name, provided the version number appears in the\n\tfile-name in a reliable, identifiable way.\n  * publishViaCopy:  provides logic that can copy all generated RPMs to a\n    package repository directory that is accessible to the local file-system.\n  * updateRepositoryMetadata:  provides logic that can generate or update\n    RPM/yum repository metadata.\n\nYou can write and employ your own custom functions to further specialize the\nhandling of your specifications and better integrate this tool with your own\nworkflows and environments.\n\nSee `build-rpm-specs.sh --help CONTRIB` for more detail.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwwkimball%2Fdynamic-package-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwwkimball%2Fdynamic-package-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwwkimball%2Fdynamic-package-builder/lists"}