2012-10-29 16:15:23 +01:00
#
2012-11-13 10:36:56 +01:00
# spec file for package shadow
2012-10-29 16:15:23 +01:00
#
2024-01-09 15:17:29 +01:00
# Copyright (c) 2024 SUSE LLC
2012-10-29 16:15:23 +01:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2019-12-17 13:44:46 +01:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2012-10-29 16:15:23 +01:00
#
2019-10-09 10:44:59 +02:00
%if ! %{defined _distconfdir}
%define _distconfdir %{_sysconfdir}
%else
%define no_config 1
%endif
2012-10-29 16:15:23 +01:00
Name : shadow
2024-03-24 10:13:40 +01:00
Version : 4.15.1
2012-11-13 10:36:56 +01:00
Release : 0
2017-09-08 13:44:56 +02:00
Summary : Utilities to Manage User and Group Accounts
2018-11-02 12:24:14 +01:00
License : BSD-3-Clause AND GPL-2.0-or-later
2017-09-08 13:44:56 +02:00
Group : System/Base
2019-05-31 08:00:55 +02:00
URL : https://github.com/shadow-maint/shadow
2023-08-17 09:04:09 +02:00
Source0 : https://github.com/shadow-maint/shadow/releases/download/%{version} /shadow-%{version} .tar.xz
2023-02-17 08:53:56 +01:00
Source1 : pamd.tar.bz2
2023-08-17 09:04:09 +02:00
Source2 : https://github.com/shadow-maint/shadow/releases/download/%{version} /shadow-%{version} .tar.xz.asc
2023-02-16 12:35:29 +01:00
Source3 : %{name} .keyring
Source4 : shadow.service
Source5 : shadow.timer
2019-05-06 09:58:15 +02:00
# SOURCE-FEATURE-SUSE shadow-login_defs-check.sh sbrabec@suse.com -- Supplementary script that verifies coverage of variables in shadow-login_defs-unused-by-pam.patch and other patches.
2023-02-16 12:35:29 +01:00
Source40 : shadow-login_defs-check.sh
2019-05-06 09:58:15 +02:00
# PATCH-FIX-SUSE shadow-login_defs-unused-by-pam.patch kukuk@suse.com -- Remove variables that have no use with PAM.
Patch0 : shadow-login_defs-unused-by-pam.patch
# PATCH-FEATURE-SUSE useradd-default.patch kukuk@suse.com -- Change useradd defaults group to 1000.
2023-02-16 12:42:49 +01:00
Patch1 : useradd-default.patch
2019-05-06 09:58:15 +02:00
# PATCH-FEATURE-SUSE shadow-util-linux.patch sbrabec@suse.com -- Add support for util-linux specific variables, delete shadow login, su runuser specific.
2023-02-16 12:42:49 +01:00
Patch2 : shadow-util-linux.patch
2019-05-06 09:58:15 +02:00
# PATCH-FEATURE-SUSE shadow-login_defs-comments.patch kukuk@suse.com -- Adjust login.defs comments.
2023-02-16 12:42:49 +01:00
Patch3 : shadow-login_defs-comments.patch
2019-05-06 09:58:15 +02:00
# PATCH-FEATURE-SUSE shadow-login_defs-suse.patch kukuk@suse.com -- Customize login.defs.
2023-02-16 12:42:49 +01:00
Patch4 : shadow-login_defs-suse.patch
2019-05-06 09:58:15 +02:00
# PATCH-FIX-SUSE disable_new_audit_function.patch adam.majer@suse.de -- Disable newer libaudit functionality for older distributions.
2023-08-04 17:48:26 +02:00
Patch5 : disable_new_audit_function.patch
2017-05-23 14:25:13 +02:00
BuildRequires : audit-devel > 2.3
2019-01-23 13:44:35 +01:00
BuildRequires : autoconf
BuildRequires : automake
2012-11-13 10:36:56 +01:00
BuildRequires : libacl-devel
BuildRequires : libattr-devel
BuildRequires : libselinux-devel
2012-10-29 16:15:23 +01:00
BuildRequires : libsemanage-devel
2019-01-23 13:44:35 +01:00
BuildRequires : libtool
2012-11-13 10:36:56 +01:00
BuildRequires : pam-devel
2017-05-23 14:25:13 +02:00
BuildRequires : xz
2023-08-17 12:24:51 +02:00
# we depend on libbsd or glibc >= 2.38 for the strlcpy() (and readpassphrase()) functions
BuildRequires : glibc-devel >= 2.38
2021-08-18 16:25:29 +02:00
Requires : login_defs >= %{version}
2017-10-12 11:42:41 +02:00
Requires(pre) : group(root)
Requires(pre) : group(shadow)
2019-05-31 08:00:55 +02:00
Requires(pre) : permissions
2017-10-12 11:42:41 +02:00
Requires(pre) : user(root)
2012-11-13 10:36:56 +01:00
Provides : pwdutils = 3.2.20
Obsoletes : pwdutils <= 3.2.19
2021-01-21 09:48:53 +01:00
Provides : useradd_or_adduser_dep
2021-08-18 16:25:29 +02:00
BuildRequires : libeconf-devel
2021-01-21 09:48:53 +01:00
%description
This package includes the necessary programs for converting plain
password files to the shadow password format and to manage user and
group accounts.
%package -n login_defs
2021-08-18 16:25:29 +02:00
Summary : The login.defs configuration file
2019-05-06 09:58:15 +02:00
# Virtual provides for supported variables in login.defs.
# It prevents references to unknown variables.
# Upgrade them only if shadow-util-linux.patch or
# encryption_method_nis.patch has to be ported!
# Call shadow-login_defs-check.sh before!
2021-08-18 16:25:29 +02:00
Group : System/Base
2021-11-17 17:18:12 +01:00
Provides : login_defs-support-for-pam = 1.5.2
Provides : login_defs-support-for-util-linux = 2.37
2021-08-18 16:25:29 +02:00
BuildArch : noarch
2012-10-29 16:15:23 +01:00
2021-01-21 09:48:53 +01:00
%description -n login_defs
This package contains the default login.defs configuration file
as used by util-linux, pam and shadow.
2012-10-29 16:15:23 +01:00
2022-01-03 13:19:45 +01:00
%package -n libsubid4
2021-08-18 16:25:29 +02:00
Summary : A library to manage subordinate uid and gid ranges
Group : System/Base
2022-01-03 13:19:45 +01:00
%description -n libsubid4
2021-08-18 16:25:29 +02:00
Utility library that provides a way to manage subid ranges.
%package -n libsubid-devel
2022-01-03 13:19:45 +01:00
Summary : Development files for libsubid4
2021-08-18 16:25:29 +02:00
Group : System/Base
2022-01-03 13:19:45 +01:00
Requires : libsubid4 = %{version}
2021-08-18 16:25:29 +02:00
%description -n libsubid-devel
2022-01-03 13:19:45 +01:00
Development files for libsubid4.
2021-08-18 16:25:29 +02:00
2012-10-29 16:15:23 +01:00
%prep
2023-08-17 09:04:09 +02:00
%setup -q -a 1
2024-02-13 16:32:50 +01:00
%patch -P 0
%patch -P 1
%patch -P 2
%patch -P 3
%patch -P 4
2017-05-23 14:25:13 +02:00
%if 0%{?suse_version} < 1330
2024-02-13 16:32:50 +01:00
%patch -P 5 -p1
2017-05-23 14:25:13 +02:00
%endif
2012-10-29 16:15:23 +01:00
iconv -f ISO88591 -t utf-8 doc/HOWTO > doc/HOWTO.utf8
mv -v doc/HOWTO.utf8 doc/HOWTO
%build
2017-09-08 13:44:56 +02:00
export CFLAGS=" %{optflags} - f p i e "
2012-10-29 16:15:23 +01:00
export LDFLAGS=" - p i e "
2019-01-23 13:44:35 +01:00
autoreconf -fvi
2012-10-29 16:15:23 +01:00
%configure \
2021-06-08 08:39:30 +02:00
--enable-shadowgrp \
2019-05-31 08:00:55 +02:00
--enable-account-tools-setuid \
--with-audit \
--with-libpam \
--with-sha-crypt \
--with-acl \
--with-attr \
--with-nscd \
--with-selinux \
--without-libcrack \
2023-08-17 12:17:53 +02:00
--without-libbsd \
2019-10-09 10:44:59 +02:00
--with-group-name-max-length=32 \
--enable-vendordir=%{_distconfdir}
2023-08-14 15:58:58 +02:00
%make_build
2021-08-18 16:25:29 +02:00
# --disable-shared \ currently doesn't build with this. See https://github.com/shadow-maint/shadow/issues/336
2012-10-29 16:15:23 +01:00
%install
2019-05-31 08:00:55 +02:00
%make_install gnulocaledir=%{buildroot} /%{_datadir} /locale MKINSTALLDIRS=`pwd`/mkinstalldirs
2021-08-18 16:25:29 +02:00
# Separate call to install man pages. See https://github.com/shadow-maint/shadow/issues/389
%make_install -C man install-man
2012-10-29 16:15:23 +01:00
2023-02-16 12:35:29 +01:00
install -Dm644 %{SOURCE4} %{buildroot} %{_unitdir} /shadow.service
install -Dm644 %{SOURCE5} %{buildroot} %{_unitdir} /shadow.timer
2012-10-29 16:15:23 +01:00
2018-11-02 12:24:14 +01:00
# add empty /etc/sub{u,g}id files
touch %{buildroot} /%{_sysconfdir} /subuid
touch %{buildroot} /%{_sysconfdir} /subgid
2012-10-29 16:15:23 +01:00
# Remove binaries we don't use.
2017-09-08 13:44:56 +02:00
rm %{buildroot} /%{_bindir} /groups
rm %{buildroot} /%{_mandir} /man1/groups.*
rm %{buildroot} /%{_mandir} /*/man1/groups.*
rm %{buildroot} /%{_sbindir} /grpconv
rm %{buildroot} /%{_mandir} /man8/grpconv.*
rm %{buildroot} /%{_mandir} /*/man8/grpconv.*
rm %{buildroot} /%{_sbindir} /grpunconv
rm %{buildroot} /%{_mandir} /man8/grpunconv.*
rm %{buildroot} /%{_mandir} /*/man8/grpunconv.*
rm %{buildroot} /%{_sbindir} /groupmems
rm %{buildroot} /%{_mandir} /man8/groupmems.*
rm %{buildroot} /%{_mandir} /*/man8/groupmems.*
rm %{buildroot} %{_sysconfdir} /pam.d/groupmems
rm %{buildroot} /%{_bindir} /login
rm %{buildroot} /%{_mandir} /man1/login.*
rm %{buildroot} /%{_mandir} /*/man1/login.*
rm %{buildroot} %{_sysconfdir} /pam.d/login
rm %{buildroot} /%{_bindir} /su
rm %{buildroot} /%{_mandir} /man1/su.*
rm %{buildroot} /%{_mandir} /*/man1/su.*
rm %{buildroot} /%{_mandir} /man5/suauth.*
rm %{buildroot} /%{_mandir} /*/man5/suauth.*
rm %{buildroot} %{_sysconfdir} /pam.d/su
rm %{buildroot} /%{_bindir} /faillog
rm %{buildroot} /%{_mandir} /man5/faillog.*
rm %{buildroot} /%{_mandir} /*/man5/faillog.*
rm %{buildroot} /%{_mandir} /man8/faillog.*
rm %{buildroot} /%{_mandir} /*/man8/faillog.*
rm %{buildroot} /%{_sbindir} /logoutd
rm %{buildroot} /%{_mandir} /man8/logoutd.*
rm %{buildroot} /%{_mandir} /*/man8/logoutd.*
rm %{buildroot} /%{_sbindir} /nologin
rm %{buildroot} /%{_mandir} /man8/nologin.*
rm %{buildroot} /%{_mandir} /*/man8/nologin.*
rm %{buildroot} /%{_sbindir} /chgpasswd
rm %{buildroot} /%{_mandir} /man8/chgpasswd.*
rm %{buildroot} /%{_mandir} /*/man8/chgpasswd.*
rm %{buildroot} %{_sysconfdir} /pam.d/chgpasswd
rm %{buildroot} /%{_mandir} /man3/getspnam.*
rm %{buildroot} /%{_mandir} /*/man3/getspnam.*
rm %{buildroot} /%{_mandir} /man5/gshadow.5*
rm %{buildroot} /%{_mandir} /*/man5/gshadow.5*
rm %{buildroot} /%{_mandir} /man5/passwd.5*
rm %{buildroot} /%{_mandir} /*/man5/passwd.5*
rm -rf %{buildroot} %{_mandir} /{??,??_??}
2012-10-29 16:15:23 +01:00
2022-01-03 13:19:45 +01:00
rm %{buildroot} /%{_libdir} /libsubid.{la,a}
2021-08-18 16:25:29 +02:00
2019-10-09 10:44:59 +02:00
# Move /etc to /usr/etc
if [ ! -d %{buildroot} %{_distconfdir} ]; then
mkdir -p %{buildroot} %{_distconfdir}
2022-08-09 11:45:37 +02:00
mkdir -p %{buildroot} %{_pam_vendordir}
mv %{buildroot} %{_sysconfdir} /login.defs %{buildroot} %{_distconfdir}
mv %{buildroot} %{_sysconfdir} /pam.d/* %{buildroot} %{_pam_vendordir} /
2019-10-09 10:44:59 +02:00
fi
2022-08-09 11:45:37 +02:00
mkdir -p %{buildroot} %{_sysconfdir} /login.defs.d
2019-10-09 10:44:59 +02:00
2012-10-29 16:15:23 +01:00
%find_lang shadow
2015-07-16 11:52:01 +02:00
%pre
%service_add_pre shadow.service shadow.timer
2021-01-21 09:48:53 +01:00
for i in pam.d/chage pam.d/chfn pam.d/chpasswd pam.d/chsh pam.d/groupadd pam.d/groupdel pam.d/groupmod pam.d/newusers pam.d/passwd pam.d/useradd pam.d/userdel pam.d/usermod; do
2021-08-18 16:25:29 +02:00
test -f %{_sysconfdir} /${i}.rpmsave && mv -v %{_sysconfdir} /${i}.rpmsave %{_sysconfdir} /${i}.rpmsave.old ||:
2019-10-09 10:44:59 +02:00
done
2015-07-16 11:52:01 +02:00
2021-01-21 09:48:53 +01:00
%pre -n login_defs
2021-08-18 16:25:29 +02:00
test -f %{_sysconfdir} /login.defs.rpmsave && mv -v %{_sysconfdir} /login.defs.rpmsave %{_sysconfdir} /login.defs.rpmsave.old ||:
2021-01-21 09:48:53 +01:00
2012-10-29 16:15:23 +01:00
%post
2017-09-08 13:44:56 +02:00
%set_permissions %{_bindir} /chage
%set_permissions %{_bindir} /chfn
%set_permissions %{_bindir} /chsh
%set_permissions %{_bindir} /expiry
%set_permissions %{_bindir} /gpasswd
%set_permissions %{_bindir} /newgrp
%set_permissions %{_bindir} /passwd
%set_permissions %{_bindir} /newgidmap
%set_permissions %{_bindir} /newuidmap
2012-10-29 16:15:23 +01:00
2016-01-18 12:08:55 +01:00
%service_add_post shadow.service shadow.timer
2012-10-29 16:15:23 +01:00
%verify script
2017-09-08 13:44:56 +02:00
%verify _permissions %{_bindir} /chage
%verify _permissions %{_bindir} /chfn
%verify _permissions %{_bindir} /chsh
%verify _permissions %{_bindir} /expiry
%verify _permissions %{_bindir} /gpasswd
%verify _permissions %{_bindir} /newgrp
%verify _permissions %{_bindir} /passwd
%verify _permissions %{_bindir} /newgidmap
%verify _permissions %{_bindir} /newuidmap
2012-10-29 16:15:23 +01:00
2015-07-16 11:52:01 +02:00
%preun
%service_del_preun shadow.service shadow.timer
%postun
%service_del_postun shadow.service shadow.timer
2019-10-09 10:44:59 +02:00
%posttrans
2021-01-30 09:05:35 +01:00
%if %{defined no_config}
2019-10-09 10:44:59 +02:00
# Migration to /usr/etc
2021-01-21 09:48:53 +01:00
for i in pam.d/chage pam.d/chfn pam.d/chpasswd pam.d/chsh pam.d/groupadd pam.d/groupdel pam.d/groupmod pam.d/newusers pam.d/passwd pam.d/useradd pam.d/userdel pam.d/usermod; do
2021-08-18 16:25:29 +02:00
test -f %{_sysconfdir} /${i}.rpmsave && mv -v %{_sysconfdir} /${i}.rpmsave %{_sysconfdir} /${i} ||:
2019-10-09 10:44:59 +02:00
done
2021-01-30 09:05:35 +01:00
%endif
2019-10-09 10:44:59 +02:00
2021-01-21 09:48:53 +01:00
%posttrans -n login_defs
2021-01-30 09:05:35 +01:00
# rpmsave file can be created by
# - change of owning package (SLE15 SP2->SP3, Leap 15.2->15.3)
# - Migration to /usr/etc (after SLE15 and Leap 15)
2021-08-18 16:25:29 +02:00
test -f %{_sysconfdir} /login.defs.rpmsave && mv -v %{_sysconfdir} /login.defs.rpmsave %{_sysconfdir} /login.defs ||:
2022-01-03 13:19:45 +01:00
%post -n libsubid4 -p /sbin/ldconfig
%postun -n libsubid4 -p /sbin/ldconfig
2021-01-21 09:48:53 +01:00
2012-10-29 16:15:23 +01:00
%files -f shadow.lang
2018-02-26 10:59:29 +01:00
%license COPYING
2021-08-18 19:54:07 +02:00
%doc NEWS doc/HOWTO README
2018-11-02 12:24:14 +01:00
%verify (not md5 size mtime) %config (noreplace) %{_sysconfdir} /subuid
%verify (not md5 size mtime) %config (noreplace) %{_sysconfdir} /subgid
2019-10-09 10:44:59 +02:00
%if %{defined no_config}
2022-08-09 11:45:37 +02:00
%{_pam_vendordir} /chage
%{_pam_vendordir} /chfn
%{_pam_vendordir} /chsh
%{_pam_vendordir} /passwd
%{_pam_vendordir} /chpasswd
%{_pam_vendordir} /groupadd
%{_pam_vendordir} /groupdel
%{_pam_vendordir} /groupmod
%{_pam_vendordir} /newusers
%{_pam_vendordir} /useradd
%{_pam_vendordir} /userdel
%{_pam_vendordir} /usermod
2019-10-09 10:44:59 +02:00
%else
2017-09-08 13:44:56 +02:00
%config %{_sysconfdir} /pam.d/chage
%config %{_sysconfdir} /pam.d/chfn
%config %{_sysconfdir} /pam.d/chsh
%config %{_sysconfdir} /pam.d/passwd
%config %{_sysconfdir} /pam.d/chpasswd
%config %{_sysconfdir} /pam.d/groupadd
%config %{_sysconfdir} /pam.d/groupdel
%config %{_sysconfdir} /pam.d/groupmod
%config %{_sysconfdir} /pam.d/newusers
%config %{_sysconfdir} /pam.d/useradd
%config %{_sysconfdir} /pam.d/userdel
%config %{_sysconfdir} /pam.d/usermod
2019-10-09 10:44:59 +02:00
%endif
2016-10-19 11:17:17 +02:00
%verify (not mode) %attr (2755,root,shadow) %{_bindir} /chage
%verify (not mode) %attr (4755,root,shadow) %{_bindir} /chfn
%verify (not mode) %attr (4755,root,shadow) %{_bindir} /chsh
%verify (not mode) %attr (4755,root,shadow) %{_bindir} /expiry
%verify (not mode) %attr (4755,root,shadow) %{_bindir} /gpasswd
%verify (not mode) %attr (4755,root,root) %{_bindir} /newgrp
%verify (not mode) %attr (4755,root,shadow) %{_bindir} /passwd
2017-09-14 10:23:12 +02:00
%verify (not mode) %attr (4755,root,shadow) %{_bindir} /newgidmap
%verify (not mode) %attr (4755,root,shadow) %{_bindir} /newuidmap
2012-10-29 16:15:23 +01:00
%{_bindir} /sg
2022-01-14 18:43:13 +01:00
%{_bindir} /getsubids
2020-01-20 11:38:01 +01:00
%attr (0755,root,root) %{_sbindir} /groupadd
%attr (0755,root,root) %{_sbindir} /groupdel
%attr (0755,root,root) %{_sbindir} /groupmod
2012-10-29 16:15:23 +01:00
%{_sbindir} /grpck
%{_sbindir} /pwck
2020-01-20 11:38:01 +01:00
%attr (0755,root,root) %{_sbindir} /useradd
%attr (0755,root,root) %{_sbindir} /userdel
%attr (0755,root,root) %{_sbindir} /usermod
2012-10-29 16:15:23 +01:00
%{_sbindir} /pwconv
%{_sbindir} /pwunconv
2020-01-20 11:38:01 +01:00
%attr (0755,root,root) %{_sbindir} /chpasswd
%attr (0755,root,root) %{_sbindir} /newusers
2012-10-29 16:15:23 +01:00
%{_sbindir} /vipw
%{_sbindir} /vigr
2019-05-31 08:00:55 +02:00
%{_mandir} /man1/chage.1%{?ext_man}
%{_mandir} /man1/chfn.1%{?ext_man}
%{_mandir} /man1/chsh.1%{?ext_man}
%{_mandir} /man1/expiry.1%{?ext_man}
%{_mandir} /man1/gpasswd.1%{?ext_man}
%{_mandir} /man1/newgrp.1%{?ext_man}
%{_mandir} /man1/passwd.1%{?ext_man}
%{_mandir} /man1/sg.1%{?ext_man}
%{_mandir} /man3/shadow.3%{?ext_man}
%{_mandir} /man5/shadow.5%{?ext_man}
%{_mandir} /man8/chpasswd.8%{?ext_man}
%{_mandir} /man8/groupadd.8%{?ext_man}
%{_mandir} /man8/groupdel.8%{?ext_man}
%{_mandir} /man8/groupmod.8%{?ext_man}
%{_mandir} /man8/grpck.8%{?ext_man}
%{_mandir} /man8/newusers.8%{?ext_man}
%{_mandir} /man8/pwck.8%{?ext_man}
%{_mandir} /man8/pwconv.8%{?ext_man}
%{_mandir} /man8/pwunconv.8%{?ext_man}
%{_mandir} /man8/useradd.8%{?ext_man}
%{_mandir} /man8/userdel.8%{?ext_man}
%{_mandir} /man8/usermod.8%{?ext_man}
%{_mandir} /man8/vigr.8%{?ext_man}
%{_mandir} /man8/vipw.8%{?ext_man}
%{_mandir} /man5/subuid.5%{?ext_man}
%{_mandir} /man5/subgid.5%{?ext_man}
%{_mandir} /man1/newgidmap.1%{?ext_man}
%{_mandir} /man1/newuidmap.1%{?ext_man}
2022-01-03 13:19:45 +01:00
%{_mandir} /man1/getsubids.1%{?ext_man}
2012-10-29 16:15:23 +01:00
2015-07-16 11:52:01 +02:00
%{_unitdir} /*
2021-01-21 09:48:53 +01:00
%files -n login_defs
2021-08-18 16:25:29 +02:00
%dir %{_sysconfdir} /login.defs.d
2022-08-09 11:45:37 +02:00
%if %{defined no_config}
2021-01-21 09:48:53 +01:00
%attr (0644,root,root) %{_distconfdir} /login.defs
%else
%attr (0644,root,root) %config %{_sysconfdir} /login.defs
%endif
%{_mandir} /man5/login.defs.5%{?ext_man}
2022-01-03 13:19:45 +01:00
%files -n libsubid4
2021-08-18 16:25:29 +02:00
%{_libdir} /libsubid.so.*
%files -n libsubid-devel
%dir %{_includedir} /shadow
%{_includedir} /shadow/subid.h
%{_libdir} /libsubid.so
2012-10-29 16:15:23 +01:00
%changelog