How to create a rpm package for a rust binary which can be run as systemd service

I want to create it manually using rpm dev tools by writing a spec .
Facing few errors while doing it .
Can some one give a step by step info to make sure it works

Let's split your task into several parts:

First, create a systemd daemon:

Install it manually by copying your unit file into the appropriate directory. Make sure it works.

Then, try to pack it: How to create a Linux RPM package , https://www.develeap.com/The-Art-of-RPM-Crafting-Packages-in-Linux/