[[email protected] SPECS]# pwd
/usr/src/redhat/SPECS
[[email protected] SPECS]# ls
demo.spec sadmin.spec
[[email protected] SPECS]# more demo.spec
Summary: Test package for LinuxFly webblog
Name: suite
Version: 1.0.0
Release: 1
License: GPL
Group: System
Source: demo.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Url: http://www.linuxfly.org
Packager: Linuxing
Prefix: %{_prefix}
Prefix: %{_sysconfdir}
%define userpath /var/www/html/demo
%description
Just a test rpm suite.
%prep
%setup -c
%install
install -d $RPM_BUILD_ROOT%{userpath}
注:这个相当于mkdir
cp -a * $RPM_BUILD_ROOT%{userpath}
注:从后面看,可以知道这个就是安装之后的目录
%clean
%files
%defattr(-,root,root)
%{userpath}
[[email protected] SPECS]# pwd
/usr/src/redhat/SPECS
[[email protected] SPECS]# rpmbuild -bb demo.spec
[[email protected] x86_64]# rpm -ivh suite-1.0.0-1.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:suite-1.0.0-1 ################################# [100%]