This repository contains spec files for Fedora builds of Pylatest, created with the help of pyp2rpm tool.
Builds (rpm packages) are available in marbu/pylatest Copr repository.
This section assumes that you have your system configured as described in Preparing your system to create RPM packages.
First of all, you need a sdist tarball. You can either download one for the latest stable release from PyPI via pip:
$ pip download pylatest --no-deps -d .
Or you can generate one yourself from the sources like this:
$ cd ~/projects/ $ git clone https://gitlab.com/mbukatov/pylatest.git $ git checkout v0.1.1 $ python3 setup.py sdist
Copy the specfile and sdist tarball into rpmbuild directory tree:
$ cp ~/projects/pylatest/dist/pylatest-0.1.1.tar.gz ~/rpmbuild/SOURCES $ cp python-pylatest.fedora.spec ~/rpmbuild/SPECS
So that we can generate the source rpm:
$ cd ~/rpmbuild/SPECS $ rpmbuild -bs python-pylatest.fedora.spec $ ls ~/rpmbuild/SRPMS python-pylatest-0.1.1-1.fc26.src.rpm
Which we can build it locally with mock:
$ cd ~/rpmbuild/SPECS $ mock -r fedora-26-x86_64 --rebuild python-pylatest-0.1.1-1.fc26.src.rpm
Note: mock does the build in clean chroot enviroment and it's used both by koji and copr.
When the build finishes with success, the rpm packages can be found in the result directory:
$ ls /var/lib/mock/fedora-26-x86_64/result/ build.log hw_info.log installed_pkgs.log python-pylatest-0.1.1-1.fc26.src.rpm python2-pylatest-0.1.1-1.fc26.noarch.rpm python3-pylatest-0.1.1-1.fc26.noarch.rpm root.log state.log
Here we assume that we aready have a Copr project where you would like to build the package.
Assuming you have copr-cli tool configured, we can just upload the source rpm file (we just created in previous section) into the copr project:
$ copr-cli build -r fedora-25-x86_64 -r fedora-26-x86_64 pylatest ~/rpmbuild/SRPMS/python-pylatest-0.1.1-1.fc26.src.rpm
Create new package in the copr project via web ui and select SCM
build
source type. For this pylatest-copr project, I'm currently using git
and
rhpkg
options.
For another full example of this approach, see Automate RPM Builds from Git Sources using COPR.
Distributed under the terms of the GNU GPL v3.0 license, pylatest-copr is free and open source software.
Note that the license is selected to match license of Pylatest project, which follows a general rule that specfile is licensed in the same way as source code itself.