File pwauth.spec of Package pwauth

#
# spec file for package pwauth
#
# Copyright (c) 2020 SUSE LLC
#
# 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.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           pwauth
Version:        2.3.10
Release:        0
Summary:        A system password authenticator designed for Apache's mod_auth(nz)_external
License:        Apache-2.0
Group:          Productivity/Networking/Web/Servers
URL:            https://github.com/phokz/pwauth/tree/master/pwauth
Source:         http://pwauth.googlecode.com/files/%{name}-%{version}.tar.gz
Source1:        pwauth.permissions
Source2:        pwauth.pam
Source3:        pwauth.apache_conf_d
Source99:       pwauth-rpmlintrc
Patch0:         pwauth-2.3.10_config.patch
Patch1:         pwauth-2.3.10_makeitbuild.patch
#
BuildRequires:  pam-devel
Requires:       apache2-mod_authnz_external > 2.1.1
Requires(post): permissions

%description
Pwauth is an authenticator designed to be used with mod_auth_external or
mod_authnz_external and the Apache HTTP Daemon to support reasonably secure web
authentication out of the system password database on most versions of Unix.

What pwauth actually does is very simple. Given a login and a password, it
returns a status code indicating whether it is a valid login/password or not.
It is normally installed as an suid-root program, so other programs (like
Apache or a CGI program) can run it to check if a login/password is valid even
though they don't themselves have read access to the system password database.

%prep
%autosetup -p0

%build
%make_build LOCALFLAGS="%{optflags} -Wno-comment -fPIC -DPIC" LIB="-ldl -lpam -lcrypt -pie"

%install
install -D -m 4755 pwauth    %{buildroot}%{_bindir}/%{name}
install -D -m 0755 unixgroup %{buildroot}%{_bindir}/unixgroup
install -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/permissions.d/pwauth
install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/pwauth
install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/apache2/conf.d/pwauth

%verifyscript
%verify_permissions -e %{_bindir}/%{name}

%post
%set_permissions %{_bindir}/pwauth

%files
%verify(not user group mode) %attr(4755,root,root) %{_bindir}/%{name}
%{_bindir}/unixgroup
%config %{_sysconfdir}/permissions.d/pwauth
%config %{_sysconfdir}/pam.d/pwauth
%dir %{_sysconfdir}/apache2
%dir %{_sysconfdir}/apache2/conf.d
%config %{_sysconfdir}/apache2/conf.d/pwauth
%doc CHANGES FORM_AUTH INSTALL README

%changelog
openSUSE Build Service is sponsored by