Replace $RPM_BUILD_ROOT with %{buildroot}

Signed-off-by: Björn Esser <besser82@fedoraproject.org>
This commit is contained in:
Björn Esser 2021-10-06 22:11:31 +02:00
parent 4d6342409b
commit b3e1d168dd
No known key found for this signature in database
GPG Key ID: F52E98007594C21D
1 changed files with 36 additions and 35 deletions

View File

@ -139,66 +139,66 @@ install -D -m 644 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/macros.d/macros.%{name
%make_install LDCONFIG=:
# Temporary compat link
ln -sf pam_sepermit.so $RPM_BUILD_ROOT%{_pam_moduledir}/pam_selinux_permit.so
ln -sf pam_sepermit.so %{buildroot}%{_pam_moduledir}/pam_selinux_permit.so
# RPM uses docs from source tree
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/Linux-PAM
rm -rf %{buildroot}%{_datadir}/doc/Linux-PAM
# Included in setup package
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/environment
rm -f %{buildroot}%{_sysconfdir}/environment
# Install default configuration files.
install -d -m 755 $RPM_BUILD_ROOT%{_pam_confdir}
install -d -m 755 $RPM_BUILD_ROOT%{_pam_vendordir}
install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_pam_confdir}/other
install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_pam_confdir}/system-auth
install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_pam_confdir}/password-auth
install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_pam_confdir}/fingerprint-auth
install -m 644 %{SOURCE9} $RPM_BUILD_ROOT%{_pam_confdir}/smartcard-auth
install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_pam_confdir}/config-util
install -m 644 %{SOURCE16} $RPM_BUILD_ROOT%{_pam_confdir}/postlogin
install -m 600 /dev/null $RPM_BUILD_ROOT%{_pam_secconfdir}/opasswd
install -d -m 755 $RPM_BUILD_ROOT/var/log
install -d -m 755 $RPM_BUILD_ROOT/var/run/faillock
install -d -m 755 $RPM_BUILD_ROOT/usr/lib/motd.d
install -d -m 755 $RPM_BUILD_ROOT/run/motd.d
install -d -m 755 %{buildroot}%{_pam_confdir}
install -d -m 755 %{buildroot}%{_pam_vendordir}
install -m 644 %{SOURCE5} %{buildroot}%{_pam_confdir}/other
install -m 644 %{SOURCE6} %{buildroot}%{_pam_confdir}/system-auth
install -m 644 %{SOURCE7} %{buildroot}%{_pam_confdir}/password-auth
install -m 644 %{SOURCE8} %{buildroot}%{_pam_confdir}/fingerprint-auth
install -m 644 %{SOURCE9} %{buildroot}%{_pam_confdir}/smartcard-auth
install -m 644 %{SOURCE10} %{buildroot}%{_pam_confdir}/config-util
install -m 644 %{SOURCE16} %{buildroot}%{_pam_confdir}/postlogin
install -m 600 /dev/null %{buildroot}%{_pam_secconfdir}/opasswd
install -d -m 755 %{buildroot}/var/log
install -d -m 755 %{buildroot}/var/run/faillock
install -d -m 755 %{buildroot}/usr/lib/motd.d
install -d -m 755 %{buildroot}/run/motd.d
# Install man pages.
install -m 644 %{SOURCE12} %{SOURCE13} %{SOURCE17} $RPM_BUILD_ROOT%{_mandir}/man5/
ln -sf system-auth.5 $RPM_BUILD_ROOT%{_mandir}/man5/password-auth.5
ln -sf system-auth.5 $RPM_BUILD_ROOT%{_mandir}/man5/fingerprint-auth.5
ln -sf system-auth.5 $RPM_BUILD_ROOT%{_mandir}/man5/smartcard-auth.5
install -m 644 %{SOURCE12} %{SOURCE13} %{SOURCE17} %{buildroot}%{_mandir}/man5/
ln -sf system-auth.5 %{buildroot}%{_mandir}/man5/password-auth.5
ln -sf system-auth.5 %{buildroot}%{_mandir}/man5/fingerprint-auth.5
ln -sf system-auth.5 %{buildroot}%{_mandir}/man5/smartcard-auth.5
for phase in auth acct passwd session ; do
ln -sf pam_unix.so $RPM_BUILD_ROOT%{_pam_moduledir}/pam_unix_${phase}.so
ln -sf pam_unix.so %{buildroot}%{_pam_moduledir}/pam_unix_${phase}.so
done
# Remove .la files and make new .so links -- this depends on the value
# of _libdir not changing, and *not* being /usr/lib.
for lib in libpam libpamc libpam_misc ; do
rm -f $RPM_BUILD_ROOT%{_pam_libdir}/${lib}.la
rm -f %{buildroot}%{_pam_libdir}/${lib}.la
done
rm -f $RPM_BUILD_ROOT%{_pam_moduledir}/*.la
rm -f %{buildroot}%{_pam_moduledir}/*.la
%if "%{_pam_libdir}" != "%{_libdir}"
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}
install -d -m 755 %{buildroot}%{_libdir}
for lib in libpam libpamc libpam_misc ; do
pushd $RPM_BUILD_ROOT%{_libdir}
pushd %{buildroot}%{_libdir}
ln -sf %{_pam_libdir}/${lib}.so.*.* ${lib}.so
popd
rm -f $RPM_BUILD_ROOT%{_pam_libdir}/${lib}.so
rm -f %{buildroot}%{_pam_libdir}/${lib}.so
done
%endif
# Duplicate doc file sets.
rm -fr $RPM_BUILD_ROOT/usr/share/doc/pam
rm -fr %{buildroot}/usr/share/doc/pam
# Install the file for autocreation of /var/run subdirectories on boot
install -m644 -D %{SOURCE15} $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d/pam.conf
install -m644 -D %{SOURCE15} %{buildroot}%{_prefix}/lib/tmpfiles.d/pam.conf
# Install systemd unit file.
install -m644 -D modules/pam_namespace/pam_namespace.service \
$RPM_BUILD_ROOT%{_unitdir}/pam_namespace.service
%{buildroot}%{_unitdir}/pam_namespace.service
%find_lang Linux-PAM
@ -209,7 +209,7 @@ if [ -d ${dir} ] ; then
[ ${dir} = "modules/pam_selinux" ] && continue
[ ${dir} = "modules/pam_sepermit" ] && continue
[ ${dir} = "modules/pam_tty_audit" ] && continue
if ! ls -1 $RPM_BUILD_ROOT%{_pam_moduledir}/`basename ${dir}`*.so ; then
if ! ls -1 %{buildroot}%{_pam_moduledir}/`basename ${dir}`*.so ; then
echo ERROR `basename ${dir}` did not build a module.
exit 1
fi
@ -218,10 +218,10 @@ done
# Check for module problems. Specifically, check that every module we just
# installed can actually be loaded by a minimal PAM-aware application.
/sbin/ldconfig -n $RPM_BUILD_ROOT%{_pam_libdir}
for module in $RPM_BUILD_ROOT%{_pam_moduledir}/pam*.so ; do
if ! env LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_pam_libdir} \
%{SOURCE11} -ldl -lpam -L$RPM_BUILD_ROOT%{_libdir} ${module} ; then
/sbin/ldconfig -n %{buildroot}%{_pam_libdir}
for module in %{buildroot}%{_pam_moduledir}/pam*.so ; do
if ! env LD_LIBRARY_PATH=%{buildroot}%{_pam_libdir} \
%{SOURCE11} -ldl -lpam -L%{buildroot}%{_libdir} ${module} ; then
echo ERROR module: ${module} cannot be loaded.
exit 1
fi
@ -369,6 +369,7 @@ exit 0
* Wed Oct 06 2021 Björn Esser <besser82@fedoraproject.org> - 1.5.2-6
- Remove old cruft from spec file
- Rename docs sub-package to doc
- Replace $RPM_BUILD_ROOT with %%{buildroot}
* Thu Sep 23 2021 Björn Esser <besser82@fedoraproject.org> - 1.5.2-5
- Rebase to pam-redhat-1.1.5