|
1 | 1 | # COPR Guide |
2 | 2 |
|
3 | | -This repository is prepared for COPR builds with the `SCM` source type and the |
4 | | -`make srpm` workflow. |
| 3 | +This repository is prepared for COPR builds using the **SCM source type** and |
| 4 | +the **make srpm** SRPM generation method. |
5 | 5 |
|
6 | | -## Build Method |
| 6 | +## Why `make srpm` instead of `rpkg`? |
7 | 7 |
|
8 | | -Use `make srpm` for this project. |
| 8 | +Use `make srpm` for this repository. |
9 | 9 |
|
10 | | -Why: |
| 10 | +Reason: |
11 | 11 |
|
12 | | -1. This is the upstream application repository, not a DistGit-style packaging repository. |
13 | | -2. The provided `.copr/Makefile` creates the source archive directly from the checked-out tree. |
14 | | -3. The workflow stays explicit, reproducible, and compatible with GitHub-triggered COPR builds. |
| 12 | +1. This is an upstream application repository, not a dedicated DistGit-style |
| 13 | + `rpkg` repository. |
| 14 | +2. COPR documents that `rpkg` is the default SCM method, but it also notes |
| 15 | + that modern `rpkg` workflows expect rpkg-util v3 templating conventions. |
| 16 | +3. `make srpm` lets us generate the exact source archive from the checked out |
| 17 | + tree and then call `rpmbuild -bs` ourselves. |
| 18 | +4. That keeps the packaging logic simple and explicit for GitHub webhook builds. |
15 | 19 |
|
16 | | -Files used by COPR: |
| 20 | +Relevant official COPR documentation: |
| 21 | + |
| 22 | +- SCM source type and SRPM build methods: |
| 23 | + https://docs.pagure.org/copr.copr/user_documentation.html |
| 24 | +- Local package building with `rpkg`: |
| 25 | + https://docs.pagure.org/copr.copr/building_package.html |
| 26 | + |
| 27 | +## Files Used by COPR |
17 | 28 |
|
18 | 29 | - `ro-installer.spec` |
19 | 30 | - `.copr/Makefile` |
20 | 31 | - `LICENSE` |
21 | 32 |
|
22 | | -Command executed by COPR: |
| 33 | +The Makefile target that COPR runs is: |
23 | 34 |
|
24 | 35 | ```bash |
25 | 36 | make -f .copr/Makefile srpm outdir="<outdir>" spec="ro-installer.spec" |
26 | 37 | ``` |
27 | 38 |
|
28 | | -## COPR Package Settings |
| 39 | +That target: |
| 40 | + |
| 41 | +1. reads `Name` and `Version` from the spec file |
| 42 | +2. creates `ro-installer-<version>.tar.gz` from the checked out source tree |
| 43 | +3. runs `rpmbuild -bs` |
| 44 | +4. places the resulting `.src.rpm` into `outdir` |
| 45 | + |
| 46 | +Important: |
| 47 | + |
| 48 | +- COPR runs `make srpm` in a minimal source chroot |
| 49 | +- do not assume tools like `git` are available there |
| 50 | +- the provided `.copr/Makefile` therefore uses `cp` and `tar`, not `git archive` |
| 51 | + |
| 52 | +## How to Configure COPR |
| 53 | + |
| 54 | +Create or edit the package in COPR with these settings: |
| 55 | + |
| 56 | +1. **Source Type**: `SCM` |
| 57 | +2. **SCM Type**: `git` |
| 58 | +3. **Clone URL**: |
| 59 | + `https://github.com/Project-Ro-ASD/ro-Installer.git` |
| 60 | +4. **Committish**: |
| 61 | + `main` |
| 62 | +5. **Subdirectory**: |
| 63 | + leave empty |
| 64 | +6. **Spec File**: |
| 65 | + `ro-installer.spec` |
| 66 | +7. **SRPM Build Method**: |
| 67 | + `make srpm` |
| 68 | +8. **Auto-rebuild**: |
| 69 | + enable it |
29 | 70 |
|
30 | | -Configure the package with these values: |
| 71 | +## GitHub Webhook Setup |
31 | 72 |
|
32 | | -1. `Source Type`: `SCM` |
33 | | -2. `SCM Type`: `git` |
34 | | -3. `Clone URL`: `https://github.com/Project-Ro-ASD/ro-Installer.git` |
35 | | -4. `Committish`: `main` |
36 | | -5. `Subdirectory`: leave empty |
37 | | -6. `Spec File`: `ro-installer.spec` |
38 | | -7. `SRPM Build Method`: `make srpm` |
39 | | -8. `Auto-rebuild`: enabled |
| 73 | +Once the SCM package exists in COPR: |
40 | 74 |
|
41 | | -## GitHub Webhook |
| 75 | +1. Open the COPR project |
| 76 | +2. Go to **Settings** -> **Integrations** |
| 77 | +3. Copy the GitHub webhook URL |
| 78 | +4. In GitHub open: |
| 79 | + `Settings -> Webhooks -> Add webhook` |
| 80 | +5. Paste the COPR webhook URL as **Payload URL** |
| 81 | +6. Set **Content type** to `application/json` |
| 82 | +7. Enable push events |
| 83 | +8. Save |
42 | 84 |
|
43 | | -After creating the SCM package in COPR: |
| 85 | +Official COPR GitHub webhook documentation: |
44 | 86 |
|
45 | | -1. Open the COPR project. |
46 | | -2. Go to `Settings -> Integrations`. |
47 | | -3. Copy the GitHub webhook URL. |
48 | | -4. In GitHub open `Settings -> Webhooks -> Add webhook`. |
49 | | -5. Paste the COPR URL into `Payload URL`. |
50 | | -6. Set content type to `application/json`. |
51 | | -7. Enable push events and save. |
| 87 | +- https://docs.pagure.org/copr.copr/user_documentation.html |
52 | 88 |
|
53 | | -## Local SRPM Test |
| 89 | +## Local Test Workflow |
| 90 | + |
| 91 | +If you want to test the SRPM generation locally: |
54 | 92 |
|
55 | 93 | ```bash |
56 | 94 | mkdir -p dist |
57 | 95 | make -f .copr/Makefile srpm outdir="$PWD/dist" spec="ro-installer.spec" |
58 | 96 | ``` |
59 | 97 |
|
60 | | -Expected output for the current release: |
| 98 | +That should produce: |
61 | 99 |
|
62 | | -- `dist/ro-installer-3.0.0.tar.gz` |
63 | | -- `dist/ro-installer-3.0.0-1*.src.rpm` |
| 100 | +- `dist/ro-installer-1.2.7.tar.gz` |
| 101 | +- `dist/ro-installer-1.2.7-1*.src.rpm` |
64 | 102 |
|
65 | | -Optional local rebuild with `mock`: |
| 103 | +If `mock` is available, rebuild the SRPM locally: |
66 | 104 |
|
67 | 105 | ```bash |
68 | 106 | mock -r fedora-rawhide-x86_64 --rebuild dist/*.src.rpm |
69 | 107 | ``` |
70 | 108 |
|
71 | | -## Note About Flutter |
| 109 | +## Important Dependency Note |
| 110 | + |
| 111 | +The spec currently uses: |
| 112 | + |
| 113 | +```spec |
| 114 | +BuildRequires: flutter |
| 115 | +``` |
| 116 | + |
| 117 | +This means the selected COPR chroot must have an RPM package providing the |
| 118 | +Flutter SDK. If your target chroot does not provide `flutter`, the build will |
| 119 | +fail before compilation starts. |
| 120 | + |
| 121 | +In that case you need one of these: |
| 122 | + |
| 123 | +1. an additional repository enabled in COPR that provides `flutter` |
| 124 | +2. a dedicated COPR package for `flutter` |
72 | 125 |
|
73 | | -The RPM build expects a Fedora-compatible environment with the required build |
74 | | -dependencies available to the spec. Keep the build declarative and avoid adding |
75 | | -ad-hoc downloads outside the packaging workflow. |
| 126 | +Do not rely on downloading Flutter from the Internet during `%build`; keep the |
| 127 | +build declarative and reproducible. |
0 commit comments