File yast2-printer.spec of Package yast2-printer

#
# spec file for package yast2-printer
#
# Copyright (c) 2013 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:           yast2-printer
Version:        3.0.0
Release:        0

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source0:        yast2-printer-%{version}.tar.bz2

# Patch0 test_if_hplip_is_installed.diff is a simple band-aid patch to avoid that the
# AddDriverDialog works inconsistently regarding HPLIP RPMs (hplip-hpijs versus hplip)
# see https://bugzilla.novell.com/show_bug.cgi?id=837770
# and restore consistent behaviour and sufficiently consistent texts.
# The real solution will be implemented later according to what is described
# in https://bugzilla.novell.com/show_bug.cgi?id=808315#c3
Patch0:         test_if_hplip_is_installed.diff

BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-libX11-devel
BuildRequires:  yast2
BuildRequires:  yast2-core-devel
BuildRequires:  yast2-devtools
BuildRequires:  yast2-testsuite

Recommends:     cups-client iptables netcat samba-client

Requires:       /bin/mktemp
Requires:       /bin/ping
Requires:       /usr/bin/sed
Requires:       yast2 >= 2.16.12

# Used to exclude libX11, libXau, libxcb, and libxcb-xlib from the requires list
# which are pulled in by Autoreqprov because of the basicadd_displaytest tool:
%define my_requires /tmp/my-requires

Requires:       yast2-ruby-bindings >= 1.0.0

Summary:        YaST2 - Printer Configuration
License:        GPL-2.0
Group:          System/YaST

%package devel-doc
BuildRequires:  cups-devel
BuildRequires:  yast2-core-devel
Summary:        Developer documentation for yast2-printer
Group:          Documentation/SUSE

%description
This package contains the YaST2 component for printer configuration.

%description devel-doc
Developer documentation for yast2-printer.

%prep
%setup -n yast2-printer-%{version}
# Patch0 test_if_hplip_is_installed.diff is a simple band-aid patch to avoid that the
# AddDriverDialog works inconsistently regarding HPLIP RPMs (hplip-hpijs versus hplip)
# see https://bugzilla.novell.com/show_bug.cgi?id=837770
# and restore consistent behaviour and sufficiently consistent texts:
%patch0

%build
%{_prefix}/bin/y2tool y2autoconf
%{_prefix}/bin/y2tool y2automake
autoreconf --force --install

export CFLAGS="$RPM_OPT_FLAGS -DNDEBUG"
export CXXFLAGS="$RPM_OPT_FLAGS -DNDEBUG"

./configure --libdir=%{_libdir} --prefix=%{_prefix} --mandir=%{_mandir}
# V=1: verbose build in case we used AM_SILENT_RULES(yes)
# so that RPM_OPT_FLAGS check works
make %{?jobs:-j%jobs} V=1

%install
make install DESTDIR="$RPM_BUILD_ROOT"
[ -e "%{_prefix}/share/YaST2/data/devtools/NO_MAKE_CHECK" ] || Y2DIR="$RPM_BUILD_ROOT/usr/share/YaST2" make check DESTDIR="$RPM_BUILD_ROOT"
for f in `find $RPM_BUILD_ROOT/%{_prefix}/share/applications/YaST2/ -name "*.desktop"` ; do
    d=${f##*/}
    %suse_update_desktop_file -d ycc_${d%.desktop} ${d%.desktop}
done

# Exclude libX11, libXau, libxcb, and libxcb-xlib from the requires list
# which are pulled in by Autoreqprov because of the basicadd_displaytest tool:
cat << EOF > %{my_requires}
grep -v 'basicadd_displaytest' | %{__find_requires}
EOF
chmod 755 %{my_requires}
%define __find_requires %{my_requires}

%post

%clean
rm -rf "$RPM_BUILD_ROOT"

%files
%defattr(-,root,root)
%dir /usr/share/YaST2/include/printer
%{_prefix}/share/applications/YaST2/printer.desktop
/usr/share/YaST2/modules/*.rb
/usr/share/YaST2/clients/printer*
/usr/share/YaST2/include/printer/*
/usr/share/YaST2/schema/autoyast/rnc/printer.rnc
/usr/share/YaST2/data/testprint.ps
/usr/share/YaST2/data/testprint.2pages.ps
%{_prefix}/lib/YaST2/bin/autodetect_print_queues
%{_prefix}/lib/YaST2/bin/autodetect_printers
%{_prefix}/lib/YaST2/bin/create_printer_ppd_database
%{_prefix}/lib/YaST2/bin/determine_printer_driver_options
%{_prefix}/lib/YaST2/bin/cups_client_only
%{_prefix}/lib/YaST2/bin/modify_cupsd_conf
%{_prefix}/lib/YaST2/bin/test_device
%{_prefix}/lib/YaST2/bin/test_remote_ipp
%{_prefix}/lib/YaST2/bin/test_remote_lpd
%{_prefix}/lib/YaST2/bin/test_remote_novell
%{_prefix}/lib/YaST2/bin/test_remote_smb
%{_prefix}/lib/YaST2/bin/test_remote_socket
%{_prefix}/lib/YaST2/bin/basicadd_displaytest
#Documentation
%dir %{_prefix}/share/doc/packages/yast2-printer
%{_prefix}/share/doc/packages/yast2-printer/COPYING
%readme %{_prefix}/share/doc/packages/yast2-printer/README

%files devel-doc
%defattr(-,root,root)
%doc %{_prefix}/share/doc/packages/yast2-printer
%exclude %{_prefix}/share/doc/packages/yast2-printer/COPYING
%exclude %{_prefix}/share/doc/packages/yast2-printer/README

%changelog
openSUSE Build Service is sponsored by