2020-03-18 01:44:30 +01:00
# Contributing
## How to contribute
2020-03-18 02:14:44 +01:00
src_prepare-overlay is very open to contribution and encourages it.
2020-03-18 03:28:11 +01:00
There are several ways to contribute to this overlay:
2020-03-18 02:14:44 +01:00
2020-09-11 14:35:43 +02:00
#### Submitting an issue
2020-03-18 01:44:30 +01:00
2020-03-18 02:14:44 +01:00
Those that do not have good knowledge in writing ebuilds can
2020-09-11 14:35:43 +02:00
[submit an issue ](https://gitlab.com/src_prepare/src_prepare-overlay/-/issues )
2020-03-18 02:14:44 +01:00
so we can create the ebuild and maintain it for the community.
2020-09-11 14:35:43 +02:00
Before submitting an issue, you will have to read the [submitting an issue guidelines ](#submitting-an-issue-1 ).
2020-03-18 02:14:44 +01:00
2020-09-11 14:35:43 +02:00
#### Submitting Merge Requests
2020-03-18 01:44:30 +01:00
2020-03-18 03:28:11 +01:00
Those that want to help us easily maintain an ebuild without making us spend our time creating the ebuild
2020-09-11 14:35:43 +02:00
can create the ebuild and submit a [merge request ](https://gitlab.com/src_prepare/src_prepare-overlay/-/merge_requests )
2020-03-18 03:28:11 +01:00
so we can accept and add the ebuild to our overlay and maintain it for you.
2020-09-11 14:35:43 +02:00
Before submitting a merge request, you will have to read the [submitting merge requests guidelines ](#submitting-merge-requests-1 ).
2020-03-18 02:14:44 +01:00
2020-03-18 01:44:30 +01:00
## Contributing guidelines
2020-03-18 03:01:23 +01:00
Before contributing, you will have to read the contributing guidelines as we will **not** accept your request
if you do not respect our community guidelines.
2020-09-11 14:35:43 +02:00
**Before submitting an issue or submitting a Merge Request,
2020-03-18 03:32:44 +01:00
first check if the package you are providing is not in [TODO.md ](/TODO.md ).**
2020-09-11 14:35:43 +02:00
#### Submitting an issue
2020-03-18 01:44:30 +01:00
2020-09-11 14:35:43 +02:00
When submitting an issue you will have to provide:
2020-03-18 03:28:11 +01:00
2020-09-11 14:38:13 +02:00
- `category/package` (e.g. `www-client/icecat` )
2020-03-18 03:28:11 +01:00
- the description of the package
2020-09-30 16:21:53 +02:00
- the home page of the package
- OPTIONAL: the direct download link of the package
2020-03-18 03:28:11 +01:00
- the license of the package (e.g. GPLv2)
2020-09-11 14:35:43 +02:00
by submitting the skeleton of the ebuild in quotes:
2020-03-18 03:01:23 +01:00
```
2020-03-18 03:28:11 +01:00
NAME=""
2020-03-18 03:01:23 +01:00
2020-09-30 16:21:53 +02:00
DESCRIPTION=""
HOMEPAGE=""
SRC_URI=""
LICENSE=""
2020-03-18 03:01:23 +01:00
```
2020-09-11 14:35:43 +02:00
After this, you can safely submit the issue, and we will take care of it.
2020-03-18 03:01:23 +01:00
2020-09-11 14:35:43 +02:00
#### Submitting Merge Requests
2020-03-18 03:01:23 +01:00
2020-09-11 14:35:43 +02:00
When committing and/or submitting merge requests, you will have to respect our
Committing & Submitting Merge Requests System (CnPMRS)
2020-03-18 03:01:23 +01:00
so we can easily identify the changes:
- Provide us the Manifest file;
2020-09-11 14:35:43 +02:00
- Follow the committing & submitting merge request layout (below).
2020-03-18 03:01:23 +01:00
Each commit will have to be based on this layout:
2020-09-11 14:38:13 +02:00
`category/package: [COMMIT_MESSAGE]`
2020-03-18 03:01:23 +01:00
For example, if the package is called **mail-client/freelook-bin** ,
and you have added this package, the commit or merge request should look like this:
`mail-client/freelook-bin: add freelook-bin-[PACKAGE_VERSION]` # e.g. 1.0.0
For example, if the package is called **mail-client/freelook-bin** ,
and you have fixed an error, the commit or merge request should look like this:
`mail-client/freelook-bin: fix QA - EROOT missing slash`
2020-09-28 14:16:25 +02:00
**This system also applies on your metadata.xml and Manifest.**
## Development workflow
### Add the overlay to the system
Edit /etc/portage/repos.conf/src_prepare-overlay.conf (as root)
```toml
[src_prepare-overlay]
auto-sync = yes
location = /var/db/repos/src_prepare-overlay
sync-git-clone-extra-opts = --depth=999999999 --no-shallow-submodules --no-single-branch --verbose
sync-git-pull-extra-opts = --depth=999999999 --verbose
sync-type = git
sync-uri = git@gitlab.com:src_prepare/src_prepare-overlay.git
sync-user = < your_user_developer > :portage
```
If you dont have write access to the cloned branch yet use "sync-uri = https://gitlab.com/src_prepare/src_prepare-overlay.git" instead.
### Sync the overlay
As root
```bash
emaint sync -r src_prepare-overlay
```
### Add new package
#### Basics
As user
```bash
cd /var/db/repos/src_prepare-overlay
mkdir -p category/package-name
cd category/package-name
touch metadata.xml
touch package-name-package-version.ebuild
```
Now edit the ebuild and metadata files accordingly.
2020-09-28 14:23:31 +02:00
[For ebuild developemnt details look here ](https://devmanual.gentoo.org/ )
2020-09-28 14:16:25 +02:00
#### Tests
If a package's upstream has tests don't forget to enable them.
If they fail describe why in the comments inside the ebuild
(but please make the descriptions reasonably short).
##### Package testing
Make sure you have FEATURES="test" enabled in the make.conf
```bash
2020-09-30 16:21:53 +02:00
if ! grep test /etc/portage/make.conf
then
echo 'FEATURES="${FEATURES} test"' >> /etc/portage/make.conf
fi
2020-09-28 14:16:25 +02:00
```
And then, as root
```bash
2020-09-28 14:23:31 +02:00
echo "category/package-name test" >> /etc/portage/package.use/development-tests
2020-09-28 14:16:25 +02:00
```
##### Ebuild testing
repoman (app-portage/repoman) and pkgcheck (dev-util/pkgcheck)
will give you a report of what should be fixed.
```bash
repoman -Idx full
pkgcheck scan
```
#### Metadata
metadata.xml should contain at least these lines:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
< pkgmetadata >
< upstream >
< remote-id type = "githosting" > organization-or-user/package< / remote-id >
< / upstream >
< / pkgmetadata >
```
Adjust the "type" and "organization-or-user/package" accordingly.
#### Installation
If the (system wide) repository is set up correctly you should be able to just emerge the package you added right away
```bash
2020-09-30 16:21:53 +02:00
emegre --ask --jobs=1 --oneshot --quiet-build=n --verbose category/package-name
2020-09-28 14:16:25 +02:00
```
#### Git
2020-09-28 14:23:31 +02:00
Follow the rules described in ["Submitting Merge Requests" ](#submitting-merge-requests-1 ) section.
2020-09-30 16:21:53 +02:00
GPG signing is not required but encouraged. Gentoo Wiki provides a great example [on creating a strong key ](https://wiki.gentoo.org/wiki/Project:Infrastructure/Generating_GLEP_63_based_OpenPGP_keys ).