每次安装swftools都需要重新编译太麻烦了,就想着直接做个rpm包,留备使用,具体过程如下
1) 下载swftools源码
http://www.swftools.org/swftools-2013-04-09-1007.tar.gz
2) 安装rpm包制作工具;
$ sudo yum install -y rpm-build rpmdevtools
3) 运行 rpmdev -setuptree 来生成一个 rpm 包的骨架目录
# rpmdev -setuptree
4) 在 ~/rpmbuild/SPECS 目录下用 rpmdev-newspec 来生成一个 spec 骨架文件
# rpmdev -newspec swftools.spec
5) 编辑swftools.spec 文件,具体内容如下:
Name: swftools
Version: 0.9.2
Release: 1%{?dist}
Summary: Build swftools by Centerm Infomation
License: GPL
URL: http://www.swftools.org/swftools-2013-04-09-1007.tar.gz
Source0: swftools-2013-04-09-1007.tar.gz
BuildRoot: %_topdir/BUILDROOT
BuildRequires: gcc,make,automake,zlib-devel,libjpeg-devel,giflib-devel,freetype-devel
Requires: zlib-devel,libjpeg-devel,giflib-devel,freetype-devel
%define userpath /usr/local/swftools
%description
swftools rpm package
%prep
tar -xzvf$RPM_SOURCE_DIR/swftools-2013-04-09-1007.tar.gz
#%setup-q
%build
cd$RPM_BUILD_DIR/swftools-2013-04-09-1007
./configure--prefix=/usr/local/swftools
make%{?_smp_mflags}
%install
%{__rm}-rf %{buildroot}
cd$RPM_BUILD_DIR/swftools-2013-04-09-1007
make
make install
install -d $RPM_BUILD_ROOT%{userpath}
cp -a%{userpath}/* $RPM_BUILD_ROOT/%{userpath}
%clean
rm -rf$RPM_BUILD_DIR/swftools-2013-04-09-1007
%files
%defattr(-,root,root)
/usr/local/swftools
%doc
%changelog
6) 编译rpm
#Rpmbuild –bb swftools.spec
7) 安装验证
Rpm –I ../RPMS/X86_64/swftools-0.9.2-1.el7.centos.x86_64.rpm
(如果已经装过则运行rpm –e swftools卸载)