# yum install rpm-build
# wget http://rsync.samba.org/ftp/rsync/rsync-3.0.9.tar.gz
# vim rsync.spec
Name:rsync
Version:3.0.9
Release: 1%{?dist}
Summary:GNU rsync
Group:Development/Tools
License:GPL
URL:www.rsync.com
Source0:%{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
#BuildRequires:
#Requires:
%description
Rsync is a syncup tool
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc
%changelog
# cp rsync-3.0.9.tar.gz rpmbuild/SOURCES/
# rpmbuild -bb rsync.spec
Build RPM package from source code,布布扣,bubuko.com
Build RPM package from source code
原文地址:http://www.cnblogs.com/oskb/p/3848573.html