My general task is to put all the libraries from my software together with the executable software in a rpm file. My alternative way was to use a bash script which is putting all the libraries in the specified folders in CentOS. Also the dependencies of external packages like libraries that come from the yum package library need to be installied (e.g. yum apt-get install freeglut). Now I want only to use one rpm file that does everything for me, copying the libraries in the right folders, add the yum files too and that i can start the executable without any problems.
I read about creating rpm files in CentOS and my first try was to create the spec file. From https://stackoverflow.com/a/1165200/7105824 I found a minimal example:
Summary: A very simple toy bin rpm package
Name: toybinprog
Version: 1.0
Release: 1
License: GPL+
Group: Development/Tools
SOURCE0 : %{name}-%{version}.tar.gz
URL: http://toybinprog.company.com/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
%{summary}
%prep
%setup -q
%build
# Empty section.
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
# in builddir
cp -a * %{buildroot}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%{_bindir}/*
%changelog
* Thu Apr 24 2009 Elia Pinto <devzero2000@rpm5.org> 1.0-1
- First Build
In the macro %files, i can just put all the files inside. Is it also possible to put there the folder with the content of libraries inside than putting all 100 libraries extra? The next question is that I dont understand, what the macrro %SOURCE0 is doing.. What is the tar file that I have to put here? Maybe someone can make it clear for me what i have to do for my problem in an easy understandable way.
Thanks Everyone!