关于打包的一些疑问,提示 /var/tmp/rpm-tmp.kCBmaE: line 34: cd: electroni

我在尝试着打包 github.com/geeeeeeeeek/electronic-wechat 这个项目,
可是她已经编译好的压缩包离得路径不是软件名 + 版本的,所以貌似在编译时候解压就会找不到那个目录。
请问我要怎么指定他的源的目录呢。

这个是报错信息。
然后这个是我的 spec,现在还没写完

#
# spec file for package [spectemplate]
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


# See also http://en.opensuse.org/openSUSE:Specfile_guidelines

Name:           electronic-wechat
Version:        v1.4.0
Release:        1
Summary:        A better WeChat on macOS and Linux. Built with Electron.

License:        MIT
Group:          Productivity/Networking/Talk/Clients
Url:            https://github.com/geeeeeeeeek/electronic-wechat
Source0:        linux-x64.tar.gz
Requires:       nodejs
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description


%prep
%setup -q

%build
npm install
npm run build:linux

%install
make install DESTDIR=%{buildroot}

%files
%defattr(-,root,root,-)
%doc

%changelog
* Thu Nov 10 2016 ysw
-

自己解压后把文件夹重命名,然后压缩成 tar.gz,最后修改 spec 文件中的 source

不能指定自己的目录的吗

默认路径是 Name-Version,如果你愿意也可以改名字

我看 /var/tmp/rpm-tmp.kCBmaE 第 34 行的脚本那里貌似目录是写死的,请问我要怎么定义才可以改默认路径呢

只需要修改一行就可以了,比如:

%prep
%setup -n electronic-wechat-linux-x64

-n 后面跟解压后实际的文件夹名字,我写得可能不对,你根据自己的需求改改吧。

这里有篇文章:

rpm.org/max-rpm-snapshot/s1-rpm-specref-macros.html

可以了,谢了