close
- 壓縮目錄
tar -zcvf hello-1.0.tar.gz hello-1.0/ - 將原始檔複製到 /usr/src/packages/SOURCES
cp hello-1.0.tar.gz /usr/src/pachages/SOURCE - 產生SPEC 檔案(用來描述如何產生RPM 檔案)
#
# SPEC file for hello world program
#
Summary: Hello, World program
Name: hello
Version: 1.0
Release: 1
License: GPL
Group: Applications/Useless
Source: hello-1.0.tar.gz
Distribution: Useless Linux 1.0
Vendor: Gjun
Packager: MoMo <momo@soft-e.org>
%description
This is Hello Project%prep
rm -rf $RPM_BUILD_DIR/hello-1.0
cd $RPM_BUILD_DIR
tar -zxvf $RPM_SOURCE_DIR/hello-1.0.tar.gz%build
cd $RPM_BUILD_DIR/hello-1.0
make
%install
cd $RPM_BUILD_DIR/hello-1.0
make install%files
/usr/bin/hello
%doc $RPM_BUILD_DIR/hello-1.0/README - 製作rpm 檔案 Binary 檔案
rpmbuild -bb /usr/src/packages/SPECS/hello-1.0.spec 產生二進位的RPM檔案
rpmbuild -ba /usr/src/packages/SPECS/hello-1.0.spec 產生原始的RPM 檔,使用者可以自行編譯
- 檔案結構
Source ==> 原始檔
BUILD ==>編目錄
rpms ==> 產生出的RPM 檔案位置
全站熱搜
留言列表