准备环境
安装rpm-build
yum install kernel
yum install rpm-build redhat-rpm-config unifdef
每次安装后,需要把version加1 如用原来版本再次安装会出现安装不了
生成rpm命令 rpmbuild -bb /root/rpm_spec/SingtelVideo.spec
---------------------------------------------------------------------------------
%define version 0.0.1
%define release 1%define name HelloWorld
Name: %{name}
Summary: Our HelloWorld application
Vendor: OurOrg
Release: %{release}
License: GPL
Group: Applications/ExampleOrg
Version: %{version}
Source: %{name}-%{version}-%{release}
BuildArch: noarch
#Requires: zend-server >= 5.0, zend-server-framework > 1.10.0
%description
This is a basic application for demonstrating yum-based repositories
%build
#把要放的文件放到buildroot里面
#svn拿到两个本版本增量文件放到buildroot
#rpm打包是打包buildroot里面的文件
%installrm -rf /root/rpm_src
rm -ff /root/diff_SingtelVideo2.txt
svn diff /var/www/html/SingtelVideo2 --summarize -r 676:680 |awk '{print $2}' >> /root/diff_SingtelVideo2.txt
/usr/bin/rsync -rltDv --files-from=/root/diff_SingtelVideo2.txt / /root/rpm_src
cp -R /root/rpm_src/var $RPM_BUILD_ROOT
%clean
mkdir -p /var/www/repos/noarch
cp /root/rpmbuild/RPMS/noarch/%{name}-%{version}-%{release}.noarch.rpm
/var/www/repos/noarch
createrepo /var/www/repos
#要打包的文件
%files/var/www/application
%post
#service httpd restart