Skip navigation

I built RPM’s for the this course where macchanger and wget. The RPM’s are for 64bit machines and where not built or tested on 32 bit machines. To build the sources as a regular user I needed to add myself to the /etc/sudoers file. This was done by switching to root, running the visudo command and adding the following line to the end of the file.

stephen ALL=(ALL) ALL

After adding the line I then saved the file and exited the root shell.

 

The next step was to create the build environment using the rpmdev-setuptree command. Since I knew which programs I wanted to build into RPM’s I moved to the directory ~/rpmbuild/SOURCES and then downloaded the sources file into there with the commands below.

wget ftp://ftp.gnu.org/gnu/macchanger/macchanger-1.5.0.tar.gz

wget http://ftp.gnu.org/gnu/wget/wget-1.9.tar.gz

 

I then moved into the SPECS directory and created the spec file for each application. The macchanger spec file was pretty straight forward to build with a few simply fixed errors during the rpmbuild stage and the rpmlint stage.

Build Errors encountered during rpmbuild -ba macchanger.spec

Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/stephen/rpmbuild/BUILDROOT/macchanger-1.5.0-1.fc13.x86_64

error: Installed (but unpackaged) file(s) found:

/usr/bin/macchanger

/usr/share/info/macchanger.info.gz

/usr/share/macchanger/OUI.list

/usr/share/macchanger/wireless.list

/usr/share/man/man1/macchanger.1.gz

 

Fixed error by adding under the %file directive

%{_infodir}/*

%{_bindir}/macchanger

%{_mandir}/man1/macchanger*

%{_bindir}/../share/macchanger/*

 

Errors encountered with the rpmlint -i  RPMS/x86_64/macchanger-1.5.0-1.fc13.x86_64.rpm

 

macchanger.x86_64: E: no-changelogname-tag

macchanger.x86_64: E: info-files-without-install-info-postin /usr/share/info/macchanger.info.gz

macchanger.x86_64: E: info-files-without-install-info-postun /usr/share/info/macchanger.info.gz

macchanger.x86_64: E: info-dir-file /usr/share/info/dir

macchanger.x86_64: E: info-files-without-install-info-postin /usr/share/info/dir

macchanger.x86_64: E: info-files-without-install-info-postun /usr/share/info/dir

————

 

The 6 errors where fixed by adding the information below  to the spec file. The first 2 line where added to the header of the spec file and the rest of the lines where added after the %install directive and these lines fixed errors 2, 3, 5, and 6

Requires(post): /sbin/install-info

Requires(preun): /sbin/install-info

 

%post

/sbin/install-info %{_infodir}/macchanger.info.gz %{_infodir}/dir || :0

 

%preun

if [ “$1” = 0 ]; then

/sbin/install-info –delete %{_infodir}/macchanger.info.gz %{_infodir}/dir || :

fi

 

Adding the following line to the end of commands under the %install directive fixed the 4th error

rm -f $RPM_BUILD_ROOT/%{_infodir}/dir

 

Adding the following lines below the %changelog section fixed the 1st error

* Sat Jan 15 2011  <sahall3@learn.senecac.on.ca> 1.5.0-1

– Initial Packaging of macchanger

 

The process was pretty much the same for the wget program as well, there were less errors during the process because I modified the wget.spec file to fix the same errors that I ran into with macchanger program before trying to build. I also used the spec file from the wget SPRM to determine what the build requires because I had not learnt about mock at the time. The only other thing that I had to do was add the line below to the spec file under the %file directive so that it could build with the language files.

 

/usr/share/locale/*/*/wget.mo

 

The RPM’s and SRPM’s are available for download from the links below.

MACCHANGER

WGET

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: