title: rpmbuild php package can not create directory permission denied then %install
body: <p>I want to custom build a php rpm package, but I have some problem in the <code>%install</code> time, errors show as follows:</p>
  
  <pre class="lang-sh prettyprint-override"><code>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)
  </code></pre>
  
  <p>My php Spec file is here:</p>
  
  <pre class="lang-sh prettyprint-override"><code>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
  </code></pre>
  
  <p>How can I create the <code>/usr/local/lib/php</code> permission or own the right permission ?</p>
  
  <p>Any help you ?</p>