Hello,

if you are using SCM source type with rpkg source build method, then this
is message is especially for you. Since rpkg version 2, the auto-packing
functionality has been deprecated in favor of spec templates. Auto-packing
means that when building from a Git repo, the content of this repo gets
automatically packed into a tarball named according to Source0 definition
in a spec file.

The spec file and the packed tarball are then taken together to create an
srpm, from which rpms are built afterwards.

This functionality, which was originally taken from mock-scm plugin is now
deprecated in rpkg in favor of spec templates. With spec templates, there
is another way to achieve the same - putting an explicit directive into the
spec which says: "hey man, please, pack this and that directory and replace
me with the resulting tarball filename". Example looks like this:

Name:       {{{ git_name }}}
Version:    {{{ git_version }}}
Release:    1%{?dist}
Summary:    This is a test package.

License:    GPLv2+
URL:        https://someurl.org
VCS:        {{{ git_vcs }}}

Source:     {{{ git_pack }}}


You can see there are several {{{ ... }}} tags, which are rpkg's special
macros. The one that packs the sources (the functionality previously
provided by auto-packing) is {{{ git_pack }}}. This macro will pack the the
repository content and replaces itself with the resulting tarball name.
Similar replacements happen for all the other {{{ ... }}} tags as well
until the spec is a fully valid rpm spec file. This rendered spec file is
then taken with the generated tarball and the srpm is built.

You may notice the {{{ git_pack }}} macro is different from all the others
because it has a side-effect, which is the tarball generation.

Note that auto-packing will be kept working for some time but you will be
getting the following notice in the srpm builder-live.log like:

cmd: ['rpkg', '-C', '/etc/rpkg.conf', 'srpm', '--outdir',
'/var/lib/copr-rpmbuild/results/tmptov9ctr1', '--spec',
'/tmp/tmpdgwt9w7b/corrade/package/rpm/corrade.spec']
cwd: /tmp/tmpdgwt9w7b/corrade/package/rpm
rc: 0
stdout: Wrote: /var/lib/copr-rpmbuild/results/tmptov9ctr1/corrade.spec
Wrote: /var/lib/copr-rpmbuild/results/tmptov9ctr1/corrade-0.2.tar.gz
Wrote: /var/lib/copr-rpmbuild/results/tmptov9ctr1/corrade-0.2-1.src.rpm
stderr: Auto-packing is deprecated and will be removed in a future
release.      <----

Output: ['corrade-0.2.tar.gz', 'corrade-0.2-1.src.rpm', 'corrade.spec']

Don't worry though, it's gonna stay there for quite some time. Still, we
would recommend to try the spec templates out already because you might
find them interesting and useful. More docs about spec templates are here:
- https://pagure.io/rpkg-util
- https://docs.pagure.org/rpkg-util/

Some projects that already use it are:
- https://github.com/FreeCAD/FreeCAD/blob/master/package/fedora/freecad.spec
- https://pagure.io/copr/copr/blob/master/f/prunerepo/prunerepo.spec

At some point, we will be opening pull requests against upstream projects
that use SCM+rpkg but still use auto-packing but that's still quite far
away.

Thank you
Copr team
_______________________________________________
copr-devel mailing list -- copr-devel@lists.fedorahosted.org
To unsubscribe send an email to copr-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/copr-devel@lists.fedorahosted.org/message/QNXS45XTMJ2EJTDKM7LCYDIUSUR4RPJD/

Reply via email to