Pavel Raiskup <praiskup@redhat.com>
Copr Team
$ git clone https://github.com/praiskup/fedora-hatch-brno-2022 $ firefox fedora-hatch-brno-2022/index.html
$ sudo dnf install -y /usr/bin/copr # to fix
$ sudo dnf install -y fedora-packager # tooling
# Environment, usually ready...
$ sudo dnf install -y man man-pages dnf-plugins-core
$ man copr # says:
--timeout
Override timeout for this build.
How am I supposed to use this option???
https://src.fedoraproject.org/rpms/copr-cli
$ fedpkg clone -a copr-cli
$ cd copr-cli
$ fedpkg switch-branch
...
origin/f35
origin/f36
...
# ?? what branch ??
$ cat /etc/os-release | grep ^VERSION=
VERSION="36 (Workstation Edition)"
$ rpm --eval %dist
.fc36
$ rpm -q tar
$ uname --kernel-release
$ fedpkg switch-branch f36 # (git checkout f36)
$ ls
copr-cli.spec sources
$ cat sources
...
$ fepdkg sources # or copr-distgit-client
... downloading from Fedora DistGit ...
$ fedpkg prep
... extracts tarball, applies patches, etc. ...
$ # or rpmbuild -bp --define "_sourcedir $PWD" *.spec)
$ ls copr-cli*/ # YAY, sources!
$ fedpkg local
error: Failed build dependencies: ...
$ sudo dnf builddep *.spec
$ fedpkg local # retry
Wrote: /copr-cli/noarch/copr-cli-1.102-1.fc36.noarch.rpm
$ sudo dnf install /copr-cli/noarch/copr-cli-1.102-1.fc36.noarch.rpm
Nothing to do.
Complete!
$ sudo rpm -ivh /copr-cli/noarch/copr-cli-1.102-1.fc36.noarch.rpm
package copr-cli-1.102-1.fc36.noarch is already installed
$ sudo dnf reinstall ...
$ man copr # says:
--timeout
Override timeout for this build.
Source code to fix?
$ find copr-cli*/ -name '*man*'
copr-cli-1.102/man
$ ls copr-cli-1.102/man
copr.1 copr-cli.1.asciidoc
$ grep -ri "Override timeout for this build." . # alt
./copr-cli-1.102/man/copr-cli.1:Override timeout for this build\&.
./copr-cli-1.102/man/copr-cli.1.asciidoc:Override timeout for this build.
$ # backup!
$ cp copr-cli-1.102/man/copr-cli.1.asciidoc{,-backup}
$ copr build --help
...
--timeout TIMEOUT
Specify build timeout (seconds), if the build
takes longer than that, it is terminated and
fails. The default is usually set to 5 hours on
Copr Frontend.
$ vim copr-cli-1.102/man/copr-cli.1.asciidoc
$ diff -u copr-cli-1.102/man/copr-cli.1.asciidoc-backup \
copr-cli-1.102/man/copr-cli.1.asciidoc
...
$ diff -u copr-cli-1.102/man/copr-cli.1.asciidoc-backup \
copr-cli-1.102/man/copr-cli.1.asciidoc \
> man-page.patch
$ fedpkg local
...
Wrote: /tmp/copr-cli/noarch/copr-cli-1.102-2.fc36.noarch.rpm
$ sudo dnf install -y \
/tmp/copr-cli/noarch/copr-cli-1.102-2.fc36.noarch.rpm
...
Upgraded:
copr-cli-1.102-2.fc36.noarch
$ sudo dnf install -y mock
$ # User needs to be in a mock group!
$ sudo usermod -a -G mock praiskup
$ # Run the cross-distro build.
$ mock -r fedora-35-x86_64 --rebuild /copr-cli/copr-cli-1.102-2.fc36.src.rpm
...
Note! Dependencies are automatically installed.
$ vim copr-cli.spec # bump 2 > 3
$ fedpkg srpm
Wrote: /tmp/copr-cli/copr-cli-1.102-3.fc36.src.rpm
$ copr create my-first-package \
--chroot fedora-36-x86_64 \
--chroot fedora-35-x86_64
New project was successfully created:
https://copr.fedorainfracloud.org/coprs/praiskup/my-first-package/
$ copr build my-first-package \
/copr-cli/copr-cli-1.102-2.fc36.src.rpm
Build was added to my-first-package:
https://copr.fedorainfracloud.org/coprs/build/4720270
...
18:46:14 Build 4720270: succeeded
$ sudo dnf -y copr enable my-nick/my-first-package
$ sudo dnf -y update copr-cli # voilà
$ fedpkg clone -a PKGNAME && cd PKGNAME
$ fedpkg switch-branch fVERSION
$ fedpkg prep # and fix ..
$ fedpkg srpm
$ copr build PROJECT SRC.RPM
$ sudo dnf -y copr enable ME/MY_PROJECT
$ sudo dnf -y update PACKAGE
Find us on #fedora-buildsys channel