Sample Header Ad - 728x90

giving variables a default value in a spec file

3 votes
2 answers
547 views
I have a spec (myspecfile.spec) file that looks similar to Name: package-%{myname} Version: %{myversion} Release: %{myrelease} License: gpl2 Summary: this is my package BuildArch: noarch %description Some description of the package %files %changelog I run rpmbuild like: rpmbuild -bb new.spec --define 'myname my_name' --define 'myversion my_version' --define 'myrelease my_release' --define 'myprovide my_provide' And /home/user/rpmbuild/RPMS/noarch/package-my_name-my_version-my_release.noarch.rpm is created. All well and good, but is there any way to give one of my variables a default value? If I omit one of them? Say, I run rpmbuild -bb myfile.spec How can I get those variables listed to contain a default value? If I do a %define myname my_name it will always contain this value no matter what I pass in via the command line.
Asked by basil (153 rep)
Jun 19, 2024, 03:14 PM
Last activity: Jun 20, 2024, 11:16 AM