Jakub Hrozek 04c664b
Name:           authselect
94c4f7a
Version:        0.4
974fe04
Release:        1%{?dist}
Jakub Hrozek 04c664b
Summary:        Configures authentication and identity sources from supported profiles
4c5cb1a
URL:            https://github.com/pbrezina/authselect
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
License:        GPLv3+
383e17b
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
BuildRequires:  autoconf
Jakub Hrozek 04c664b
BuildRequires:  automake
Jakub Hrozek 04c664b
BuildRequires:  libtool
Jakub Hrozek 04c664b
BuildRequires:  m4
2f4bdd2
BuildRequires:  gcc
Jakub Hrozek 04c664b
BuildRequires:  pkgconfig
daba7fc
BuildRequires:  pkgconfig(popt)
Jakub Hrozek 04c664b
BuildRequires:  gettext-devel
daba7fc
BuildRequires:  %{_bindir}/a2x
974fe04
BuildRequires:  libcmocka-devel >= 1.0.0
2c3cc1a
Requires: authselect-libs%{?_isa} = %{version}-%{release}
4c5cb1a
Suggests: sssd
4c5cb1a
Suggests: samba-winbind
4c5cb1a
Suggests: fprintd-pam
4c5cb1a
Suggests: oddjob-mkhomedir
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
%description
c7b0af4
Authselect is designed to be a replacement for authconfig but it takes
c7b0af4
a different approach to configure the system. Instead of letting
51bbcae
the administrator build the PAM stack with a tool (which may potentially
c7b0af4
end up with a broken configuration), it would ship several tested stacks
c7b0af4
(profiles) that solve a use-case and are well tested and supported.
c7b0af4
At the same time, some obsolete features of authconfig are not
c7b0af4
supported by authselect.
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
%package libs
Jakub Hrozek 04c664b
Summary: Utility library used by the authselect tool
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
%description libs
Jakub Hrozek 04c664b
Common library files for authselect. This package is used by the authselect
Jakub Hrozek 04c664b
command line tool and any other potential front-ends.
Jakub Hrozek 04c664b
4c5cb1a
%package compat
4c5cb1a
Summary: Tool to provide minimum backwards compatibility with authconfig
0cc7d83
%if 0%{?fedora} && 0%{?fedora} <= 27
0cc7d83
Conflicts: authconfig
0cc7d83
%else
70d30da
Obsoletes: authconfig < 7.0.1-6
0cc7d83
%endif
eae9dba
Provides: authconfig
4c5cb1a
BuildRequires: python3-devel
2c3cc1a
Requires: authselect%{?_isa} = %{version}-%{release}
0cc7d83
Suggests: sssd
0cc7d83
Suggests: realmd
0cc7d83
Suggests: samba-winbind
0cc7d83
Suggests: oddjob-mkhomedir
4c5cb1a
4c5cb1a
%description compat
4c5cb1a
This package will replace %{_sbindir}/authconfig with a tool that will
4c5cb1a
translate some of the authconfig calls into authselect calls. It provides
4c5cb1a
only minimum backward compatibility and users are encouraged to migrate
4c5cb1a
to authselect completely.
4c5cb1a
Jakub Hrozek 04c664b
%package devel
Jakub Hrozek 04c664b
Summary: Development libraries and headers for authselect
2c3cc1a
Requires: authselect-libs%{?_isa} = %{version}-%{release}
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
%description devel
Jakub Hrozek 04c664b
System header files and development libraries for authselect. Useful if
Jakub Hrozek 04c664b
you develop a front-end for the authselect library.
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
%prep
Jakub Hrozek deabbd6
%setup -q
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
%build
Jakub Hrozek 04c664b
autoreconf -if
Jakub Hrozek 04c664b
%configure
4bfd40c
%make_build
Jakub Hrozek 04c664b
974fe04
%check
974fe04
%make_build check
974fe04
Jakub Hrozek 04c664b
%install
4bfd40c
%make_install
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
# Remove .la and .a files created by libtool
Jakub Hrozek 04c664b
find $RPM_BUILD_ROOT -name "*.la" -exec rm -f {} \;
Jakub Hrozek 04c664b
find $RPM_BUILD_ROOT -name "*.a" -exec rm -f {} \;
Jakub Hrozek 04c664b
0cc7d83
%ldconfig_scriptlets libs
0cc7d83
Jakub Hrozek 04c664b
%files libs
bf62e0c
%dir %{_sysconfdir}/authselect
4c5cb1a
%dir %{_sysconfdir}/authselect/custom
bf62e0c
%dir %{_datadir}/authselect
bf62e0c
%dir %{_datadir}/authselect/vendor
bf62e0c
%dir %{_datadir}/authselect/default
bf62e0c
%dir %{_datadir}/authselect/default/sssd/
bf62e0c
%dir %{_datadir}/authselect/default/winbind/
bf62e0c
%{_datadir}/authselect/default/sssd/dconf-db
bf62e0c
%{_datadir}/authselect/default/sssd/dconf-locks
Jakub Hrozek deabbd6
%{_datadir}/authselect/default/sssd/fingerprint-auth
bf62e0c
%{_datadir}/authselect/default/sssd/nsswitch.conf
Jakub Hrozek 04c664b
%{_datadir}/authselect/default/sssd/password-auth
Jakub Hrozek deabbd6
%{_datadir}/authselect/default/sssd/postlogin
bf62e0c
%{_datadir}/authselect/default/sssd/README
Jakub Hrozek deabbd6
%{_datadir}/authselect/default/sssd/smartcard-auth
bf62e0c
%{_datadir}/authselect/default/sssd/system-auth
bf62e0c
%{_datadir}/authselect/default/winbind/dconf-db
bf62e0c
%{_datadir}/authselect/default/winbind/dconf-locks
Jakub Hrozek deabbd6
%{_datadir}/authselect/default/winbind/fingerprint-auth
Jakub Hrozek 04c664b
%{_datadir}/authselect/default/winbind/nsswitch.conf
Jakub Hrozek 04c664b
%{_datadir}/authselect/default/winbind/password-auth
Jakub Hrozek deabbd6
%{_datadir}/authselect/default/winbind/postlogin
bf62e0c
%{_datadir}/authselect/default/winbind/README
Jakub Hrozek 04c664b
%{_datadir}/authselect/default/winbind/system-auth
Jakub Hrozek 04c664b
%{_libdir}/libauthselect.so.*
bf62e0c
%{_mandir}/man5/authselect-profiles.5*
Jakub Hrozek 04c664b
%{_datadir}/doc/authselect/COPYING
Jakub Hrozek deabbd6
%{_datadir}/doc/authselect/README.md
Jakub Hrozek 04c664b
%license COPYING
bf62e0c
%doc README.md
Jakub Hrozek 04c664b
4c5cb1a
%files compat
4c5cb1a
%{_sbindir}/authconfig
e2f1869
%{python3_sitelib}/authselect/
4c5cb1a
Jakub Hrozek 04c664b
%files devel
Jakub Hrozek 04c664b
%{_includedir}/authselect.h
Jakub Hrozek 04c664b
%{_libdir}/libauthselect.so
974fe04
%{_libdir}/pkgconfig/authselect.pc
Jakub Hrozek 04c664b
Jakub Hrozek 04c664b
%files
Jakub Hrozek 04c664b
%{_bindir}/authselect
Jakub Hrozek 04c664b
%{_mandir}/man8/authselect.8*
4c5cb1a
%{_mandir}/man7/authselect-migration.7*
Jakub Hrozek 04c664b
94c4f7a
%global updatefile %{_localstatedir}/lib/rpm-state/%{name}.update-profile
94c4f7a
94c4f7a
%pre libs
94c4f7a
rm -f "%{updatefile}"
94c4f7a
if [ $1 -gt 1 ] ; then
94c4f7a
    # Check that authselect cli is installed, otherwise there is nothing to do.
94c4f7a
    rpm -q %{name} &> /dev/null
94c4f7a
    if [ $? -ne 0 ] ; then
94c4f7a
      exit 0
94c4f7a
    fi
94c4f7a
94c4f7a
    # This is an upgrade. Check that the current configuration is valid
94c4f7a
    # and store the information for later use in posttrans. The check must
94c4f7a
    # be done here (before profiles are updated), otherwise it would return
94c4f7a
    # an error if the new profile is different from the old one but selected.
94c4f7a
    %{_bindir}/authselect check &> /dev/null
94c4f7a
    if [ $? -eq 0 ]; then
94c4f7a
      touch "%{updatefile}"
94c4f7a
    fi
94c4f7a
fi
94c4f7a
94c4f7a
exit 0
94c4f7a
94c4f7a
%posttrans libs
94c4f7a
if [ -f "%{updatefile}" ]; then
94c4f7a
    # This is an upgrade. Update current profile if possible.
94c4f7a
    PROFILE=`%{_bindir}/authselect current --raw`
94c4f7a
    if [ $? -eq 0 ]; then
94c4f7a
        %{_bindir}/authselect select $PROFILE --force &> /dev/null
94c4f7a
    fi
94c4f7a
    rm -f "%{updatefile}"
94c4f7a
fi
94c4f7a
94c4f7a
exit 0
94c4f7a
Jakub Hrozek 04c664b
%changelog
94c4f7a
* Mon Apr 9 2018 Pavel Březina <pbrezina@redhat.com> - 0.4-1
94c4f7a
- rebasing to 0.4
94c4f7a
0cc7d83
* Tue Mar 6 2018 Pavel Březina <pbrezina@redhat.com> - 0.3.2-1
0cc7d83
- rebasing to 0.3.2
0cc7d83
- authselect-compat now only suggests packages, not recommends
0cc7d83
974fe04
* Mon Mar 5 2018 Pavel Březina <pbrezina@redhat.com> - 0.3.1-1
974fe04
- rebasing to 0.3.1
974fe04
7604ae5
* Tue Feb 20 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.3-3
eae9dba
- Provide authconfig
eae9dba
7604ae5
* Tue Feb 20 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.3-2
e2f1869
- Properly own all appropriate directories
6d624de
- Remove unneeded %%defattr
974fe04
- Remove deprecated Group tag 
70d30da
- Make Obsoletes versioned
22c5fc5
- Remove unneeded ldconfig scriptlets
e2f1869
4c5cb1a
* Tue Feb 20 2018 Pavel Březina <pbrezina@redhat.com> - 0.3-1
4c5cb1a
- rebasing to 0.3
05600f5
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2-3
05600f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c7b0af4
* Wed Jan 10 2018 Pavel Březina <pbrezina@redhat.com> - 0.2-2
c7b0af4
- fix rpmlint errors
bf62e0c
* Wed Jan 10 2018 Pavel Březina <pbrezina@redhat.com> - 0.2-1
bf62e0c
- rebasing to 0.2
bf62e0c
* Mon Jul 31 2017 Jakub Hrozek <jakub.hrozek@posteo.se> - 0.1-1
Jakub Hrozek 04c664b
- initial packaging