Looking for review for my first RPM package

I’m learning how to create RPM packages and I finally made my first package. The package seems to work so I’m looking for people that will help me learn what can be improved before I try to put it in Copr and maybe the official repository in the future.

This is the spec file: https://paste.fedoraproject.org/paste/eN-LpiZYn-C8L4iP3FjYVQ


Just two quick notes:

  1. If your Source0 & Source1 provide the same package just in different formats, remove Source1.
  2. The changelog section in .spec should contain .spec changelog and not the source changelog. I’m not sure but it seems that you’ve included the source changelog

Thanks for the suggestions, I will fix them.
Should I prefer tar.gz or zip? and when will I use the second source?

Welcome to RPM packaging!

The packaging guidelines have specific notes on how to format your SourceURL from a GitHub tag. There is a ton of great info in the packaging guide, you should read the rest of it as well.

Just a heads up, ccls has already been submitted for official review and approved within the last few days. It shouldn’t be long before it’s available in the repos. When you are looking to package something up I suggest checking the Review Tracker first just in case it’s already been submitted.

Even though your spec file won’t be necessary, I encourage you to keep going with packaging. I suggest comparing your spec file with the one that was approved to find possible areas to improve.

Usually tar.gz is preferred, but it depends. Sometimes they are completely identical, but sometimes tar.gz one is more suited to a Unix-like environment (e.g. proper file permissions). If the result is OK anyway, you can select the one you personally prefer.

Multiple Source lines are needed when there is actually more than a single source with complementary contents: e.g. foo.tar.gz & foo-data.tar.gz


Line 1 & 2

%global commit0 7b3aca2952285338ce9472c63a73eebf622afd13
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})


Source0: https://github.com/MaskRay/ccls/archive/0.20181111.1.tar.gz


Source0: https://github.com/MaskRay/ccls/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz

Deletes Source1… Isn’t necessary.