1. yum install rpmbuild
2. mkdir -pv ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
3. 放tar.gz文件到SOURCES
4. 编辑python-nmap.spec 到SPECS
[root@WebServer SPECS]# cat python-nmap.spec
Name: python-nmap
Version: 0.6.0
Release: 1.0
Summary: Python nmap RPM package to port scan.
Source0: %{name}-%{version}.tar.gz
Group: System administration tools
License: GPL
URL: http://www.erjoy.net
BuildRequires: gcc,make
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
The GNU indent program reformats C code to any of a variety of formatting standards, or you can define your own.
%prep
%setup -n %{name}-%{version}
%build
mkdir -p /usr/local/python-nmap
cp -r * /usr/local/python-nmap
make
make install DESTDIR=/usr/local/python-nmap
%install
python setup.py install
make install
5. rpmbuild -ba python-nmap.spec
6. 在SRPMS可以拿到具体的rpm包
2. mkdir -pv ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
3. 放tar.gz文件到SOURCES
4. 编辑python-nmap.spec 到SPECS
[root@WebServer SPECS]# cat python-nmap.spec
Name: python-nmap
Version: 0.6.0
Release: 1.0
Summary: Python nmap RPM package to port scan.
Source0: %{name}-%{version}.tar.gz
Group: System administration tools
License: GPL
URL: http://www.erjoy.net
BuildRequires: gcc,make
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
The GNU indent program reformats C code to any of a variety of formatting standards, or you can define your own.
%prep
%setup -n %{name}-%{version}
%build
mkdir -p /usr/local/python-nmap
cp -r * /usr/local/python-nmap
make
make install DESTDIR=/usr/local/python-nmap
%install
python setup.py install
make install
5. rpmbuild -ba python-nmap.spec
6. 在SRPMS可以拿到具体的rpm包