• Home

  • Custom Ecommerce
  • Application Development
  • Database Consulting
  • Cloud Hosting
  • Systems Integration
  • Legacy Business Systems
  • Security & Compliance
  • GIS

  • Expertise

  • About Us
  • Our Team
  • Clients
  • Blog
  • Careers

  • CasePointer

  • VisionPort

  • Contact
  • Our Blog

    Ongoing observations by End Point Dev people

    Defining variables for rpmbuild

    Jon Jensen

    By Jon Jensen
    August 20, 2009

    RPM spec files offer a way to define and test build variables with a directive like this:

    %define <variable> <value>
    

    Sometimes it’s useful to override such variables temporarily for a single build, without modifying the spec file, which would make the changed variable appear in the output source RPM. For some reason, how to do this has been hard for me to find in the docs and hard for me to remember, despite its simplicity.

    Here’s how. For example, to override the standard _prefix variable with value /usr/local:

    rpmbuild -ba SPECS/$package.spec --define '_prefix /usr/local'
    

    hosting redhat


    Comments