Monday, October 11, 2010

NLED Spec file revisited

Revisited:
In one of my previous posts, Creating an NLED Spec file, I had posted my spec file and RPM. However, I might not have had ran rpmlint on it so therefore there were some Warnings (no errors) that needed to be fixed.

Rpmlint Warnings
When I ran rpmlint on the spec file, I received warnings that I had macros in the %changelog section, which I did have.

Warning messages:   
"W: macro-in-%changelog %files"
"W: macro-in-%changelog %Install"

That was an easy fix, and I learned that no macro should be placed in the %changelog section at all (I initially thought it did not matter).

Running rpmlint on the nled-2.52-6.fc12.i686.rpm file, gave me two warnings:
nled.i686: W: no-documentation
nled.i686: W: no-manual-page-for-binary nled

After checking the SOURCE/nled-2.52/ directory under ~/rpmbuild, there is a nled.txt file there. So it was simple as adding %doc nled.txt to the %files section. Now the original source rpm does not have a manual page for the NLED binary so that is a warning that we can safely ignore (am I assuming right?)


Update: 
 I decided, for testing purposes, to add a man page to the NLED rpm. I used the output from the command "?" within NLED that gives the list of hotkeys and shortcuts to create a man page file called nled.1.
(To create your own man page, see here).

Then I edited the nled.spec file and added to the sections below.
Please note that comments were added in for explanations.

# I used Source1 instead of using PATCH 
# because it is just a straight file 
# that doesn't need to be uncompressed 
Source1:  nled.1       #This was put in the SOURCES directory

%prep
%setup -q

#This copies the nled.1 to the BUILD directory
cp -p %SOURCE1 %{_builddir}/%{name}-%{version}/      


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_bindir}/
cp -p  nled %{buildroot}%{_bindir}/

# This creates the man directory in the BUILDROOT
mkdir -p %{buildroot}%{_mandir}/             

# and this copies the nled.1 from the BUILD to the BUILDROOT man directory
cp -p nled.1 %{buildroot}%{_mandir}/         


%files
%defattr(-,root,root,-)
%doc nled.txt  #This adds the nled documentation
%{_bindir}/*

# This tells rpm that the nled.1 man file is part of the package
%{_mandir}/*


I will have to reupload the SPEC file and the RPM as they have changed, and the previous blog entry's versions were not tested.

No comments:

Post a Comment