centos7上用rpmbuild建立rpm安装包问题(急)

centos7.1

php-5.6.25

$ ls rpmbuild/
BUILD BUILDROOT RPMS SOURCES SPECS SRPMS

$cat rpmbuild/SPECS/php.spec
Name: php
Version: 5.6.25
Release: 1%{?dist}
Summary: compiled from 5.6.25 by Kevin

Group: System Environment/Daemons
License: GPL
URL: https://secure.php.net
Source0: php-5.6.25.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildRequires: gcc, gcc-c++, openssl-devel
Requires: wireshark-gnome

%description
php server. Compiled from 5.6.25 by Kevin

%prep
%setup -q

%build
./configure '--with-libdir=lib64' '--prefix=/usr/local/php5.6' '--with-fpm-systemd' '--enable-fpm' '--enable-mbstring' '--with-mysql' '--with-mysqli' '--with-pdo-mysql' '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir' '--with-curl' '--with-openssl' '--with-mcrypt' '--enable-zip' '--enable-intl'
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%defattr(-,root,root,-)
/usr/local/php5.6/bin/*
/usr/local/php5.6/sbin/*
/usr/local/php5.6/include/*
/usr/local/php5.6/php/php/fpm/*
/usr/local/php5.6/php/man/man1/*
/usr/local/php5.6/php/man/man8/*
/usr/local/php5.6/lib/php/*
/usr/local/php5.6/lib/php/extensions/*
/usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/*
/usr/local/php5.6/lib/php/build/*
/usr/local/php5.6/lib/php/build/shtool/*
/usr/local/php5.6/lib/php/.registry/*
/usr/local/php5.6/lib/php/.channels/*
/usr/local/php5.6/lib/php/Archive/*
/usr/local/php5.6/lib/php/doc/*
/usr/local/php5.6/lib/php/doc/Archive_Tar/*
/usr/local/php5.6/lib/php/doc/Archive_Tar/docs/*
/usr/local/php5.6/lib/php/doc/Structures_Graph/*
/usr/local/php5.6/lib/php/doc/Structures_Graph/docs/*
/usr/local/php5.6/lib/php/doc/Structures_Graph/docs/tutorials/*
/usr/local/php5.6/lib/php/doc/Structures_Graph/docs/tutorials/Structures_Graph/*
/usr/local/php5.6/lib/php/doc/Structures_Graph/LICENSE/*
/usr/local/php5.6/lib/php/doc/XML_Util/*
/usr/local/php5.6/lib/php/doc/XML_Util/examples/*
/usr/local/php5.6/lib/php/doc/PEAR/*
/usr/local/php5.6/lib/php/doc/PEAR/LICENSE/*
/usr/local/php5.6/lib/php/doc/PEAR/INSTALL/*
/usr/local/php5.6/lib/php/Console/*
/usr/local/php5.6/lib/php/test/*
/usr/local/php5.6/lib/php/test/Console_Getopt/*
/usr/local/php5.6/lib/php/test/Console_Getopt/tests/*
/usr/local/php5.6/lib/php/test/Structures_Graph/*
/usr/local/php5.6/lib/php/test/Structures_Graph/tests/*
/usr/local/php5.6/lib/php/test/XML_Util/*
/usr/local/php5.6/lib/php/test/XML_Util/tests/*
/usr/local/php5.6/lib/php/Structures/*
/usr/local/php5.6/lib/php/Structures/Graph/*
/usr/local/php5.6/lib/php/Structures/Graph/Manipulator/*
/usr/local/php5.6/lib/php/XML/*
/usr/local/php5.6/lib/php/OS/*
/usr/local/php5.6/lib/php/PEAR/*
/usr/local/php5.6/lib/php/PEAR/ChannelFile/*
/usr/local/php5.6/lib/php/PEAR/Command/*
/usr/local/php5.6/lib/php/PEAR/Downloader/*
/usr/local/php5.6/lib/php/PEAR/Frontend/*
/usr/local/php5.6/lib/php/PEAR/Installer/*
/usr/local/php5.6/lib/php/PEAR/Installer/Role/*
/usr/local/php5.6/lib/php/PEAR/PackageFile/*
/usr/local/php5.6/lib/php/PEAR/PackageFile/Generator/*
/usr/local/php5.6/lib/php/PEAR/PackageFile/Parser/*
/usr/local/php5.6/lib/php/PEAR/PackageFile/v2/*
/usr/local/php5.6/lib/php/PEAR/REST/*
/usr/local/php5.6/lib/php/PEAR/Task/*
/usr/local/php5.6/lib/php/PEAR/Task/Postinstallscript/*
/usr/local/php5.6/lib/php/PEAR/Task/Replace/*
/usr/local/php5.6/lib/php/PEAR/Task/Unixeol/*
/usr/local/php5.6/lib/php/PEAR/Task/Windowseol/*
/usr/local/php5.6/lib/php/PEAR/Validator/*
/usr/local/php5.6/lib/php/data/*
/usr/local/php5.6/lib/php/data/PEAR/*
%config /usr/local/php5.6/etc/*
/usr/local/php5.6/var/run/*
/usr/local/php5.6/lib/*
%dir /usr/local/php5.6/var/log/

%post
cp /usr/local/php5.6/etc/php-fpm.conf.default /usr/local/php5.6/etc/php-fpm.conf
ln -s /usr/local/php5.6/bin/php /usr/bin/php

%changelog

  • Tue Aug 30 2016 Kevin 5.6.25
  • first rpm from php-5.6.25

然后用一个user用户为centos,没在root下执行
$ rpmbuild -ba rpmbuild/SPECS/php.spec

最后报错
Build complete.
Don't forget to run 'make test'.

  • exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.QjJHDq
  • umask 022
  • cd /home/centos/rpmbuild/BUILD
  • '[' /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 '!=' / ']'
  • rm -rf /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 ++ dirname /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64
  • mkdir -p /home/centos/rpmbuild/BUILDROOT
  • mkdir /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64
  • cd php-5.6.25
  • rm -rf /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64
  • make install DESTDIR=/home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 Installing shared extensions: /usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/ Installing PHP CLI binary: /usr/local/php5.6/bin/ Installing PHP CLI man page: /usr/local/php5.6/php/man/man1/ Installing PHP FPM binary: /usr/local/php5.6/sbin/ Installing PHP FPM config: /usr/local/php5.6/etc/ Installing PHP FPM man page: /usr/local/php5.6/php/man/man8/ Installing PHP FPM status page: /usr/local/php5.6/php/php/fpm/ Installing PHP CGI binary: /usr/local/php5.6/bin/ Installing PHP CGI man page: /usr/local/php5.6/php/man/man1/ Installing build environment: /usr/local/php5.6/lib/php/build/ Installing header files: /usr/local/php5.6/include/php/ Installing helper programs: /usr/local/php5.6/bin/ program: phpize program: php-config Installing man pages: /usr/local/php5.6/php/man/man1/ page: phpize.1 page: php-config.1 Installing PEAR environment: /usr/local/php5.6/lib/php/ [PEAR] Archive_Tar - already installed: 1.4.0 [PEAR] Console_Getopt - already installed: 1.4.1 [PEAR] Structures_Graph- already installed: 1.1.1 [PEAR] XML_Util - already installed: 1.3.0 [PEAR] PEAR - already installed: 1.10.1 Wrote PEAR system config file at: /usr/local/php5.6/etc/pear.conf You may want to add: /usr/local/php5.6/lib/php to your php.ini include_path /home/centos/rpmbuild/BUILD/php-5.6.25/build/shtool install -c ext/phar/phar.phar /usr/local/php5.6/bin ln -s -f phar.phar /usr/local/php5.6/bin/phar Installing PDO headers: /usr/local/php5.6/include/php/ext/pdo/
  • /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /home/centos/rpmbuild/BUILD/php-5.6.25

find: '/home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64': No such file or directory

error: Bad exit status from /var/tmp/rpm-tmp.QjJHDq (%install)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.QjJHDq (%install)

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问