当前位置: 技术问答>linux和unix
请问只包含可执行文件的rpm包应该如何制作?
来源: 互联网 发布时间:2015-12-15
本文导语: 大家好,我想用把我的程序做一个rpm的安装包,实现安装和卸载,但是我从网络上找到的例子都是基于源码的,如果不带源码的安装包怎么实现的呢?我的spec文件如下: Name: ffb Version: 2.1 Release: 1 Summary: Test2.1 Group:...
大家好,我想用把我的程序做一个rpm的安装包,实现安装和卸载,但是我从网络上找到的例子都是基于源码的,如果不带源码的安装包怎么实现的呢?我的spec文件如下:
Name: ffb
Version: 2.1
Release: 1
Summary: Test2.1
Group: Applications/Productivity
Source0: a.tar.gz
NoSource:0
License: Commercial
Vendor: Hoker
Packager: ffb
Prefix: /usr/local/test
Buildroot:/home/ffb/setup
Exclusivearch : i386
Exclusiveos : linux solaris
%description
%prep
echo "prep"
%setup
echo "setup"
%build
echo "build"
%install
echo "install"
mkdir -p /usr/local/test
cp /home/ffb/setup/cryptest.exe /usr/local/test
%clean
echo "clean"
%pre
echo "pre"
%post
echo "post"
%preun
echo "preun"
%postun
echo "postun"
%files
/cryptest.exe
/CommonFiles
%defattr (-,root,root)
%changelog
* Fri Sep 15 2006 ffb
- First
(编译后没有生成rpm文件)
我的目的就是能把我的文件(有几十个,分在几个目录中)安装到指定的位置,并能实现卸载就可以了,谢谢大家。
附:编译结果:
[root@vmrhel3 setup1]# rpmbuild -bb ffb.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.36479
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo prep
prep
+ cd /usr/src/redhat/BUILD
+ rm -rf pyw-2.1
+ /usr/bin/gzip -dc /usr/src/redhat/SOURCES/a.tgz
+ tar -xvvf -
drwxr-xr-x root/root 0 2006-09-15 11:04:39 pyw-2.1/
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd pyw-2.1
++ /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,g-w,o-w .
+ echo setup
setup
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.84572
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd pyw-2.1
+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo build
build
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.84572
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd pyw-2.1
+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo install
install
+ cp /home/pyw/setup/cryptest.exe /usr/local/hoker/test
+ cp /home/pyw/setup/a.out /usr/local/hoker/test
+ /usr/local/hoker/test/a.out
Hello RPM World!
+ /usr/lib/rpm/find-debuginfo.sh /usr/src/redhat/BUILD/pyw-2.1
0 blocks
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
Processing files: pyw-2.1-1
Requires(interp): /bin/sh /bin/sh /bin/sh /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames)
Name: ffb
Version: 2.1
Release: 1
Summary: Test2.1
Group: Applications/Productivity
Source0: a.tar.gz
NoSource:0
License: Commercial
Vendor: Hoker
Packager: ffb
Prefix: /usr/local/test
Buildroot:/home/ffb/setup
Exclusivearch : i386
Exclusiveos : linux solaris
%description
%prep
echo "prep"
%setup
echo "setup"
%build
echo "build"
%install
echo "install"
mkdir -p /usr/local/test
cp /home/ffb/setup/cryptest.exe /usr/local/test
%clean
echo "clean"
%pre
echo "pre"
%post
echo "post"
%preun
echo "preun"
%postun
echo "postun"
%files
/cryptest.exe
/CommonFiles
%defattr (-,root,root)
%changelog
* Fri Sep 15 2006 ffb
- First
(编译后没有生成rpm文件)
我的目的就是能把我的文件(有几十个,分在几个目录中)安装到指定的位置,并能实现卸载就可以了,谢谢大家。
附:编译结果:
[root@vmrhel3 setup1]# rpmbuild -bb ffb.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.36479
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo prep
prep
+ cd /usr/src/redhat/BUILD
+ rm -rf pyw-2.1
+ /usr/bin/gzip -dc /usr/src/redhat/SOURCES/a.tgz
+ tar -xvvf -
drwxr-xr-x root/root 0 2006-09-15 11:04:39 pyw-2.1/
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd pyw-2.1
++ /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,g-w,o-w .
+ echo setup
setup
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.84572
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd pyw-2.1
+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo build
build
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.84572
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd pyw-2.1
+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo install
install
+ cp /home/pyw/setup/cryptest.exe /usr/local/hoker/test
+ cp /home/pyw/setup/a.out /usr/local/hoker/test
+ /usr/local/hoker/test/a.out
Hello RPM World!
+ /usr/lib/rpm/find-debuginfo.sh /usr/src/redhat/BUILD/pyw-2.1
0 blocks
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
Processing files: pyw-2.1-1
Requires(interp): /bin/sh /bin/sh /bin/sh /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames)