Re: Request assistance getting a package (usbrelay) into Fedora

2022-01-18 Thread Mark E. Fuller

Hi Darryl,

My emails keep bouncing when I try to write to you directly.

I'll try to block off some time in the coming week to take a stab at 
drafting a package for usbrelay and then get back to you.


Looking forward to working with you.
In the meantime, please send me a message directly so we can move off 
the list.


Best,
fuller

Mark E. Fuller, Ph.D.
ful...@fedoraproject.org
ful...@stossrohr.net
@fuller:one.ems.host
https://www.stossrohr.net
PGP Fingerprint: 73F1 A30C BDF4 DB4B C75F FD0F D599 E76C FFCA BF60

On 18/01/2022 5:04, Darryl Bond wrote:

Mark,
  Petr's suggestion I find a co maintainer sounds very sensible. It's unlikely 
I'll need to do any other package. I would be pleased to assist you if you 
chose to be that person.

Darryl
___
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


OpenPGP_0xD599E76CFFCABF60.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature
___
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


Re: Request assistance getting a package (usbrelay) into Fedora

2022-01-17 Thread Darryl Bond
Mark,
 Petr's suggestion I find a co maintainer sounds very sensible. It's unlikely 
I'll need to do any other package. I would be pleased to assist you if you 
chose to be that person.

Darryl
___
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


Re: Request assistance getting a package (usbrelay) into Fedora

2022-01-17 Thread Artur Frenszek-Iwicki
Hi, Darryl.

> How to clone the GitHub repository in the spec file
RPM packages are build from Source files. You don't clone the repository in the 
spec;
rather, you download the repository as a tarball and use that. For GitHub, you 
can download
a specific git tag (or commit) by using the following URL as a source:
  
https://github.com/darrylb123/usbrelay/archive/%{tag_or_commit}/usbrelay-%{tag_or_commit}.tar.gz

> should there be one package or a separate python package
If the python bindings are usable without the command-line application,
or if the application is usable without the python interface - it can be done.
You don't need to create a separate .spec file; rather, you can build the python
package as a sub-package.

For what it's worth, back in the day I wrote a couple of posts on my blog
that aim to explain some basics of RPM packaging.
Maybe you'll find them useful.
- https://blog.svgames.pl/article/basics-of-rpm-packaging
- https://blog.svgames.pl/article/building-multiple-packages-with-rpm

A.FI.
___
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


Re: Request assistance getting a package (usbrelay) into Fedora

2022-01-17 Thread Petr Menšík
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


Re: Request assistance getting a package (usbrelay) into Fedora

2022-01-17 Thread Mark E. Fuller
I used this software some years ago during my PhD, although ultimately 
didn't go very far with it (decided against writing my own automation 
system and outsourced it to an undergrad with LabVIEW...).


I would be happy to take a look (especially if I can find that little 
USB relay again I was having so much fun playing with).


Best,
Fuller

Mark E. Fuller, Ph.D.
ful...@fedoraproject.org
ful...@stossrohr.net
@fuller:one.ems.host
https://www.stossrohr.net
PGP Fingerprint: 73F1 A30C BDF4 DB4B C75F FD0F D599 E76C FFCA BF60

On 17/01/2022 12: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
- should there be one package or a separate python package.
- what about the daemon/ systemd service...

Any help greatly appreciated

Darryl
___
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


OpenPGP_0xD599E76CFFCABF60.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature
___
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


Re: Request assistance getting a package (usbrelay) into Fedora

2022-01-17 Thread Fabio Valentini
On Mon, Jan 17, 2022 at 11:44 AM 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.

Hi!

> Questions on Issues like:

Maybe I am able to answer some of your questions.

> - How to clone the GitHub repository in the spec file

Short answer: You don't. RPM packages are (usually) built from
declarative "Source" files, not by manually executing steps to get
those sources.
In this case, you would use the standard git archive / tarball
provided by GitHub for the release you want to package, with a
parametrized URL like this one:

URL: https://github.com/darrylb123/usbrelay
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

This makes it possible to only change the version string in one place
and not having to update the Source URLs etc. too.

Then for Fedora packages, "spectool" is the tool used to download /
prepare those source files before building a source package.
"spectool -g usbrelay.spec" will parse your .spec file and download
the files from the URLs specified with Source0, Source1, etc.
"rpmbuild -bs usbrelay.spec" will then construct your source package,
assuming you place the files in the expected locations on file system.
"mock usbrelay-0.8-1.fc35.src.rpm" will then build your packages in
the standard clean sandbox that's used by all Fedora RPM builds.

> - should there be one package or a separate python package.

That depends on the use case. Are the python bindings useful without
the command line interface?
Does the command line interface depend on the python bindings anyway?
If they are useful without each other, building a "python3-usbrelay"
package from the same "usbrelay" package is possible, you do not need
to create separate .spec files for that.

> - what about the daemon/ systemd service...

Same applies here. If the application is useful without the
daemon+service, I'd split those off into a separate sub-package too.

Fabio
___
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