3.7-1.beta1
- Update to 3.7 beta1 (aka 3.7.b1).
[root@liukai rpm]# rpmbuild -ba rar.specExecuting(%prep): /bin/sh -e /var/tmp/rpm-tmp.64263+ umask 022+ cd /usr/src/redhat/BUILD+ cd /usr/src/redhat/BUILD+ rm -rf rar-3.7+ /bin/gzip -dc /usr/src/redhat/SOURCES/rarlinux-3.7.b1.tar.gz+ tar -xf -+ STATUS=0+ '[' 0 -ne 0 ']'+ cd rar-3.7/var/tmp/rpm-tmp.64263: line 31: cd: rar-3.7: 没有那个文件或目录error: Bad exit status from /var/tmp/rpm-tmp.64263 (%prep)RPM build errors:Bad exit status from /var/tmp/rpm-tmp.64263 (%prep)
竟然过去了,看来是大写。这感觉和破案一样,真是太爽了。不过现在不能高兴太早,任务还没完成呢。接着看,程序在“/var/tmp/rpm-tmp.64263: line 31: cd: rar-3.7: 没有那个文件或目录“个地方出了错,反映出来是“/var/tmp/rpm-tmp.64263 (%prep)”,看来很可能%prep配置出错。
6、文件中原来是:
%prep
%setup -q
红旗给的教程中说道“(2) -n name :
上面已经谈到,源程序包中的文件应采用"软件名-版本号"作为上层目录。如果用了别的什么目录(如 name),%setup宏无法正常工作,那该怎么办?没关系,可以用-n选项,引用一下这个目录(name)就行了。假如我的LZE源程序包中的文件是以lze为上层目录,那么我就可以用"%setup -n lze"宏命令来解压缩该包。”。很显然,我犯的错误就是有软件名和版本号时缺少那个目录。
%prep
%setup -n %{name}
但是,我不知掉那个-q是什么。
7、程序又继续向下跑了,但又出错了。
[root@liukai rpm]# rpmbuild -ba rar.specExecuting(%prep): /bin/sh -e /var/tmp/rpm-tmp.23492+ umask 022+ cd /usr/src/redhat/BUILD+ cd /usr/src/redhat/BUILD+ rm -rf rar+ /bin/gzip -dc /usr/src/redhat/SOURCES/rarlinux-3.7.b1.tar.gz+ tar -xf -+ STATUS=0+ '[' 0 -ne 0 ']'+ cd rar++ /usr/bin/id -u+ '[' 0 = 0 ']'+ /bin/chown -Rhf root .++ /usr/bin/id -u+ '[' 0 = 0 ']'+ /bin/chgrp -Rhf root .+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .+ exit 0Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.23492+ umask 022+ cd /usr/src/redhat/BUILD+ cd rar+ /bin/rm -rf /var/tmp/rar-3.7-1-root+ /usr/bin/install -D -p -m0755 rar /var/tmp/rar-3.7-1-root/usr/bin/rar+ /usr/bin/install -D -p -m0644 rarfiles.lst /var/tmp/rar-3.7-1-root/etc/rarfiles.lst+ /usr/bin/install -D -p -m0755 default.sfx /usr/lib/default.sfx+ /usr/lib/rpm/brp-compress+ /usr/lib/rpm/brp-strip+ /usr/lib/rpm/brp-strip-static-archive+ /usr/lib/rpm/brp-strip-comment-noteProcessing files: rar-3.7-1error: File not found: /var/tmp/rar-3.7-1-root/usr/lib/rarerror: File not found: /var/tmp/rar-3.7-1-root/usr/lib/default.sfxExecuting(%doc): /bin/sh -e /var/tmp/rpm-tmp.55654+ umask 022+ cd /usr/src/redhat/BUILD+ cd rar+ DOCDIR=/var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ export DOCDIR+ rm -rf /var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ /bin/mkdir -p /var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ cp -pr license.txt rar.txt readme.txt technote.txt whatsnew.txt file_id.diz /var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ exit 0Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/rar-3.7-1-rooterror: Installed (but unpackaged) file(s) found:/usr/bin/rarRPM build errors:File not found: /var/tmp/rar-3.7-1-root/usr/lib/rarFile not found: /var/tmp/rar-3.7-1-root/usr/lib/default.sfxInstalled (but unpackaged) file(s) found:/usr/bin/rar感觉这回跑得比较远,离成功更加接近,因为出来了一大堆东西,一般make成功时前面才是这么一大堆提示。呵呵。别光顾着乐了,看看什么问题到底:
恩,两处文件没有,一个rar安装,但没解压,那这个生成的rar到底是什么呢?看看再说:
[root@liukai rpm]# file /usr/bin/rar/usr/bin/rar: ERROR: cannot open `/usr/bin/rar' (No such file or directory)
嘿嘿,原来还是没有生成啊。
自己看看,那两个目录:
[root@liukai rpm]# file /var/tmp/rar-3.7-1-root/usr/bin/ share/[root@liukai rpm]# file /var/tmp/rar-3.7-1-root/usr/bin/ share/[root@liukai rpm]# file /var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7/file_id.diz rar.txt technote.txtlicense.txt readme.txt whatsnew.txt[root@liukai rpm]# file /var/tmp/rar-3.7-1-root/usr/bin/rar
查到一个,rar在bin下面,不在lib下,所以:
%files
%defattr(-, root, root, 0755)
%doc *.txt file_id.diz
%{_sysconfdir}/rarfiles.lst
%{_libdir}/rar 改为:%{_bindir}/rar
%{_libdir}/default.sfx
8、继续执行:rpmbuild -ba rar.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.87897+ umask 022+ cd /usr/src/redhat/BUILD+ cd /usr/src/redhat/BUILD+ rm -rf rar+ /bin/gzip -dc /usr/src/redhat/SOURCES/rarlinux-3.7.b1.tar.gz+ tar -xf -+ STATUS=0+ '[' 0 -ne 0 ']'+ cd rar++ /usr/bin/id -u+ '[' 0 = 0 ']'+ /bin/chown -Rhf root .++ /usr/bin/id -u+ '[' 0 = 0 ']'+ /bin/chgrp -Rhf root .+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .+ exit 0Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.87897+ umask 022+ cd /usr/src/redhat/BUILD+ cd rar+ /bin/rm -rf /var/tmp/rar-3.7-1-root+ /usr/bin/install -D -p -m0755 rar /var/tmp/rar-3.7-1-root/usr/bin/rar+ /usr/bin/install -D -p -m0644 rarfiles.lst /var/tmp/rar-3.7-1-root/etc/rarfiles.lst+ /usr/bin/install -D -p -m0755 default.sfx /usr/lib/default.sfx+ /usr/lib/rpm/brp-compress+ /usr/lib/rpm/brp-strip+ /usr/lib/rpm/brp-strip-static-archive+ /usr/lib/rpm/brp-strip-comment-noteProcessing files: rar-3.7-1error: File not found: /var/tmp/rar-3.7-1-root/usr/lib/default.sfxExecuting(%doc): /bin/sh -e /var/tmp/rpm-tmp.54597+ umask 022+ cd /usr/src/redhat/BUILD+ cd rar+ DOCDIR=/var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ export DOCDIR+ rm -rf /var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ /bin/mkdir -p /var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ cp -pr license.txt rar.txt readme.txt technote.txt whatsnew.txt file_id.diz /var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ exit 0Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/rar-3.7-1-rootRPM build errors:File not found: /var/tmp/rar-3.7-1-root/usr/lib/default.sfx
看来现在就是default.sfx文件的问题了。经验证根本就不存在/var/tmp/rar-3.7-1-root/usr/lib,这么一个目录。
哈哈,我知道了,还是得看rar.spec文件,里面说:
%install
%{__rm} -rf %{buildroot}
%{__install} -D -p -m0755 rar %{buildroot}%{_bindir}/rar
%{__install} -D -p -m0644 rarfiles.lst %{buildroot}%{_sysconfdir}/rarfiles.lst
%{__install} -D -p -m0755 default.sfx %{_libdir}/default.sfx
看到最后一行了吗?怪不得它找不到呢,因为路径就不正确嘛,改成:
%{__install} -D -p -m0755 default.sfx %{buildroot}%{_libdir}/default.sfx
9、接下来
[root@liukai rpm]# rpmbuild -ba rar.specExecuting(%prep): /bin/sh -e /var/tmp/rpm-tmp.85988+ umask 022+ cd /usr/src/redhat/BUILD+ cd /usr/src/redhat/BUILD+ rm -rf rar+ /bin/gzip -dc /usr/src/redhat/SOURCES/rarlinux-3.7.b1.tar.gz+ tar -xvvf -drwxr-xr-x root/root 0 2007-01-09 01:50:18 rar/-rw-r----- root/root 217 2007-01-09 01:50:18 rar/file_id.diz-rw-r----- root/root 4398 2007-01-09 01:50:18 rar/license.txt-rw-r----- root/root 428 2007-01-09 01:50:18 rar/Makefile-rw-r----- root/root 3183 2007-01-09 01:50:18 rar/order.htm-rw-r----- root/root 1018 2007-01-09 01:50:18 rar/rarfiles.lst-rw-r----- root/root 70107 2007-01-09 01:50:18 rar/rar.txt-rw-r----- root/root 1050 2007-01-09 01:50:18 rar/readme.txt-rw-r----- root/root 8957 2007-01-09 01:50:18 rar/technote.txt-rw-r----- root/root 6018 2007-01-09 01:50:18 rar/whatsnew.txt-rwxr-xr-x root/root 341152 2007-01-09 01:50:18 rar/rar-rwxr-xr-x root/root 872804 2007-01-09 01:50:18 rar/rar_static-rwxr-xr-x root/root 196720 2007-01-09 01:50:18 rar/unrar-rwxr-xr-x root/root 56994 2007-01-09 01:50:18 rar/default.sfx+ STATUS=0+ '[' 0 -ne 0 ']'+ cd rar++ /usr/bin/id -u+ '[' 0 = 0 ']'+ /bin/chown -Rhf root .++ /usr/bin/id -u+ '[' 0 = 0 ']'+ /bin/chgrp -Rhf root .+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .+ exit 0Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.1562+ umask 022+ cd /usr/src/redhat/BUILD+ cd rar+ /bin/rm -rf /var/tmp/rar-3.7-1-root+ /usr/bin/install -D -p -m0755 rar /var/tmp/rar-3.7-1-root/usr/bin/rar+ /usr/bin/install -D -p -m0644 rarfiles.lst /var/tmp/rar-3.7-1-root/etc/rarfiles.lst+ /usr/bin/install -D -p -m0755 default.sfx /var/tmp/rar-3.7-1-root/usr/lib/default.sfx+ /usr/lib/rpm/brp-compress+ /usr/lib/rpm/brp-strip+ /usr/lib/rpm/brp-strip-static-archive+ /usr/lib/rpm/brp-strip-comment-notestrip: there are no sections to be copied!Processing files: rar-3.7-1Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.1562+ umask 022+ cd /usr/src/redhat/BUILD+ cd rar+ DOCDIR=/var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ export DOCDIR+ rm -rf /var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ /bin/mkdir -p /var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ cp -pr license.txt rar.txt readme.txt technote.txt whatsnew.txt file_id.diz /var/tmp/rar-3.7-1-root/usr/share/doc/rar-3.7+ exit 0Finding Provides: /usr/lib/rpm/find-providesFinding Requires: /usr/lib/rpm/find-requiresRequires(rpmlib): rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1Requires: libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3) libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.4) libgcc_s.so.1 libgcc_s.so.1(GCC_3.0) libgcc_s.so.1(GLIBC_2.0) libm.so.6 libstdc++.so.6 libstdc++.so.6(GLIBCXX_3.4)Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/rar-3.7-1-rootWrote: /usr/src/redhat/SRPMS/rar-3.7-1.src.rpmWrote: /usr/src/redhat/RPMS/i386/rar-3.7-1.i386.rpmExecuting(%clean): /bin/sh -e /var/tmp/rpm-tmp.61074+ umask 022+ cd /usr/src/redhat/BUILD+ cd rar+ /bin/rm -rf /var/tmp/rar-3.7-1-root+ exit 0
哈哈,很顺利的结束了。看看文件去:
[root@liukai rpm]# ls /usr/src/redhat/RPMS/i386rar-3.7-1.i386.rpm[root@liukai rpm]# ls /usr/src/redhat/RPMS/i686[root@liukai rpm]# rpm2cpio /usr/src/redhat/RPMS/i386/rar-3.7-1.i386.rpm | cpio -t./etc/rarfiles.lst./usr/bin/rar./usr/lib/default.sfx./usr/share/doc/rar-3.7./usr/share/doc/rar-3.7/file_id.diz./usr/share/doc/rar-3.7/license.txt./usr/share/doc/rar-3.7/rar.txt./usr/share/doc/rar-3.7/readme.txt./usr/share/doc/rar-3.7/technote.txt./usr/share/doc/rar-3.7/whatsnew.txt952 blocks
现在心情很好!
红旗2009开源软件大赛RPM附加题原题地址为:
中的“附加题:收据打包项目(可选题)”小节