Hi Darryl,

if you have all sources in single repository then only one source
package should exist for them. That means one spec file, which can
contain multiple sub-packages produced on build. But input should still
be single if they come from single repository.

You can build both python and native code from single spec file. It you
have never worked with RPM, I would recommend finding someone interested
as co-maintainer. You would have to create a package review and obtain a
sponsor to own your own package in Fedora.

To start RPM packaging, I would suggest reading [1]. Also packaging
guidelines [2] of course. Or just copy and modify existing spec. I think
my sep review [3] might be useful inspiration to you. It contains both
python and cmake builds. Your project uses just make, so %make_build and
%make_install would be used instead. Spec file is a recipe to build an
RPM package, it would need only source archive in addition.

1. https://rpm-packaging-guide.github.io/
2. https://docs.fedoraproject.org/en-US/packaging-guidelines/
3. https://bugzilla.redhat.com/show_bug.cgi?id=2029677

On 1/17/22 11:43, Darryl Bond wrote:
> Hello,
> I maintain a small application hosted on GitHub. 
> (https://github.com/darrylb123/usbrelay)
> It allows control of USB connected electrical relays. Originally it was a 
> simple command line application.
> Over the years, it has accumulated additional features such as a python 
> interface, and an mqtt daemon.
> There is a debian package that has not been maintained for many years. We are 
> endeavouring to fix that.
> As a long term Fedora user, I would love to get it into Fedora. However I 
> have never attempted to create an rpm package. The more I read, the more 
> confused I am. 
>
> Questions on Issues like:
> - How to clone the GitHub repository in the spec file
Spec file does not clone github repository in any way. Source rpm
package contains spec file and source code archive. In case of github,
it would be obtained from a release tag. Some smart url can be used from
github to download tar.gz source archive, from which the code would be
built. If you look on sep [3] example, %forgemeta macro with %forgeurl0
make it easy and it would choose correct %forgesource automagically.
> - should there be one package or a separate python package.
It makes sense to package python3-usbrelay and usbrelay separately. But
both would be built from single source.
> - what about the daemon/ systemd service...

If you do not have separate library and utilities, keep systemd service
together with utilities. If library with devel package exists, it should
be separate from utilities/daemons. If you have shared library, I think
you should have 4 subpackages in total.

- usbrelay (utility and daemon)
- usbrelay-libs (shared library)
- usbrelay-devel (header files and usbrelay.so)
- python3-usbrelay (python module)

>
> Any help greatly appreciated
>
> Darryl
Regards,
Petr

-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemen...@redhat.com
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to