tar.gz包转成rpm包

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

在执行打包时报错:

[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 -xzvf azkaban-exec-server-3.15.0.tar.gz -C ./azkaban-exec-server-3.15.0 --strip-components 1

你可能感兴趣的:(linux)