Please refer to my post Build your own Red Hat Packages to set up the build environment
Firestarter Firewall
If you can not find the binary RPM for your distribution, please download the source rpm from http://www.fs-security.com/download.php
[rpmbuild@wfd-cos-cd1 downloads]$ wget http://heanet.dl.sourceforge.net/sourceforge/firestarter/firestarter-1.0.3-1.src.rpm
[rpmbuild@wfd-cos-cd1 downloads]$ rpm -qpR firestarter-1.0.3-1.src.rpm glib2-devel >= 0:2.4 gtk2-devel >= 0:2.4 gnome-vfs2-devel >= 0:2.6.0 libglade2-devel >= 0:2.3.6 libgnomeui-devel perl-XML-Parser gettext desktop-file-utils rpmlib(CompressedFileNames) <= 3.0.4-1
You can check whether the required rpms installed on your machine or not, by issuing;
[rpmbuild@wfd-cos-cd1 downloads]$ rpm -q glib2-devel > gtk2-devel gnome-vfs2-devel libglade2-devel > libgnomeui-devel perl-XML-Parser gettext > desktop-file-utils glib2-devel-2.4.7-1 package gtk2-devel is not installed package gnome-vfs2-devel is not installed package libglade2-devel is not installed package libgnomeui-devel is not installed perl-XML-Parser-2.34-5 gettext-0.14.1-13 desktop-file-utils-0.9-2
Install the required packages that are not installed in your system, using yum.
[root@wfd-cos-cd1 ~]# yum install gtk2-devel gnome-vfs2-devel libglade2-devel libgnomeui-devel
Now, install the firestarter source to your build tree – You can ignore below warning messages;
[rpmbuild@wfd-cos-cd1 downloads]$ rpm -ivh firestarter-1.0.3-1.src.rpm 1:firestarter warning: user majix does not exist - using root warning: group majix does not exist - using root ########################################### [100%] warning: user majix does not exist - using root warning: group majix does not exist - using root [rpmbuild@wfd-cos-cd1 downloads]$
Now, build the firestarter binay by issuing
[rpmbuild@wfd-cos-cd1 downloads]$ rpmbuild -ba ~/mybuild/SPECS/firestarter.spec ... ... ... Wrote: /home/rpmbuild/mybuild/SRPMS/firestarter-1.0.3-1.src.rpm Wrote: /home/rpmbuild/mybuild/RPMS/firestarter-1.0.3-1.i386.rpm Executing(%clean): /bin/sh -e /home/rpmbuild/mybuild/tmp/rpm-tmp.57671 + umask 022 + cd /home/rpmbuild/mybuild/BUILD + cd firestarter-1.0.3 + rm -rf /home/rpmbuild/mybuild/tmp/firestarter-1.0.3-1-root-rpmbuild + exit 0 [rpmbuild@wfd-cos-cd1 downloads]$
You are ready to install built rpm
[rpmbuild@wfd-cos-cd1 downloads]$ su - root Password: [root@wfd-cos-cd1 ~]# rpm -ivh /home/rpmbuild/mybuild/RPMS/firestarter-1.0.3-1.i386.rpm Preparing... ########################################### [100%] 1:firestarter ########################################### [100%] [root@wfd-cos-cd1 ~]#
Run firestarter to configure your firewall
[rpmbuild@wfd-cos-cd1 downloads]$ su - root Password: [root@wfd-cos-cd1 ~]# which firestarter /usr/sbin/firestarter [root@wfd-cos-cd1 ~]# firestarter
Check whether the firestarter firewall is running after configuration
[root@wfd-cos-cd1 ~]# service firestarter status Firestarter is running... [root@wfd-cos-cd1 ~]# chkconfig --list |grep 'firestarter|iptables' iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off firestarter 0:off 1:off 2:on 3:on 4:on 5:on 6:off [root@wfd-cos-cd1 ~]#
Happy Firewalling 🙂
Clam Anti Virus
If you are unable to find the binary for your distribution, you can download the source rpm from http://dag.wieers.com/packages/clamav/ or source tar ball from http://www.clamav.net/
The below rpms must be installed in your system before you build clamav
[rpmbuild@wfd-cos-cd1 downloads]$ rpm -qpR clamav-0.87.1-1.rf.src.rpm warning: clamav-0.87.1-1.rf.src.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 bzip2-devel zlib-devel gmp-devel curl-devel sendmail-devel >= 8.12 rpmlib(CompressedFileNames) <= 3.0.4-1
You can verify the existence by issuing the below command
[rpmbuild@wfd-cos-cd1 downloads]$ rpm -q bzip2-devel zlib-devel > gmp-devel curl-devel sendmail-devel rpm-devel bzip2-devel-1.0.2-13.EL4.2 zlib-devel-1.2.1.2-1.2 gmp-devel-4.1.4-3 curl-devel-7.12.1-6.rhel4 package sendmail-devel is not installed rpm-devel-4.3.3-11_nonptl
In my system sendmail-devel was not installed – I installed the rpm using yum
[rpmbuild@wfd-cos-cd1 downloads]$ su -c 'yum install sendmail-devel'
Now, install the source rpm that you have downloaded, and ignore the warning messages
[rpmbuild@wfd-cos-cd1 downloads]$ rpm -ivh clamav-0.87.1-1.rf.src.rpm warning: clamav-0.87.1-1.rf.src.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 1:clamav warning: user dag does not exist - using root warning: group dag does not exist - using root ########################################### [100%] warning: user dag does not exist - using root warning: group dag does not exist - using root warning: user dag does not exist - using root warning: group dag does not exist - using root warning: user dag does not exist - using root warning: group dag does not exist - using root [rpmbuild@wfd-cos-cd1 downloads]$
Now, build binary and source rpm using the spec file.
[rpmbuild@wfd-cos-cd1 downloads]$ rpmbuild -ba ~/mybuild/SPECS/clamav.spec
Check and install newly built RPMs
[root@wfd-cos-cd1 RPMS]# pwd /home/rpmbuild/mybuild/RPMS [root@wfd-cos-cd1 RPMS]# ls -l clam* -rw-rw-r-- 1 rpmbuild rpmbuild 888406 Dec 6 11:22 clamav-0.87.1-1.rf.i386.rpm -rw-rw-r-- 1 rpmbuild rpmbuild 2716724 Dec 6 11:22 clamav-db-0.87.1-1.rf.i386.rpm -rw-rw-r-- 1 rpmbuild rpmbuild 160843 Dec 6 11:22 clamav-devel-0.87.1-1.rf.i386.rpm -rw-rw-r-- 1 rpmbuild rpmbuild 65941 Dec 6 11:22 clamav-milter-0.87.1-1.rf.i386.rpm -rw-rw-r-- 1 rpmbuild rpmbuild 67470 Dec 6 11:22 clamd-0.87.1-1.rf.i386.rpm [root@wfd-cos-cd1 RPMS]# rpm -ivh clam* Preparing... ########################################### [100%] 1:clamav-db ########################################### [ 20%] 2:clamav ########################################### [ 40%] 3:clamd ########################################### [ 60%] 4:clamav-devel ########################################### [ 80%] 5:clamav-milter ########################################### [100%]
A sample scan – List only infected files
[rpmbuild@wfd-cos-cd1 ~]$ clamscan -r --infected $HOME /home/rpmbuild/mybuild/SOURCE/clamav-0.87.1/clamav-0.87.1.tar.gz: ClamAV-Test-File FOUND /home/rpmbuild/mybuild/BUILD/clamav-0.87.1/test/clam.exe: ClamAV-Test-File FOUND /home/rpmbuild/mybuild/BUILD/clamav-0.87.1/test/clam.cab: ClamAV-Test-File FOUND /home/rpmbuild/mybuild/BUILD/clamav-0.87.1/test/clam.rar: ClamAV-Test-File FOUND /home/rpmbuild/mybuild/BUILD/clamav-0.87.1/test/clam.zip: ClamAV-Test-File FOUND /home/rpmbuild/mybuild/BUILD/clamav-0.87.1/test/clam.exe.bz2: ClamAV-Test-File FOUND ----------- SCAN SUMMARY ----------- Known viruses: 41434 Engine version: 0.87.1 Scanned directories: 56 Scanned files: 784 Infected files: 6 Data scanned: 37.84 MB Time: 73.730 sec (1 m 13 s)
For more information on how-to-scan, check out http://www.clamav.net/doc/