tar xjf linux-2.6.19.7.tar.bz2查了一下,雖然這是一個無關痛癢的警告,不過如果可以將 tar 的版本升級至 1.14 以後,就能夠避掉這樣的警告訊息了。自己比較習慣在 RPM 的系統下處理作業,而該主機的環境卻仍停留在 Fedora Core 2 ,就連 The Fedora Legacy Project 也不再維護,所以興起了自己編譯 tar RPM 的念頭。
tar: pax_global_header: Unknown file type 'g', extracted as normal file
tar --version
tar (GNU tar) 1.13.25
Copyright (C) 2001 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by John Gilmore and Jay Fenlason.
編譯環境已經存在了,就不再贅述。加上自己曾經有將新版的 sendmail 由 Tar Ball 轉成 RPM 的經驗(資料在酷!學園),這次當然想要如法泡製一番囉!
1.安裝 tar 的 SOURCE RPM:
rpm -ivh tar-1.13.25-14.1.legacy.src.rpm2.下載新版 tar 原始碼,置於 /usr/src/redhat/SOURCES/ 目錄中:
wget http://ftp.gnu.org/gnu/tar/tar-1.20.tar.bz23.編輯 SPEC 檔,保留 man page 的 patch:
diff -urN tar-vic.spec tar.spec4.產生 RPM 檔:
--- tar-vic.spec 2008-06-08 14:12:06.936689000 +0800
+++ tar.spec 2006-03-09 08:25:32.000000000 +0800
@@ -1,7 +1,7 @@
Summary: A GNU file archiving program.
Name: tar
-Version: 1.20
-Release: vic
+Version: 1.13.25
+Release: 14.1.legacy
License: GPL
Group: Applications/Archiving
Source: ftp://ftp.gnu.org/pub/gnu/tar/tar-%{version}.tar.bz2
@@ -32,13 +32,13 @@
%prep
%setup -q
%patch0 -p1 -b .manpage
-#%patch1 -p1 -b .sock
-#%patch2 -p1 -b .253
-#%patch6 -p1 -b .librt
-#%patch7 -p1 -b .err
-#%patch8 -p1 -b .absn
-#%patch9 -p1 -b .argv
-#%patch10 -p1 -b .dots
+%patch1 -p1 -b .sock
+%patch2 -p1 -b .253
+%patch6 -p1 -b .librt
+%patch7 -p1 -b .err
+%patch8 -p1 -b .absn
+%patch9 -p1 -b .argv
+%patch10 -p1 -b .dots
rpmbuild -ba /usr/src/redhat/SPECS/tar.spec5.安裝升級 tar:
rpm -Uvh /usr/src/redhat/RPMS/i386/tar-1.20-vic.i386.rpm