tar.gz包转成rpm包

时间:2021-01-27 21:07:37

目标包名不能包含的版本中不能包含“-”

在执行打包时报错:

[root@isunode005 SPECS]# rpmbuild -ba azkaban-exec-server.spec 

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.lqgB79
+ umask 022
+ cd /root/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /root/rpmbuild/BUILD
+ rm -rf azkaban-exec-server-3.15.0
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/azkaban-exec-server-3.15.0.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd azkaban-exec-server-3.15.0
/var/tmp/rpm-tmp.lqgB79: line 38: cd: azkaban-exec-server-3.15.0: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.lqgB79 (%prep)

RPM build errors:

    Bad exit status from /var/tmp/rpm-tmp.lqgB79 (%prep)

解决办法:

tar.gz包直接修改名称是无效的,解压后依然是原来的名称。

tar.gz包名称修改:mkdir ./azkaban-exec-server-3.15.0 && tar -xzvfazkaban-exec-server-3.15.0.tar.gz -C ./azkaban-exec-server-3.15.0 --strip-components 1