酷!學園
其他討論區 => 課後溫習+認證考試 => 主題作者是: 小徒兒 於 2004-08-12 15:20
-
*** rpm下載網址
http://ftp.isu.edu.tw/pub/Linux/Fedora/linux/core/5/i386/os/Fedora/RPMS/
*** rpm 製作
材料:
1. *.c
2. configure
3. README
4. INSTALL
--------------tarball------------
5. spec
1.*.c
main.c
int main() {
printit();
}
printit.c
#include <stdio.h>
void printit{
printf("Hello,world\n");
}
2. configure
#!/bin/bash
echo -n "checking System...."
sleep 3
echo "O.K."
cat > Makefile << ENDOFMK
all: hello
hello: main.o printit.o
gcc -o hello main.o printit.o
main.o: main.c
gcc -c main.c
printit.o: printit.c
gcc -c printit.c
fresh:
rm -f hello Makefile
clean:
rm -f hello
install: hello
cp hello /usr/bin
ENDOFMK
註:syntax
Target:Requirement
<tab>command
#comment
4.tarball
$mkdir hello.1.0
$mv configure *.c INSTALL README ./hello.1.0/
$tar -zvcf hello-1.0-1.tgz hello.1.0
5.spec
$ls /mnt/cdrom/Redhat/RPMS|grep 'rmp.*build'
$rpm -vh rpm-vuild*
$cp hello-1.0.tar.gz /usr/src/redhat/SOURCES/.
$cd /sur/src/redhat/SPECS
$vi hello.spec
Summary: Hello World demo
Name: hello
Version: 1.0
Release: 2
Copyright: GPL
Group: Demo
Source: http://www.study-area.org/linux/src/hw-1.0-2.tgz
Url: http://www.study-area.org
Packager: Netman <netman@study-area.org>
Vendor: study-area
%description
hw is a 'hello world' demon program.
have fun!
%changelog
%prep
rm -fr $RPM_BUILD_DIR/hello-1.0
tar -zxvf $RPM_SOURCE_DIR/hello-1.0.tar.gz
%build
cd $RPM_BUILD_DIR/hello-1.0
. ./configure
make
%install
cd $RPM_BUILD_DIR/hello-1.0
make install
%files
%doc $RPM_BUILD_DIR/hello-1.0/README
/usr/bin/hello
$rpmbuild -ba hello.spec
****yum FC 中安裝中文輸入法
rpm -qa|grep scim
yum search scim
yum install scim-pinyin
-
http://phorum.study-area.org/viewtopic.php?t=20897&highlight=tarball
順便補上..^^
-
main.o printit.o ??
.o 還是 .c ^^" ??
再一次謝謝小徒兒
上課總是漏抄筆記 有你整理出來
讓我方便許多...有你真好
不過.....
班上同學好像沒其他人來這... :o
freebase兄
這篇 tarball + rpm "自"作 真是棒 ^^
對我這初學者來說
文字敘述是最重要的了
感受你不厭其煩再三叮嚀
呵...你愈來愈像鳥哥了^^
-
鳥哥的私房菜 p18-29 rpm -bb 應是 rpmbuild -bb 吧???
-
rpmbuild 是在鳥哥的書出之後才有的 @@" 我沒記錯吧!!
-
rpmbuild 是在鳥哥的書出之後才有的 @@" 我沒記錯吧!!
修訂版之後!?...
不是吧.........@@||