This is my attempt at building an RPM package for ed.

At first I followed the simple instructions from lab:

Move the tarball to ~/rpmbuild/SOURCES/:

mv ed-1.6.tar.gz ~/rpmbuild/SOURCES/

Create an empty skeleton spec file:

rpmdev-newspec ed-1.6

Then I edited the spec file using vi:

vi ed-1.6.spec

After filling in all the required sections of the spec file I attempted to build the package by running:

rpmbuild -ba ed-1.6.spec

I got the following errors:

error: Installed (but unpackaged) file(s) found:
   /usr/share/info/dir
   /usr/share/info/ed.info.gz

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/share/info/dir
   /usr/share/info/ed.info.gz

I proceeded to browse on google for a solution and it didn’t take long before I came across a solution.

To fix this error I needed to specify the list of files that would be installed.

I added this to the %files section of the spec file:

%files
%doc README
%defattr(-,root,root,-)
%{_bindir}/*
%{_mandir}/man1/*
/usr/share/info/

And finally! I got it to work.

Run te rmplint command to check the spec file RPM and SRPM for Errors or warnings:

[root@mbustosroman SPECS]# rpmlint ed-1.6.spec
ed-1.6.spec:21: W: configure-without-libdir-spec
ed-1.6.spec:23: W: macro-in-comment %configure
ed-1.6.spec:7: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 7)
0 packages and 1 specfiles checked; 0 errors, 3 warnings.

[root@mbustosroman SRPMS]# rpmlint ed-1.6-1.src.rpm
ed.src: I: enchant-dictionary-not-found en_US
ed.src: W: summary-not-capitalized C text-editor
ed.src: E: no-changelogname-tag
ed.src: W: invalid-license GNU
ed.src: E: invalid-spec-name
ed.src:21: W: configure-without-libdir-spec
ed.src:23: W: macro-in-comment %configure
ed.src:7: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 7)
1 packages and 0 specfiles checked; 2 errors, 5 warnings.

[root@mbustosroman x86_64]# rpmlint ed-debuginfo-1.6-1.x86_64.rpm
ed-debuginfo.x86_64: I: enchant-dictionary-not-found en_US
ed-debuginfo.x86_64: E: no-changelogname-tag
ed-debuginfo.x86_64: W: invalid-license GNU
ed-debuginfo.x86_64: E: debuginfo-without-sources
1 packages and 0 specfiles checked; 2 errors, 1 warnings.

Even though I got the the rpm to build there are still some errors I have to fix. I found it extremely useful the rpmlint command tells you exactly what the error is, it is very straight forward. I think I’ve got a pretty good idea on how to fix the errors and will post one I am done. It is somehow 2am now! Will update this tomorrow.