Heyo,
I’m kinda struggling trying to create my first rpm package here. I’m using a new music player called Olivia (GitHub - keshavbhatt/olivia: Elegant music player for LINUX) as an example and this is what I have so far:
The first couple sections are quite clear by now (naming and versioning, release, summary, buildarch, licensing, url and source) , then it’s when it’s start getting confusing.
If i go to this app’s website/where the source code is stored on github the creator posted some instructions which are working in my case. To install from source in this case it’s just a matter of running qmake-qt5 and then make , this I tested and it works, once I do that I end up with a binary which i can run with ./
Now the first question is: to install from source there’s several methods depending on a lot of things, in this case it’s 2 commands. Do I always have to put those commands (whatever they are) under the %build section whenever I’m creating a new .spec file? In my spec file i added qmake-qt5 and make but I’m not really sure that’s the way it’s supposed to be written.
On another note, for the BuildRequires dependencies I just checked the exact name of the packages that were required with “yum whatprovides name-of-package-required” and added that package to the requirement. Is that fine or something else needs to be done here?
And lastly and probably most important, what’s the difference between the %build and %install sections? I’m not really sure about my install section in this example, didn’t look much into it cause I was already struggling with the rest.
Apologies for the long post, the information on how to do packaging seems either too simple (some hello world script) or overcomplicated.
Name: olivia
Version: 1
Release: 1%{?dist}
Summary: A cool and new music player
BuildArch: noarch
License: MIT
URL: https://github.com/keshavbhatt/olivia
Source0: %{name}.tar.gz
BuildRequires: qt5-devel
BuildRequires: coreutils
BuildRequires: socat
BuildRequires: python
BuildRequires: wget
%description
Cool new music player
%prep
%setup -q
%build
qmake-qt5
make
%install
mkdir -p %{buildroot}%{_bindir}
install -p -m 755 %{name} %{buildroot}%{_bindir}/%{name}
%files
%changelog