我在尝试着打包 github.com/geeeeeeeeek/electronic-wechat 这个项目,
可是她已经编译好的压缩包离得路径不是软件名 + 版本的,所以貌似在编译时候解压就会找不到那个目录。
请问我要怎么指定他的源的目录呢。
➜ electronic-wechat osc build Building newpackage.spec for openSUSE_Tumbleweed/x86_64 Getting buildinfo from server and store to /home/ysw/build/home:365039311/electronic-wechat/.osc/_buildinfo-openSUSE_Tumbleweed-x86_64.xml Getting buildconfig from server and store to /home/ysw/build/home:365039311/electronic-wechat/.osc/_buildconfig-openSUSE_Tumbleweed-x86_64 Updating cache of required packages 0.0% cache miss. 111/111 dependencies cached. Verifying integrity of cached packages using keys from openSUSE:Factory Writing build configuration Running build logging output to /var/tmp/build-root/openSUSE_Tumbleweed-x86_64/.build.log… 0s] Memory limit set to 10962212KB 0s] Using BUILD_ROOT=/var/tmp/build-root/openSUSE_Tumbleweed-x86_64 0s] Using BUILD_ARCH=x86_64:i686:i586:i486:i386 0s] 1s] 1s] linux-xl70 started “build newpackage.spec” at Mon Nov 28 09:45:51 UTC 2016. 1s] 1s] 1s] processing recipe /home/ysw/build/home:365039311/electronic-wechat/newpackage.spec … 1s] running changelog2spec --target rpm --file /home/ysw/build/home:365039311/electronic-wechat/newpackage.spec 1s] init_buildsystem --configdir /usr/lib/build/configs --cachedir /var/cache/build --rpmlist /tmp/rpmlist.B2iLzP /home/ysw/build/home:365039311/electronic-wechat/newpackage.spec … 1s] reordering…cycle: libcrack2 → cracklib 1s] breaking dependency libcrack2 → cracklib 1s] done 1s] [1/111] keeping file-magic-5.28-3.1 2s] [2/111] keeping filesystem-13.3-10.2 2s] [3/111] keeping kernel-obs-build-4.8.10-1.1 2s] [4/111] keeping libtirpc-netconfig-1.0.1-3.27 2s] [5/111] keeping terminfo-base-6.0-16.1 2s] [6/111] keeping glibc-2.24-2.2 2s] [7/111] keeping fillup-1.42-273.8 2s] [8/111] keeping hostname-3.16-2.93 2s] [9/111] keeping libatomic1-6.2.1+r239849-1.5 2s] [10/111] keeping libattr1-2.4.47-7.103 3s] [11/111] keeping libaudit1-2.5-1.82 3s] [12/111] keeping libbz2-1-1.0.6-37.82 3s] [13/111] keeping libcap-ng0-0.7.7-1.92 3s] [14/111] keeping libcap2-2.25-1.4 3s] [15/111] keeping libcom_err2-1.43.3-1.4 3s] [16/111] keeping libgcc_s1-6.2.1+r239849-1.5 3s] [17/111] keeping libgdbm4-1.12-1.21 4s] [18/111] keeping libgmp10-6.1.1-1.5 4s] [19/111] keeping libgomp1-6.2.1+r239849-1.5 4s] [20/111] keeping libitm1-6.2.1+r239849-1.5 4s] [21/111] keeping libkeyutils1-1.5.9-5.33 4s] [22/111] keeping liblua5_3-5.3.3-1.4 4s] [23/111] keeping liblzma5-5.2.2-4.91 4s] [24/111] keeping libmpx2-6.2.1+r239849-1.5 4s] [25/111] keeping libmpxwrappers2-6.2.1+r239849-1.5 5s] [26/111] keeping libpcre1-8.39-2.5 5s] [27/111] keeping libpopt0-1.16-28.95 5s] [28/111] keeping libsepol1-2.5-2.5 5s] [29/111] keeping libsmartcols1-2.28.2-2.1 5s] [30/111] keeping libuuid1-2.28.2-2.1 5s] [31/111] keeping libverto1-0.2.6-4.30 5s] [32/111] keeping libz1-1.2.8-11.78 5s] [33/111] keeping patch-2.7.5-1.112 5s] [34/111] keeping perl-base-5.24.0-3.5 6s] [35/111] keeping brp-extract-appdata-2016.05.04-1.1 6s] [36/111] keeping build-mkbaselibs-20161025-1.1 6s] [37/111] keeping insserv-compat-0.1-17.93 6s] [38/111] keeping attr-2.4.47-7.103 6s] [39/111] keeping libacl1-2.2.52-8.9 6s] [40/111] keeping libasan3-6.2.1+r239849-1.5 6s] [41/111] keeping libblkid1-2.28.2-2.1 6s] [42/111] keeping libelf1-0.167-1.5 7s] [43/111] keeping libisl15-0.16.1-1.90 7s] [44/111] keeping liblsan0-6.2.1+r239849-1.5 7s] [45/111] keeping libmpfr4-3.1.5-2.1 7s] [46/111] keeping libselinux1-2.5-2.5 7s] [47/111] keeping libstdc++6-6.2.1+r239849-1.5 7s] [48/111] keeping libtsan0-6.2.1+r239849-1.5 7s] [49/111] keeping net-tools-1.60-770.1 7s] [50/111] keeping libmagic1-5.28-3.1 8s] [51/111] keeping libzio1-1.02-1.112 8s] [52/111] keeping file-5.28-3.1 8s] [53/111] keeping libcilkrts5-6.2.1+r239849-1.5 8s] [54/111] keeping libdb-4_8-4.8.30-31.83 8s] [55/111] keeping libfdisk1-2.28.2-2.1 8s] [56/111] keeping libmount1-2.28.2-2.1 8s] [57/111] keeping libmpc3-1.0.3-1.109 9s] [58/111] keeping libubsan0-6.2.1+r239849-1.5 9s] [59/111] keeping libncurses5-6.0-16.1 9s] [60/111] keeping libncurses6-6.0-16.1 9s] [61/111] keeping libreadline7-7.0-90.1 9s] [62/111] keeping ncurses-utils-6.0-16.1 9s] [63/111] keeping cpp6-6.2.1+r239849-1.5 9s] [64/111] keeping perl-5.24.0-3.5 10s] [65/111] keeping brp-check-suse-84.87+git20160906.bb0a7d0-1.1 10s] [66/111] keeping bash-4.4-90.1 10s] [67/111] keeping cpp-6-2.4 10s] [68/111] keeping bzip2-1.0.6-37.82 10s] [69/111] keeping xz-5.2.2-4.91 10s] [70/111] keeping info-6.1-2.5 10s] [71/111] keeping iproute2-4.8-2.1 10s] [72/111] keeping cpio-2.12-3.90 11s] [73/111] keeping diffutils-3.5-2.1 11s] [74/111] keeping gzip-1.8-1.29 11s] [75/111] keeping m4-1.4.17-5.7 11s] [76/111] keeping make-4.2.1-1.5 11s] [77/111] keeping which-2.21-3.5 11s] [78/111] keeping findutils-4.6.0-2.24 11s] [79/111] keeping gettext-runtime-mini-0.19.8.1-1.5 12s] [80/111] keeping grep-2.26-1.1 12s] [81/111] keeping sed-4.2.2-9.59 12s] [82/111] keeping tar-1.29-2.1 12s] [83/111] keeping coreutils-8.25-4.1 12s] [84/111] keeping systemd-rpm-macros-3-5.30 12s] [85/111] keeping linux-glibc-devel-4.8-1.1 12s] [86/111] keeping glibc-locale-2.24-2.2 12s] [87/111] keeping update-alternatives-1.18.10-1.4 12s] [88/111] keeping gettext-tools-mini-0.19.8.1-1.5 13s] [89/111] keeping permissions-20160807-1.3 13s] [90/111] keeping krb5-mini-1.14.3-1.5 13s] [91/111] keeping rpm-4.12.0.1-14.1 13s] [92/111] keeping glibc-devel-2.24-2.2 13s] [93/111] keeping libtirpc3-1.0.1-3.27 13s] [94/111] keeping libutempter0-1.1.6-8.112 13s] [95/111] keeping binutils-2.27-1.5 13s] [96/111] keeping gawk-4.1.4-1.4 13s] [97/111] keeping rpmlint-mini-1.8-3.2 14s] [98/111] keeping rpmlint-Factory-1.0-89.415 14s] [99/111] keeping libnsl2-1.0.4-1.27 14s] [100/111] keeping build-compare-20161109T075305.eed6e97-1.1 14s] [101/111] keeping gcc6-6.2.1+r239849-1.5 14s] [102/111] keeping gcc-6-2.4 14s] [103/111] keeping libcrack2-2.9.5-2.6 14s] [104/111] keeping cracklib-2.9.5-2.6 14s] [105/111] keeping pam-1.3.0-3.4 14s] [106/111] keeping pam-modules-12.1-27.4 15s] [107/111] keeping util-linux-2.28.2-2.1 15s] [108/111] keeping aaa_base-13.2+git20160915.106a00d-1.1 15s] [109/111] keeping rpm-build-4.12.0.1-14.1 15s] [110/111] keeping aaa_base-malloccheck-13.2+git20160915.106a00d-1.1 15s] [111/111] keeping post-build-checks-13.2+git20160512.be9650e-1.2 15s] removing nis flags from /var/tmp/build-root/openSUSE_Tumbleweed-x86_64/etc/nsswitch.conf… 15s] now finalizing build dir… 16s] ----------------------------------------------------------------- 16s] ----- building newpackage.spec (user abuild) 16s] ----------------------------------------------------------------- 16s] ----------------------------------------------------------------- 16s] + exec rpmbuild -ba --define ‘_srcdefattr (-,root,root)’ --nosignature /home/abuild/rpmbuild/SOURCES/newpackage.spec 16s] Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.kCBmaE 16s] + umask 022 16s] + cd /home/abuild/rpmbuild/BUILD 16s] + cd /home/abuild/rpmbuild/BUILD 16s] + rm -rf electronic-wechat-linux-v1.4.0 16s] + /usr/bin/gzip -dc /home/abuild/rpmbuild/SOURCES/linux-x64.tar.gz 16s] + /bin/tar -xf - 17s] + STATUS=0 17s] + ‘’ 0 -ne 0 ‘]’ 17s] + cd electronic-wechat-linux-v1.4.0 17s] /var/tmp/rpm-tmp.kCBmaE: line 34: cd: electronic-wechat-linux-v1.4.0: No such file or directory 17s] error: Bad exit status from /var/tmp/rpm-tmp.kCBmaE (%prep) 17s] 17s] 17s] RPM build errors: 17s] Bad exit status from /var/tmp/rpm-tmp.kCBmaE (%prep) 17s] 17s] linux-xl70 failed “build newpackage.spec” at Mon Nov 28 09:46:07 UTC 2016. 17s] The buildroot was: /var/tmp/build-root/openSUSE_Tumbleweed-x86_64
这个是报错信息。
然后这个是我的 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
-
gmg137
(gmg137)
2016年11月28日 14:53
2
自己解压后把文件夹重命名,然后压缩成 tar.gz,最后修改 spec 文件中的 source
gmg137
(gmg137)
2016年11月28日 15:02
4
默认路径是 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