File cups-backend-kerberized-smb.spec of Package cups-backend-kerberized-smb
#
# spec file for package cups-backend-kerberized-smb
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: cups-backend-kerberized-smb
Summary: Printing with Kerberos authentication in a Windows Active Directory environment
License: GPL-3.0+
Version: 1.0
Release: 1
Group: Productivity/Networking/
Source: get_printing_ticket.c
PreReq: coreutils permissions
Provides: samba-gplv3-krb-printing
Obsoletes: samba-gplv3-krb-printing
Provides: samba-krb-printing
Obsoletes: samba-krb-printing
Requires: samba-client cups
# Install into this non-root directory (must be explicitly specified to build for SLE11):
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define cups_lib_dir %{_prefix}/lib/cups
%description
This package provides a wrapper binary to run smbspool
with the original user ID who submitted a print job.
When printing in a Windows Active Directory (AD) environment
the user 'lp' is not allowed to print in this environment
so that the traditional way to print via smbspool as user 'lp'
would not work.
When Kerberos is used for authentication in an AD environment,
a user gets a so called "ticket" via the display manager
during login at the Gnome or KDE desktop.
When smbspool is run as the original user who submitted
a print job, it can access the ticket of the user that is
needed in an AD environment with Kerberos authentication
to pass the printing data to the SMB printer share.
A precondition is that it runs on the same host where
the user who submitted the print job is logged in.
This means it must be set up on the workstation
for the user who will submit the print jobs and
the user's workstation must send its printing data
directly to the SMB printer share in the AD environment.
It does not work on a separated CUPS server machine
where users who submit print jobs are not logged in.
%prep
%setup -c -T
%build
gcc %optflags -fPIE -pie -o get_printing_ticket %SOURCE0
%install
mkdir -p %buildroot%{_bindir}
install -m 700 get_printing_ticket %buildroot%{_bindir}/
# cups SMB support
mkdir -p %{buildroot}/%{cups_lib_dir}/backend/
touch %{buildroot}/%{cups_lib_dir}/backend/smb
%post
if test ${1:-0} -eq 1 -a -d %{cups_lib_dir}/backend; then
ln -fs %{_bindir}/get_printing_ticket %{cups_lib_dir}/backend/smb
fi
%if 0%{?suse_version} >= 1140
%set_permissions %{_bindir}/get_printing_ticket
%endif
%postun
if test ${1:-0} -eq 0 -a -e %{_bindir}/smbspool -a -d %{cups_lib_dir}/backend; then
ln -fs %{_bindir}/smbspool %{cups_lib_dir}/backend/smb
fi
%if 0%{?suse_version} >= 1140
%verifyscript
%verify_permissions -e %{_bindir}/get_printing_ticket
%endif
%files
%defattr(-,root,root)
%if 0%{?suse_version} >= 1140
%verify(not mode) %attr(0700,root,lp) %{_bindir}/get_printing_ticket
%else
%attr(-,root,lp) %{_bindir}/get_printing_ticket
%endif
%dir %{cups_lib_dir}
%dir %{cups_lib_dir}/backend
%ghost %{cups_lib_dir}/backend/smb
%changelog