Thanks for the quick help and for the mini-review.

I have updated the spec file as recommended, except for the %py_provides macro 
because COPR
did not like that when running the rpkg command:

Running: rpkg srpm --outdir /tmp/copr-rpmbuild-vtejek5l --spec 
/tmp/copr-rpmbuild-vtejek5l/obtain-sources/nocaselist/packaging/fedora/python-nocaselist.spec

cmd: ['rpkg', 'srpm', '--outdir', '/tmp/copr-rpmbuild-vtejek5l', '--spec', 
'/tmp/copr-rpmbuild-vtejek5l/obtain-sources/nocaselist/packaging/fedora/python-nocaselist.spec']
cwd: /tmp/copr-rpmbuild-vtejek5l/obtain-sources/nocaselist
rc: 0
stdout: Wrote: /tmp/copr-rpmbuild-vtejek5l/python-nocaselist.spec
stderr: error: line 34: Unknown tag: %py_provides python3-nocaselist
can't parse specfile

With the changed spec file (without %py_provides), the situation is still that 
Koji succeeds and
COPR fails with the same error as before:
Koji: https://koji.fedoraproject.org/koji/taskinfo?taskID=51724144 
<https://koji.fedoraproject.org/koji/taskinfo?taskID=51724144>
COPR: 
https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/build/1673307/
 
<https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/build/1673307/>

I understand what you said about the difference in the archives in the SRPM 
files, but I'm afraid
I don't quite understand how I can influence how COPR obtains the archive. In 
fact, even after
looking at the log files I don't understand where it gets the archive from.

In COPR, I am defining the package to be built from SCM, with rpkg for building 
the SRPM:
https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/package/python-nocaselist/
 
<https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/package/python-nocaselist/>
Is that the way to do it?

Also, as far as I'm concerned we do not necessarily need to get the COPR build 
to succeed,
as long as I can get the package review started by pointing to a Koji build. 
Please let me know.

Andy

> Begin forwarded message:
> 
> From: Robert-André Mauchin <zebo...@gmail.com>
> Subject: Re: Copr package build fails on python-nocaselist package
> Date: 18. September 2020 at 11:34:31 CEST
> To: Development discussions related to Fedora <devel@lists.fedoraproject.org>
> Reply-To: Development discussions related to Fedora 
> <devel@lists.fedoraproject.org>
> 
> On Friday, 18 September 2020 09:19:48 CEST Andreas R Maier wrote:
>> Hi,
>> I am new to building packages, and I'm trying to build a new package
>> 'python-nocaselist' on Copr, and it fails in the %prep stage when unpacking
>> the SRPM file because it cannot cd into the directory it assumes got
>> unpacked: Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.6rjfBt
>> + umask 022
>> + cd /builddir/build/BUILD
>> + cd /builddir/build/BUILD
>> + rm -rf nocaselist-1.0.2
>> + /usr/bin/gzip -dc /builddir/build/SOURCES/nocaselist-1.0.2.tar.gz
>> + /usr/bin/tar -xof -
>> + STATUS=0
>> + '[' 0 -ne 0 ']'
>> + cd nocaselist-1.0.2
>> /var/tmp/rpm-tmp.6rjfBt: line 39: cd: nocaselist-1.0.2: No such file or
>> directory I have configured copr to point to the Git repo and spec file.
>> 
>> The same spec file builds fine on Koji.
>> 
>> Spec file:
>> https://github.com/pywbem/nocaselist/blob/andy/fedora-packaging/packaging/f
>> edora/python-nocaselist.spec
>> <https://github.com/pywbem/nocaselist/blob/andy/fedora-packaging/packaging/ 
>> <https://github.com/pywbem/nocaselist/blob/andy/fedora-packaging/packaging/>
>> fedora/python-nocaselist.spec> Failing Copr build:
>> https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/build/1 
>> <https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/build/1>
>> 672638/
>> <https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/build/ 
>> <https://copr.fedorainfracloud.org/coprs/andymaier/python-nocaselist/build/>
>> 1672638/> Successful Koji build:
>> https://koji.fedoraproject.org/koji/taskinfo?taskID=51713400 
>> <https://koji.fedoraproject.org/koji/taskinfo?taskID=51713400>
>> <https://koji.fedoraproject.org/koji/taskinfo?taskID=51713400 
>> <https://koji.fedoraproject.org/koji/taskinfo?taskID=51713400>>
>> 
>> What am I doing wrong here?
>> 
>> Thanks for any help
>> Andy
> 
> The archives in your SRPM are different:
> - on COPR the root directory of your archive is python-%{srcname}-%{version}
> - on Koji the root directory of your archive is %{srcname}-%{version}
> 
> To download the true original archive from Pypi, use "spectool -g *.spec" in 
> the directory that contains your SPEC file.
> Then open the archive and see that the root of the archive is named %
> {srcname}-%{version} , like on Koji.
> To regenerate the SRPM, use: fedpkg --release f34 srpm in the directory that 
> contains your SPEC file.
> 
> Mini review:
> 
> - %{?python_enable_dependency_generator} not needed anymore, it's the 
> default.
> 
> - %{python3} setup.py build → %py3_build
> 
> - Not needed: rm -rf %{buildroot}
> 
> - env PYTHONPATH=%{buildroot}/%{python3_sitelib} \
>    %{python3} setup.py install -O1 --skip-build --root %{buildroot}
> 
>   → %py3_install
> 
> - The Python provide macro is not mandatory anymore on Rawhide and F33, but 
> below F33, you should add: %py_provides python3-%{srcname} to the python3-%
> {srcname} subpackage.
> 
> _______________________________________________
> devel mailing list -- devel@lists.fedoraproject.org 
> <mailto:devel@lists.fedoraproject.org>
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org 
> <mailto:devel-le...@lists.fedoraproject.org>
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/ 
> <https://docs.fedoraproject.org/en-US/project/code-of-conduct/>
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines 
> <https://fedoraproject.org/wiki/Mailing_list_guidelines>
> List Archives: 
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org 
> <https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org>
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to