Bug 1473772 - Cannot build a package in Copr , when Version is complicated
Cannot build a package in Copr , when Version is complicated
Status: CLOSED NOTABUG
Product: Copr
Classification: Community
Component: backend (Show other bugs)
unspecified
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Miroslav Suchý
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-21 11:09 EDT by Patrick Pichon
Modified: 2017-07-24 07:52 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-24 06:40:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Builder-live log / see the last lines (558.38 KB, text/plain)
2017-07-21 11:30 EDT, Patrick Pichon
no flags Details

  None (edit)
Description Patrick Pichon 2017-07-21 11:09:45 EDT
Description of problem:
It looks like Copr only only standard/simple Version number. I wanted to have a more complicated one , which is the result of a calculation

%define dovecotversion %(rpm --queryformat "%{VERSION}" -q dovecot)
Version:        2.0_%{dovecotversion}

Version-Release number of selected component (if applicable):


How reproducible:
Build the following package pipiche.fr/dovecot-antispam-2.0_2.2.31-1.fc26.src.rpm

Steps to Reproduce:
1.
2.
3.

Actual results:
failure

Expected results:
should work as it works manualy with rpmbuild --rebuild http://pipiche.fr/dovecot-antispam-2.0_2.2.31-1.fc26.src.rpm

Additional info:
Comment 1 Patrick Pichon 2017-07-21 11:30 EDT
Created attachment 1302493 [details]
Builder-live log / see the last lines

Here is the log from Builder live. It looks like the 2 following lines doesn't work, because dovecot-devel is not yet installed by Copr !


Version:        2.0_%{dovecotversion}
%define dovecotversion %(/usr/bin/rpm --queryformat "%{VERSION}" -q dovecot-devel)


Start: creating root cache
Finish: creating root cache
Finish: chroot init
INFO: Installed packages:
Start: buildsrpm
Start: rpmbuild -bs
error: line 9: Tag takes single token only: Version:        2.0_package dovecot-devel is not installed
Comment 2 Patrick Pichon 2017-07-24 06:05:22 EDT
For your information I have updated the statement:

From : 

%define dovecotversion %(/usr/bin/rpm --queryformat "%{VERSION}" -q dovecot-devel)

To :

%define dovecotversion %(dnf install dovecot dovecot-devel; /usr/bin/rpm --queryformat \"%{VERSION}\" -q dovecot-devel | tr \".\")


And the workaround works in the sense that it does install dovecot-devel prior to execute the rpm --queryformat.
Comment 3 clime 2017-07-24 06:40:06 EDT
(In reply to Patrick Pichon from comment #2)
> For your information I have updated the statement:
> 
> From : 
> 
> %define dovecotversion %(/usr/bin/rpm --queryformat "%{VERSION}" -q
> dovecot-devel)
> 
> To :
> 
> %define dovecotversion %(dnf install dovecot dovecot-devel; /usr/bin/rpm
> --queryformat \"%{VERSION}\" -q dovecot-devel | tr \".\")
> 
> 
> And the workaround works in the sense that it does install dovecot-devel
> prior to execute the rpm --queryformat.

You can define additional buildroot packages that will be installed before srpm is built and put dovecot-devel there. In UI, this feature is accessible under Project Settings and clicking "Edit" button at a particular chroot (the field is called 'Packages').
Comment 4 Patrick Pichon 2017-07-24 07:52:30 EDT
(In reply to clime from comment #3)
> (In reply to Patrick Pichon from comment #2)
> > For your information I have updated the statement:
> > 
> > From : 
> > 
> > %define dovecotversion %(/usr/bin/rpm --queryformat "%{VERSION}" -q
> > dovecot-devel)
> > 
> > To :
> > 
> > %define dovecotversion %(dnf install dovecot dovecot-devel; /usr/bin/rpm
> > --queryformat \"%{VERSION}\" -q dovecot-devel | tr \".\")
> > 
> > 
> > And the workaround works in the sense that it does install dovecot-devel
> > prior to execute the rpm --queryformat.
> 
> You can define additional buildroot packages that will be installed before
> srpm is built and put dovecot-devel there. In UI, this feature is accessible
> under Project Settings and clicking "Edit" button at a particular chroot
> (the field is called 'Packages').

I do confirm! 
Thanks

Note You need to log in before you can comment on or make changes to this bug.