https://bugzilla.redhat.com/show_bug.cgi?id=1872867
--- Comment #2 from Jaroslav Škarvada jskarvad@redhat.com --- I took a first look:
- Version: %(grep ^VERSION ../Makefile | awk '{print $3}') This is not acceptable because there is no ../Makefile before the sources are downloaded and unpacked. The version tag has to be evaluable all the time even without sources.
- Source0: %{name}-%{version}.tar.xz This has to be full URL parseable by e.g. the 'spectool -g stalld.spec', for github you can e.g. use: Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
This will work if there is upstream github release with the tag 'v%{version}'.
If there is no upstream github release you can still package the snapshot, but it's bit more tricky, example:
# git hash of the snapshot %global git_commit f3905d3510dfb3851f946f097a9e2ddaa5fb333b # date when the snapshot was checked out / added to the spec %global git_date 20200828
%global git_short_commit %(echo %{git_commit} | cut -c -8) %global git_suffix %{git_date}git%{git_short_commit}
...
# for pre-release and no upstream version, use 0 Version: 0 # for pre-releases use 0.1, 0.2, .... Release: 0.1.%{git_suffix}%{?dist} ... URL: https://github.com/bristot/stalld Source0: %{url}/archive/%{git_commit}/%{name}-%{git_suffix}.tar.gz
Again 'spectool -g stalld.spec' has to handle it.
- BuildRequires needs to have 'all' requirements, e.g. the following are missing: gcc, make
- you shouldn't use 'rm -rf $RPM_BUILD_ROOT' just drop the line
- make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT -C redhat install
you should use: %make_install %make_install -C redhat
- I think you should support systemd presets (even if not used by your service) [1], i.e. add the following to the spec: BuildRequires: systemd-rpm-macros
... %post %systemd_post %{name}.service
%preun %systemd_preun %{name}.service
%postun %systemd_postun_with_restart %{name}.service
[1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syste...