View Issue Details

IDProjectCategoryView StatusLast Update
0000051bareos-coreinstaller / packagespublic2013-03-04 10:26
Reporterstephand Assigned To 
PrioritylowSeveritytrivialReproducibilityN/A
Status closedResolutionfixed 
PlatformLinuxOSFedora CentOS RHELOS Versionall
Product Version12.4.2 
Fixed in Version12.4.2 
Summary0000051: Add Dist Tag for Fedora, CentOS, RHEL RPMs
DescriptionThe Fedora Packaging Guidelines suggest to use the %{dist} Tag for the Relase Part of the RPM, this adds .el5, .el6, .fc16, .fc17, .fc18
Although not mandatory, it is very common.

See https://fedoraproject.org/wiki/Packaging:DistTag

Technical problems will arise when trying to add different packages with exactly the same name-version-release-arch combination to Red Hat Spacewalk or Satellite.
Additional InformationIn OBS this is easily done by using the following in the RPM Spec File:

Release: <CI_CNT>.<B_CNT>0%{?dist}

See http://en.opensuse.org/openSUSE:Build_Service_Tips_and_Tricks#How_to_control_a_Release_number_of_resulted_packages

Unfortunately, this does not work for CentOS 5 because
https://build.opensuse.org/project/prjconf?project=CentOS%3ACentOS-5
does not define the macro %dist
In https://build.opensuse.org/project/prjconf?project=RedHat%3ARHEL-5 it is

#From RedHat buildsys-macros package
%rhel 5
%dist .el5
%el5 5

Tried the following workaround, but it does not work:
%if 0%{?centos_version} == 505
%define dist .el5
%endif
TagsNo tags attached.

Activities

stephand

stephand

2013-02-15 11:18

developer   ~0000111

simply adding Release: <CI_CNT>.<B_CNT>%{?dist} to the spec file does not work when using OBS Source Service "Updates version in spec and dsc files", because the script /usr/lib/obs/service/set_version does replace anything in the spec files Release tag before the first % character with "0" by
sed -r -i "s,^Release:(\s*)[^%]*,Release:\10," "$MYOUTDIR/$FILE" || exit 1

http://en.opensuse.org/openSUSE:Build_Service_Tips_and_Tricks#How_to_control_a_Release_number_of_resulted_packages suggests to add something like "Release: %%{?release_prefix}.<CI_CNT>.<B_CNT>" to the OBS Project Configuration.

For this case, it works when adding the following to the Project Configuration:

Release: <CI_CNT>.<B_CNT>%%{?dist}

Like this, OBS always sets the Relase Tag appropietaly and adding %{?dist}, for example:
[ 95s] I have the following modifications for bareos.spec:
[ 95s] 44c44
[ 95s] < Release: 0%{?dist}
[ 95s] ---
[ 95s] > Release: 6.1%{?dist}

It does not matter if the original spec file has %{?dist} in the Relase Tag or not. The %{?dist} will be added in both cases.

Like this it works for all Fedora, RHEL and CentOS 6, but notfor CentOS 5 because
https://build.opensuse.org/project/prjconf?project=CentOS%3ACentOS-5
does not define the macro %dist

It would be possible to add the following to spec file befor the Release: line as a workaround:

%if 0%{?centos_version} == 505
%define dist .el5
%endif

But this does not really belong in the spec file. It should be done by OBS project configuration.

I tested the following in prjconf but it does not work:
%if 0%{?centos_version} == 505
%define dist .el5
%endif

Because the normal prjconf definition are only use for the spec file processing, they don't go though to the build itself. This is only the case for the Macros: section in prjconf, but:

Also trying to set Macros after the Macros:-Tag in the prjconf (see http://en.opensuse.org/openSUSE:Build_Service_prjconf) won't work because everything there the define statement is implicit and %if ... can't be used because it expands to %define if ... which does not make sense and breaks everything.
stephand

stephand

2013-02-15 15:56

developer   ~0000112

Last edited: 2013-02-17 18:36

Finally found out, that adding the following addition to our OBS prjconf would work and would not require any changes in the .spec file:

# dist tag for Fedora, RHEL, CentOS. No effect on any other.
Release: <CI_CNT>.<B_CNT>%%{?dist}

# fix missing dist definition in openSUSE.org:CentOS:CentOS-5 prjconf
%if 0%{?centos_version} >= 500 && 0%{?centos_version} <= 599
Release: <CI_CNT>.<B_CNT>.el5
%endif

The second part can be removed once openSUSE.org OBS defines the dist for CentOS 5 in their prjconf.

On my home project I verified that it works fine.

stephand

stephand

2013-02-19 16:29

developer   ~0000127

Philipp agreed to implement it like proposed.
Verified on bareos:master, works.
Also changed the bareos prjconf in OBS now.
stephand

stephand

2013-02-19 16:31

developer   ~0000128

Fedora, CentOS and RHEL packages now get dist tag added to RPM Release Field.

Issue History

Date Modified Username Field Change
2013-02-03 22:29 stephand New Issue
2013-02-13 22:24 stephand Assigned To => stephand
2013-02-13 22:24 stephand Status new => assigned
2013-02-14 09:55 stephand Product Version 12.4.0 => 12.4.1
2013-02-15 11:18 stephand Note Added: 0000111
2013-02-15 15:56 stephand Note Added: 0000112
2013-02-15 15:57 stephand Note Edited: 0000112
2013-02-17 18:36 stephand Note Edited: 0000112
2013-02-19 16:29 stephand Note Added: 0000127
2013-02-19 16:31 stephand Target Version => 12.4.1
2013-02-19 16:31 stephand Fixed in Version => 12.4.1
2013-02-19 16:31 stephand Note Added: 0000128
2013-02-19 16:31 stephand Status assigned => resolved
2013-02-19 16:31 stephand Resolution open => fixed
2013-02-19 19:52 mvwieringen Assigned To stephand =>
2013-02-19 19:52 mvwieringen Status resolved => closed
2013-03-04 10:26 mvwieringen Product Version => 12.4.2
2013-03-04 10:26 mvwieringen Fixed in Version => 12.4.2