哪个命令无法使用自定义infodir构建

时间:2015-12-24 22:56:33

标签: fedora rpm rpmbuild rpm-spec which

我有这个rpm:which-2.20-12.fc23.src.rpm,我试图用两种不同的方式编译它(一个用gcc,一个用llvm)。我所做的是:

export CC=clang
export CXX=clang++
rpmbuild --rebuild --define='dist .llvm.fc23' --define='_prefix /usr/llvm' which-2.20-12.fc23.src.rpm

export CC=gcc
export CXX=g++
rpmbuild --rebuild --define='dist .gcc.fc23' --define='_prefix /usr/gcc' which-2.20-12.fc23.src.rpm

我的问题是,当我尝试使用不同的_prefix重建它时,我收到此错误:

File not found: /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/info/which.info.gz

就像which.info永远不会压缩...知道为什么会这样吗?我通过定义--define='_bindir %{_exec_prefix}/llvm'

来克服这个问题

以下是规范:

Summary: Displays where a particular program in your path is located
Name: which
Version: 2.20
Release: 12%{?dist}
License: GPLv3
Group: Applications/System
Source0: http://www.xs4all.nl/~carlo17/which/%{name}-%{version}.tar.gz
Source1: which2.sh
Source2: which2.csh
Url: http://www.xs4all.nl/~carlo17/which/
Patch: which-2.19-afs.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: readline-devel
Requires(preun): /sbin/install-info
Requires(post): /sbin/install-info

%description
The which command shows the full pathname of a specified program, if
the specified program is in your PATH.

%prep
%setup -q

%patch -p1 -b .afs

%build
%configure

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
install -p -m 644 %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
rm -f $RPM_BUILD_ROOT%{_infodir}/dir

%post
/sbin/install-info --quiet --info-dir=%{_infodir} %{_infodir}/which.info.gz
exit 0

%preun
if [ $1 = 0 ]; then
   /sbin/install-info --quiet --info-dir=%{_infodir} --delete %{_infodir}/which.info.gz
fi
exit 0

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%license COPYING
%doc EXAMPLES README AUTHORS NEWS
%attr(0644,root,root) %{_sysconfdir}/profile.d/which2.*
%{_bindir}/*
%{_infodir}/which.info.gz
%{_mandir}/*/*

我认为它失败了:%files - > %{_infodir}/which.info.gz

这是完整输出

$ rpmbuild --rebuild --define='dist .llvm.fc23' --define='_prefix /usr/llvm' which-2.20-12.fc23.src.rpm
Installing which-2.20-12.fc23.src.rpm
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.wsalfy
+ umask 022
+ cd /home/vagrant/rpmbuild/BUILD
+ cd /home/vagrant/rpmbuild/BUILD
+ rm -rf which-2.20
+ /usr/bin/tar -xof -
+ /usr/bin/gzip -dc /home/vagrant/rpmbuild/SOURCES/which-2.20.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd which-2.20
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch (which-2.19-afs.patch):'
Patch (which-2.19-afs.patch):
+ /usr/bin/patch -p1 -b --suffix .afs --fuzz=0
patching file bash.c
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.DwQGsR
+ umask 022
+ cd /home/vagrant/rpmbuild/BUILD
+ cd which-2.20
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -I/usr/llvm/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -I/usr/llvm/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
+ export LDFLAGS
+ '[' 1 = 1 ']'
+++ dirname ./configure
++ find . -name config.guess -o -name config.sub
+ '[' 1 = 1 ']'
+ '[' x '!=' x-specs=/usr/lib/rpm/redhat/redhat-hardened-ld ']'
++ find . -name ltmain.sh
+ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr/llvm --exec-prefix=/usr/llvm --bindir=/usr/llvm/bin --sbindir=/usr/llvm/sbin --sysconfdir=/etc --datadir=/usr/llvm/share --includedir=/usr/llvm/include --libdir=/usr/llvm/lib64 --libexecdir=/usr/llvm/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/llvm/share/man --infodir=/usr/llvm/share/info
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for x86_64-redhat-linux-gnu-gcc... clang
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of clang... none
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking for xmalloc in libiberty.a... no
checking for ANSI C header files... (cached) yes
checking for unistd.h... (cached) yes
checking for string.h... (cached) yes
checking libiberty.h usability... no
checking libiberty.h presence... no
checking for libiberty.h... no
checking whether stat file-mode macros are broken... no
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking type of array argument to getgroups... gid_t
checking for strchr... yes
checking for memcpy... yes
checking for getopt_long... yes
checking for getcwd... yes
checking for getwd... yes
checking for ar... ar
checking for x86_64-redhat-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking for stdlib.h... (cached) yes
checking for memory.h... (cached) yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking for strings.h... (cached) yes
checking for getpwent... yes
checking for getpwnam... yes
checking for getpwuid... yes
checking whether programs are able to redeclare getpw functions... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating maintMakefile
config.status: creating tilde/Makefile
config.status: creating config.h
config.status: executing depfiles commands
+ make
make  all-recursive
make[1]: Entering directory '/home/vagrant/rpmbuild/BUILD/which-2.20'
Making all in tilde
make[2]: Entering directory '/home/vagrant/rpmbuild/BUILD/which-2.20/tilde'
clang -DHAVE_CONFIG_H -I. -I..     -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -c tilde.c
clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'
tilde.c:199:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  if (result = strchr (string, '~'))
      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
tilde.c:199:14: note: place parentheses around the assignment to silence this warning
  if (result = strchr (string, '~'))
             ^
      (                            )
tilde.c:199:14: note: use '==' to turn this assignment into an equality comparison
  if (result = strchr (string, '~'))
             ^
             ==
1 warning generated.
clang -DHAVE_CONFIG_H -I. -I..     -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -c shell.c
clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'
rm -f libtilde.a
ar cru libtilde.a tilde.o shell.o
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libtilde.a
make[2]: Leaving directory '/home/vagrant/rpmbuild/BUILD/which-2.20/tilde'
Making all in .
make[2]: Entering directory '/home/vagrant/rpmbuild/BUILD/which-2.20'
clang -DHAVE_CONFIG_H -I.     -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -c getopt.c
clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'
clang -DHAVE_CONFIG_H -I.     -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -c getopt1.c
clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'
clang -DHAVE_CONFIG_H -I.     -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -c bash.c
clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'
clang -DHAVE_CONFIG_H -I.     -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -c which.c
clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'
clang  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o which getopt.o getopt1.o bash.o which.o ./tilde/libtilde.a
clang: warning: argument unused during compilation: '-Wp,-D_FORTIFY_SOURCE=2'
clang: warning: argument unused during compilation: '-grecord-gcc-switches'
clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'
clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
make[2]: Leaving directory '/home/vagrant/rpmbuild/BUILD/which-2.20'
make[1]: Leaving directory '/home/vagrant/rpmbuild/BUILD/which-2.20'
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.VmiScj
+ umask 022
+ cd /home/vagrant/rpmbuild/BUILD
+ '[' /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64 '!=' / ']'
+ rm -rf /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64
++ dirname /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64
+ mkdir -p /home/vagrant/rpmbuild/BUILDROOT
+ mkdir /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64
+ cd which-2.20
+ rm -rf /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64
+ make install DESTDIR=/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64
make  install-recursive
make[1]: Entering directory '/home/vagrant/rpmbuild/BUILD/which-2.20'
Making install in tilde
make[2]: Entering directory '/home/vagrant/rpmbuild/BUILD/which-2.20/tilde'
make[3]: Entering directory '/home/vagrant/rpmbuild/BUILD/which-2.20/tilde'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/vagrant/rpmbuild/BUILD/which-2.20/tilde'
make[2]: Leaving directory '/home/vagrant/rpmbuild/BUILD/which-2.20/tilde'
Making install in .
make[2]: Entering directory '/home/vagrant/rpmbuild/BUILD/which-2.20'
make[3]: Entering directory '/home/vagrant/rpmbuild/BUILD/which-2.20'
test -z "/usr/llvm/bin" || /usr/bin/mkdir -p "/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/bin"
  /usr/bin/install -c 'which' '/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/bin/which'
test -z "/usr/llvm/share/info" || /usr/bin/mkdir -p "/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/info"
 /usr/bin/install -c -m 644 './which.info' '/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/info/which.info'
 install-info --info-dir='/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/info' '/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/info/which.info'
test -z "/usr/llvm/share/man/man1" || /usr/bin/mkdir -p "/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/man/man1"
 /usr/bin/install -c -m 644 './which.1' '/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/man/man1/which.1'
make[3]: Leaving directory '/home/vagrant/rpmbuild/BUILD/which-2.20'
make[2]: Leaving directory '/home/vagrant/rpmbuild/BUILD/which-2.20'
make[1]: Leaving directory '/home/vagrant/rpmbuild/BUILD/which-2.20'
+ mkdir -p /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/etc/profile.d
+ install -p -m 644 /home/vagrant/rpmbuild/SOURCES/which2.sh /home/vagrant/rpmbuild/SOURCES/which2.csh /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/etc/profile.d/
+ rm -f /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/info/dir
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /home/vagrant/rpmbuild/BUILD/which-2.20
extracting debug info from /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/bin/which
dwz: Too few files for multifile optimization
/usr/lib/rpm/sepdebugcrcfix: Updated 1 CRC32s, 0 CRC32s did match.
99 blocks
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: which-2.20-12.llvm.fc23.x86_64
error: File not found: /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/info/which.info.gz
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.XofvML
+ umask 022
+ cd /home/vagrant/rpmbuild/BUILD
+ cd which-2.20
+ DOCDIR=/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/doc/which
+ export DOCDIR
+ /usr/bin/mkdir -p /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/doc/which
+ cp -pr EXAMPLES /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/doc/which
+ cp -pr README /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/doc/which
+ cp -pr AUTHORS /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/doc/which
+ cp -pr NEWS /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/doc/which
+ exit 0
Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.bWadpe
+ umask 022
+ cd /home/vagrant/rpmbuild/BUILD
+ cd which-2.20
+ LICENSEDIR=/home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/licenses/which
+ export LICENSEDIR
+ /usr/bin/mkdir -p /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/licenses/which
+ cp -pr COPYING /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/licenses/which
+ exit 0


RPM build errors:
    File not found: /home/vagrant/rpmbuild/BUILDROOT/which-2.20-12.llvm.fc23.x86_64/usr/llvm/share/info/which.info.gz

0 个答案:

没有答案