File splix.spec of Package splix

#
# spec file for package splix
#
# Copyright (c) 2011 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/
#

# norootforbuild

%bcond_with jbigkit

%if %suse_version < 1120
%define _libexecdir %_prefix/lib
%endif

Name:           splix
Summary:        Driver for Samsung Printer Language printers
Version:        2.0.0
Release:        1
License:        GPLv2
Group:          Hardware/Printing
Url:            http://splix.ap2c.org/
Source0:        http://downloads.sourceforge.net/project/splix/splix/%{version}/%{name}-%{version}.tar.bz2
Source1:        http://splix.ap2c.org/samsung_cms.tar.bz2
Source2:        README.SuSE
Patch0:         %name-2.0.0-gcc45.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  cups-devel fdupes gcc-c++
%if %{with jbigkit}
BuildRequires:  jbigkit-devel
%endif
Requires:       cups
# Provide and obsolete its old RPM package name "cups-drivers-splix"
# see https://bugzilla.novell.com/show_bug.cgi?id=659579
Provides:       cups-drivers-splix >= %version
Obsoletes:      cups-drivers-splix < %version

%description
SpliX is a set of CUPS printer drivers for SPL (Samsung Printer
Language) printers. Some Samsung, Xerox and Dell printers use that
language.

%prep
%setup -q
%patch0 -p1
%__cp %SOURCE2 .

%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%__make %{!?_with_jbigkit:DISABLE_JBIG=1} %{?jobs:-j%{jobs}} V=1

%install
%makeinstall %{!?_with_jbigkit:DISABLE_JBIG=1} 
pushd $RPM_BUILD_ROOT%_datadir/cups/model/samsung/
%__tar xjvf "%{SOURCE1}"
popd
gzip -9 %buildroot/%_datadir/cups/model/*/*.ppd
%fdupes -s %{buildroot}

%clean
rm -fr %buildroot

%files
%defattr(-,root,root)
%doc README.SuSE
%dir %_datadir/cups
%dir %_datadir/cups/model
%dir %_datadir/cups/model/dell
%dir %_datadir/cups/model/samsung
%dir %_datadir/cups/model/xerox
%dir %_libexecdir/cups/
%dir %_libexecdir/cups/filter/
%_libexecdir/cups/filter/pstoqpdl
%_libexecdir/cups/filter/rastertoqpdl
%_datadir/cups/model/dell/*.ppd.gz
%_datadir/cups/model/samsung/*.ppd.gz
%_datadir/cups/model/samsung/cms
%_datadir/cups/model/xerox/*.ppd.gz

%changelog
openSUSE Build Service is sponsored by