LFS-RPM/SPECS/shadow.spec

133 lines
4.1 KiB
RPMSpec
Raw Normal View History

2023-04-17 07:34:13 +08:00
Name: shadow
Version: 4.13
Release: %{?repo}0.rc2%{?dist}
Summary: Obfuscate user passwords hashes
2023-04-07 01:56:31 +08:00
2023-04-17 07:34:13 +08:00
Group: System Environment/Security
License: BSD-3-Claus
URL: https://github.com/shadow-maint/shadow
Source0: https://github.com/shadow-maint/shadow/releases/download/%{version}/%{name}-%{version}.tar.xz
2023-04-07 01:56:31 +08:00
2023-04-17 07:34:13 +08:00
BuildRequires: cracklib-devel
Requires: libsubid = %{version}-%{release}
2023-04-07 01:56:31 +08:00
%description
Originally, the file /etc/passwd contained both the hashed password of
users along with basic information about the user account that needs
to be publicly readable.
The shadow package increases security by moving the hashed passwords
out of that file and into a separate /etc/shadow file that is not
publicly readable, increasing the security of the hashed passwords.
%package -n libsubid
2023-04-17 07:34:13 +08:00
Summary: Shared library from the shadow program
Group: System Environment/Libraries
2023-04-07 01:56:31 +08:00
%description -n libsubid
The libsubid shared library from the shadow package.
%package -n libsubid-devel
2023-04-17 07:34:13 +08:00
Summary: Developer files for libsubid
Group: Development/Libraries
Requires: libsubid = %{version}-%{release}
2023-04-07 01:56:31 +08:00
%description -n libsubid-devel
This package contains the header files needed to compile software that
links against the shadow libsubid library.
%prep
%setup -q
[ ! -f README.md ] && cp README README.md
%build
sed -i 's/groups$(EXEEXT) //' src/Makefile.in
find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;
# todo - min passwd length should be here
sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD SHA512:' \
-e 's@#\(SHA_CRYPT_..._ROUNDS 5000\)@\100@' \
-e 's:/var/spool/mail:/var/mail:' \
-e '/PATH=/{s@/sbin:@@;s@/bin:@@}' \
-i etc/login.defs
sed -i 's:DICTPATH.*:DICTPATH\t/lib/cracklib/pw_dict:' etc/login.defs
%configure \
--disable-static \
--with-libcrack \
--with-group-name-max-length=32
make %{?_smp_mflags}
%install
make install exec_prefix=/usr DESTDIR=%{buildroot}
make -C man install-man DESTDIR=%{buildroot}
#sed -i '/MAIL/s/yes/no/' %{buildroot}%{_sysconfdir}/default/useradd
#PASS_MIN_LEN
sed -i 's/^PASS_MIN_LEN.*/PASS_MIN_LEN 8/' \
%{buildroot}%{_sysconfdir}/login.defs
install -m755 -d %{buildroot}/bin
mv %{buildroot}%{_bindir}/login %{buildroot}/bin/
mv %{buildroot}%{_bindir}/su %{buildroot}/bin/
%find_lang %{name}
%post -n libsubid -p /sbin/ldconfig
%postun -n libsubid -p /sbin/ldconfig
%files -f %{name}.lang
%defattr(-,root,root,-)
%attr(0755,root,root) /bin/login
%attr(4755,root,root) /bin/su
%attr(4755,root,root) %{_bindir}/chage
%attr(4755,root,root) %{_bindir}/chfn
%attr(4755,root,root) %{_bindir}/chsh
%attr(4755,root,root) %{_bindir}/expiry
%attr(0755,root,root) %{_bindir}/faillog
%attr(0755,root,root) %{_bindir}/getsubids
%attr(4755,root,root) %{_bindir}/gpasswd
%attr(0755,root,root) %{_bindir}/lastlog
%attr(4755,root,root) %{_bindir}/newgidmap
%attr(4755,root,root) %{_bindir}/newgrp
%attr(4755,root,root) %{_bindir}/newuidmap
%attr(4755,root,root) %{_bindir}/passwd
%{_bindir}/sg
%{_sbindir}/*
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/limits
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/login.access
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/login.defs
%{_mandir}/man1/*.1*
%{_mandir}/man5/*.5*
%{_mandir}/man8/*.8*
%license COPYING
%doc AUTHORS.md COPYING ChangeLog NEWS README.md TODO
%files -n libsubid
%defattr(-,root,root,-)
%{_libdir}/libsubid.so.4
%attr(0755,root,root) %{_libdir}/libsubid.so.4.0.0
%license COPYING
2023-04-17 07:34:13 +08:00
%doc COPYING
2023-04-07 01:56:31 +08:00
%files -n libsubid-devel
%defattr(-,root,root,-)
%attr(0755,root,root) %dir %{_includedir}/shadow
%attr(0644,root,root) %{_includedir}/shadow/subid.h
%{_libdir}/libsubid.so
%attr(0644,root,root) %{_mandir}/man3/shadow.3*
2023-04-17 07:34:13 +08:00
%license COPYING
%doc COPYING
2023-04-07 01:56:31 +08:00
%changelog
2023-04-17 07:34:13 +08:00
* Sun Apr 16 2023 Michael A. Peters <anymouseprophet@gmail.com> - 4.13-0.rc2
- tabs to spaces, rebuild in freshly built GCC package
2023-04-07 01:56:31 +08:00
* Thu Mar 23 2023 Michael A. Peters <anymouseprophet@gmail.com> - 4.13-0.rc1
- Initial spec file for YJL (RPM bootstrapping LFS/BLFS 11.3)