Creating a Custom Spec file for Snort February 18, 2010
Posted by Paul Whalen in Uncategorized.trackback
Now to create a custom spec file to be used to build an rpm package for use with Fedora Core 12. First I ran the command:
rpmdev-newspec snort
This will create a skeleton spec file that will be used to create the new rpm package. After filling out the details of the package, I ran the command:
rpmbuild -ba snort.spec
It seemed to be running fine until it hit the make section, then failed. Apparently this was due to the ‘-j3′ option being added to make, the package would not build. After altering the spec file and removing this option, as well as a few tweaks, the package was successfully built. I have included an excerpt for the specific lines that were added below:
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf %{buildroot}/usr/src/
mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}/%{_datadir}/doc/%{name}-%{version}/
%clean
rm -rf $RPM_BUILD_ROOT
%doc LICENSE RELEASE.NOTES COPYING
%{_bindir}/*
%{_libdir}/*
%{_mandir}/*/*
This built the packages successfully, but now I need to check the rpms. I checked the created rpm binary with rpmlint, running the comand:
rpmlint snort-2.8.5.2-1.fc12.i386.rpm
I discover ‘unstripped-binary-or-object files’, and ‘devel-file-in-non-devel-package’ warnings, 32 in total, however no errors. Running the rpmlint command on the source rpmĀ and the spec file there are no errors. I decided to move forward and revisit the warnings later.
Moving forward I tested with Mock. Using the command:
mock -r fedora-12-i386 --rebuild snort-2.8.5.2-1.fc12.src.rpm
I received errors about build dependencies, checking the log files I needed to add both ‘ibpcap-devel’ and ‘pcre-devel’ to BuildRequires in the spec file. Once that was done and the package was rebuilt using:
rpmbuild -bs snort.spec
Mock was re-run and finished without errors.
Next, Testing with Koji.
Comments»
No comments yet — be the first.