Closed Olf0 closed 1 year ago
I believe the %setup -n foo
is required for OBS to work but have to check.
When you say the rm on the bildroot is obsolete, does this mean it is done implicitly?
I know the %clean
macro is obsolete, but cleaning the buildroot is useful when building locally.
believe the %setup -n foo is required for OBS to work but have to check.
Scratch that, works fine without it.
I believe the
%setup -n foo
is required for OBS to work but have to check.
Definitely not by OBS in general, but maybe by Jolla's tar_git
: I once analysed it somewhere, it is a shell script. Will try to find my analysis.
Edit:
Found my analysis of Jolla's tar_git
, AFAICS / IIRC it uses %{name}
and extracts %{version}
from a git tag, if one is set / used (plus %{release}
, but that is heavily processed after its extraction). If no git tag is set or specified (in the OBS' .service
file), then tar_git
uses the %{version}
from the spec file and appends the a part of the hash of the latest commit (in the branch which is configured in the .service
file or which tar_git
decides to use) to the processed %{release}
string.
Actually, it is this behaviour which creates the necessity to have the %{version}
in the spec file and in a correspondingly created git tag set to the same version string. But I cannot see, why %{name}-%{version}
would be altered by anything so it is not the original string (at any time, including the point in time the %setup
macro is called in the %prep
section of a spec file).
When you say the rm on the buildroot is obsolete, does this mean it is done implicitly?
I know the
%clean
macro is obsolete, but cleaning the buildroot is useful when building locally.
Yes, both the %clean
macro and rm -rf %{buildroot}
are long obsolete, according to the RPM documentation etc. (Fedora packaging guidelines and many more) and I checked that in many rpmbuild
runs.
And it is successfully build by our CI workflow, which utilises Coderus' Sailfish-SDK images, hence mb2
and all the other pieces of Jolla's SDK. But you are absolutely right, this way I never checked what happens if the SDK environment has been used before (as these images are always freshly instanciated in a docker container).
all good.
I am still glad (every time), that you double-checked and triggered me to re-evaluate and properly document my reasoning.
%global
instead of%define
for static expressions:%global
s are evaluated once when set,%define
s are evaluated each time used. Plus the scope of%global
s is all sections, including the scriptlets.-n %{name}-%{version}
always has been the default for%setup
, hence omitted now.rm -rf %{buildroot}
as first statement in the%install
section is long obsolete, thus superfluous.