1. 压缩源代码
tar zcvf libhtp-0.5.33.tgz ./libhtp/
2. 准备配置文件
cat SPECS/libhtp.spec
Name: libhtp
Version: 0.5.33
Release: 1%{?dist}
Summary: libhtp
License: GPL
Source0: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
#BuildArch: noarch
Requires: glibc
%description
The netmap driver with adapted network interface drivers e1000e, i40e, igb,
ixgbe, ixgbevf for CentOS/EL/SL 7 prepared for Cherenkov Telescope Array
by Julien Houles and Dirk Hoffmann -CPPM-.
%prep
%setup -q
#rm -rf %{name}
%build
pwd
#cd %{buildroot}
%configure
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
%files
%defattr(-,root,root,-)
%doc
%{_includedir}/*
%{_libdir}/*
%define __debug_install_post \
%{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
%{nil}
%changelog
三 目录信息
ll rpmbuild/
total 0
drwxr-xr-x 4 root root 41 Nov 4 16:33 BUILD
drwxr-xr-x 2 root root 6 Nov 4 16:34 BUILDROOT
drwxr-xr-x 3 root root 20 Nov 4 16:34 RPMS
drwxr-xr-x 2 root root 61 Nov 4 16:23 SOURCES
drwxr-xr-x 2 root root 45 Nov 4 16:33 SPECS
drwxr-xr-x 2 root root 48 Nov 4 16:34 SRPMS
[root@localhost ~]#
也可以用下面打包命令自动生成
四打包工具安装
yum -y install rpm-build
五打包
rpmbuild -ba ./SPECS/libhtp.spec
网友评论