I want to custom build a php rpm package, but I have some problem in the %install
time, errors show as follows:
Build complete.
Don't forget to run 'make test'.
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.JrATF9
+ umask 022
+ cd /home/work/rpmbuild/BUILD
+ '[' /home/work/rpmbuild/BUILDROOT/php-7.3.2-1.el7.x86_64 '!=' / ']'
+ rm -rf /home/work/rpmbuild/BUILDROOT/php-7.3.2-1.el7.x86_64
++ dirname /home/work/rpmbuild/BUILDROOT/php-7.3.2-1.el7.x86_64
+ mkdir -p /home/work/rpmbuild/BUILDROOT
+ mkdir /home/work/rpmbuild/BUILDROOT/php-7.3.2-1.el7.x86_64
+ cd php-7.3.2
+ rm -rf /home/work/rpmbuild/BUILDROOT/php-7.3.2-1.el7.x86_64
+ /usr/bin/mkdir -p /home/work/rpmbuild/BUILDROOT/php-7.3.2-1.el7.x86_64/usr/local/lib/php/extensions/no-debug-non-zts-20180731
+ /usr/bin/make install DESTDIR=/home/work/rpmbuild/BUILDROOT/php-7.3.2-1.el7.x86_64
mkdir: cannot create directory '/usr/local/lib/php': Permission denied
mkdir: cannot create directory '/usr/local/lib/php/extensions': No such file or directory
mkdir: cannot create directory '/usr/local/lib/php/extensions/no-debug-non-zts-20180731': No such file or directory
make: *** [install-modules] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.JrATF9 (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.JrATF9 (%install)
My php Spec file is here:
Name: php
Version: 7.3.2
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%prep
%setup -q
%build
./configure --enable-fpm --enable-mbstring --with-pdo-mysql --without-sqlite3 --without-pdo-sqlite --with-openssl --with-zlib --with-curl --with-libdir=lib64
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
%{__mkdir} -p $RPM_BUILD_ROOT/usr/local/lib/php/extensions/no-debug-non-zts-20180731
%make_install
%files
%defattr(-,root,root)
%attr(0755,root,root) %dir /usr/local/lib/php
%attr(0755,root,root) %dir /usr/local/lib/php/extensions
%attr(0755,root,root) %dir /usr/local/lib/php/extensions/no-debug-non-zts-20180731
How can I create the /usr/local/lib/php
permission or own the right permission ?
Any help you ?