3.SPEC파일 생성
#vi /usr/src/redhat/SPECS/hello.spec
-------------------hello.spec--------------------------
%define name hello
%define version 1.0
%define release 1
Name: hello
Version: 1.0
Release: 1
Summary: Hello
Group: CentOS
License: GPL
URL: http://www.example.com
Source0: %{name}-%{version}-%{release}.tar.gz
BuildRoot: /var/tmp/%{name}-buildroot
%description
Installs /root/bin/hello.sh
%prep
%setup -q -n %{name}-%{version}
%build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/root/bin
install -m 755 hello.sh $RPM_BUILD_ROOT/root/bin/hello.sh
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
/root/bin/hello.sh
%changelog
-------------------------------------------------
4.RPM build
#rpmbuild -ba /usr/src/redhat/SPECS/hello.spec
#tree /usr/src/redhat
//테스트
#rpm -Uvh hello-1.0-1.i386.rpm
#hello.sh (실행)
#rpm -e hello
5.패키지 GPG Key 생성 및 패키지 Sign
#gpg --gen-key (key 복사)