Hello,
I have been following various guides on the internet to see how to build a simple RPM. I think I've got the general idea, but when it comes to editing the spec file they all seem to have a different idea, and some of them goive spec file examples that don't look like the skeleton specfile I have.
I am using rpmdevtools-7.5-2 (x86). My simple demo spec file is below:
Code:
Name: Hello
Version: 1.0
Release: 1%{?dist}
Summary: A script to shout a brother yo
Group: Amusements/Games
License: GPL
URL: http://google.com
Source0: /home/rpmbuilder/rpmbuild/SOURCES/hello.tar.gz
BuildArch: noarch
BuildRoot /tmp
#BuildRequires:
#Requires:
%description
My test rpm thing
%prep
%setup -q
%build
#%configure
#make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
#make install DESTDIR=$RPM_BUILD_ROOT
install -d 0755 $RPM_BUILD_ROOT/usr/bin
install -m 0755 hello.sh $RPM_BUILD_ROOT/usr/bin
%clean
rm -rf $RPM_BUILD_ROOT
%files
%dir /usr/bin
%defattr(-,root,root,-)
/usr/bin/hello.sh
%doc
%changelog
So what I've done here is-
rpmdev-setuptree to create the build tree (BUILD, SOURCES, SPECS and so on)
Wrote a bash script containing 'echo "Hello World"' and turn it into an executable called hello.sh
Then I've tar/gzipped that into SOURCES directory
tar -cvzf SOURCES/hello.tar.gz hello.sh
Then ran rpmdev-newspec and populated it with the basic information in the quote above. I'm not bothered about URL being google.com, and I think (at least rpmbuild hasn't compolained about using path to the SOURCE directory as Source0.
But two problems I see, BuildRoot- as there's no complilation required, can't I just have /tmp for this? Or does it have top be a string of Macros describing a path, and if so- path to where, to the SOURCE directory? The guides I have followed so far don't seem clear on this point at all.
Which means furthe down, where I've put...
install -d 0755 $RPM_BUILD_ROOT/usr/bin
install -m 0755 hello.sh $RPM_BUILD_ROOT/usr/bin
do those locations look ok (should result in /tmp/usr/bin) given what I've set as my BuildRoot? In some examples BuildRoot was a string of percentage symbols and curly brackets... Any pointers at all would be appreciated.