I'd like to improve the distribution and versioning of a program I've inherited, which is currently distributed as a .tar.gz
file, by building a .rpm
for RHEL7 that just extracts the contents to /usr/bin/
. The tarball is not small, consisting in around 120 MB worth of files.
I'm new around package building so I've been following the bello
example from https://rpm-packaging-guide.github.io, but the example is too simple for my needs.
So far I have this .spec
file:
Name: my-app
Version: 2.0
Release: 1%{?dist}
Summary: My application
License: Internal license
URL: <my-website>
Source0: <my-website>/%{name}-%{version}.rhel7.x86_64.tar.gz
Requires: bash
BuildArch: x86_64
%description
My application
%prep
%setup -q
%build
%install
mkdir -p %{buildroot}/%{_bindir}
install -m 0755 %{name} %{buildroot}/%{_bindir}/%{name}
%files
%{_bindir}/%{name}
Which generates a very small .rpm
with just /usr/bin/my-app
. On installation if complains about many missing dependencies that are inside the tarball's lib
directory, but of course not in my package.
As far as I understand, the %files
directive must contain a list of all the files that are supposed to be inside the .rpm
, but those are hundreds. So I'm assuming there's a better way to build the package, after all is just decompressing the tarball.
Do you have any pointers?