File m2300w.spec of Package m2300w

#
# spec file for package m2300w
#
# Copyright (c) 2012 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:           m2300w
BuildRequires:  autoconf
# If foomatic-filters is not installed, configure fails with
#  "checking for foomatic-rip... no
#   ERROR: This driver requires foomatic-rip.
#   Please install the 'foomatic-filters' package first."
BuildRequires:  foomatic-filters
# If Ghostscript is not installed, configure fails with
#  "checking for gs... no
#   This driver requires ghostscript.
#   Please install ghostscript first."
# But ghostscript-mini is sufficient to build it:
BuildRequires:  ghostscript-mini
Url:            http://sourceforge.net/projects/m2300w/
Summary:        Konica Minolta magicolor 2300W and 2400W Printer Driver
License:        GPL-2.0+
Group:          Hardware/Printing
Version:        0.51
Release:        0
Requires:       ghostscript
Requires:       foomatic-filters
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source0:        http://heanet.dl.sourceforge.net/sourceforge/m2300w/m2300w-%{version}.tar.bz2
# Patch100... is for openSUSE/Novell patches which which are not intended for upstream.
# The patches are not intended for upstream because the m2300w driver is no longer actively maintained.
Patch100:       m2300w-0.51-foomatic.patch
Patch101:       m2300w-0.51-resolution.patch
Patch102:       m2300w-0.51-disable_gs_test.patch
Patch103:       m2300w-fgets-overflow.patch

%description
This is an open source Linux printer driver for the Konica Minolta
magicolor 2300W and 2400W color laser printers. It requires Ghostscript
and foomatic-filters. It is recommended to use this driver with CUPS.

The current version 0.51 was released 2005-10-16 and
the m2300w driver is no longer actively maintained
which means that help, a workaround, or a bugfix
is rather unlikely if there are issues with this driver.

%prep
# Be quiet when unpacking:
%setup -q
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1

%build
autoreconf
./configure --prefix=%{_prefix}
make CFLAGS="$RPM_OPT_FLAGS"

%install
# Install m2300w:
make install INSTROOT=$RPM_BUILD_ROOT DOCDIR=$RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}
# Remove dispensable stuff (YaST2 printerdb files are obsolete since a longer time):
rm -rf $RPM_BUILD_ROOT/usr/share/YaST2
# Compress the PPDs:
gzip $RPM_BUILD_ROOT/usr/share/cups/model/Minolta/magicolor_*.ppd

%post
# send CUPS daemon SIGHUP to let it recognize new files:
if test -x /etc/init.d/cups && /etc/init.d/cups status >/dev/null
then /etc/init.d/cups reload >/dev/null
fi
# exit successfully in any case:
exit 0

%files
%defattr(-,root,root)
%{_bindir}/m2300w
%{_bindir}/m2400w
%{_bindir}/m2300w-wrapper
%dir /usr/share/cups
%dir /usr/share/cups/model
%dir /usr/share/cups/model/Minolta
/usr/share/cups/model/Minolta/magicolor_*.ppd.gz
%dir /usr/share/m2300w
/usr/share/m2300w/*
%doc %{_defaultdocdir}/%{name}

%changelog
openSUSE Build Service is sponsored by