Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

rpm-spec

RPM spec file – Is it possible to dynamically populate a spec file variable

January 7, 2024 by Tarik

You can define rpmbuild variables with %(cmd) at the top of the spec file. Notice the command is in parenthesis, not curly brackets. An example: %define whoami %(whoami) And elsewhere in the spec file, such as a script or the build/install sections, use the variable as normal in the curly brackets like this: echo “The … Read more

Categories rpm Tags rpm, rpm-spec, rpmbuild Leave a comment

How to pass user defined parameters to rpmbuild to fill variables

September 10, 2023 by Tarik

rpmbuild -bb –define ‘_foobar Foo’ somespecfile.spec and refer it within the spec as %{_foobar} (the _ is a convention, not a must)

Categories rpmbuild Tags rpm-spec, rpmbuild Leave a comment

How do I get rpmbuild to download all of the sources for a particular .spec?

August 4, 2023 by Tarik

The spectool utility from the rpmdevtools package can do this. Just install rpmdevtools and point spectools at the .spec like so: spectool -g -R SPECS/nginx.spec It will download any missing sources into rpm’s %{_sourcedir} (usually SOURCES) directory.

Categories rpm Tags rpm, rpm-spec, rpmbuild Leave a comment

extract the spec file from rpm package

June 1, 2023 by Tarik

Install rpmrebuild and “extract” (actually re-create) the spec file of your rpm file or your already installed package. Examples: rpmrebuild –package –notest-install -e oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm rpmrebuild -s hercules.spec hercules

Categories linux Tags linux, rpm, rpm-spec, rpmbuild Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa