From b3e1d168dde1c3e216a8a7ad7531bb342811bb2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 6 Oct 2021 22:11:31 +0200 Subject: [PATCH] Replace $RPM_BUILD_ROOT with %{buildroot} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Esser --- pam.spec | 71 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/pam.spec b/pam.spec index 2678f4b..dbdf88e 100644 --- a/pam.spec +++ b/pam.spec @@ -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 - 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 - 1.5.2-5 - Rebase to pam-redhat-1.1.5