Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37043124
en ru br
Репозитории ALT
S:3.23.8-alt1
5.1: 3.11.5-alt0.M51.1
4.1: 2.8.10-alt2.M41.1
4.0: 2.7.12-alt2.M40.1
+backports:2.8.10-alt2.M40.1
3.0:
+backports:1.6.6a-alt0.M30.4.1
www.altlinux.org/Changes

Группа :: Издательство
Пакет: hplip

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Summary: Solution for printing, scanning, and faxing with Hewlett-Packard inkjet and laser printers.

%def_enable sane_backend
%def_enable python_code
%def_enable PPDs
%def_disable backportM30_mode
%def_without external_foomatic_db

Name: hplip
Version: 2.7.12
Release: alt2.M40.1
License: GPL/MIT/BSD
Group: Publishing
URL: http://hplip.sourceforge.net
Packager: Igor Vlasenko <viy at altlinux.org>

%define foomatic_snapshot 20070820
%define fooversion %version
%define hpijsname hpijs
%define foomaticname foomatic-db-hpijs

Conflicts: ghostscript <= 7.05-alt15
Obsoletes: hpoj <= 0.91
Provides: cups-backend-ptal
Obsoletes: cups-backend-ptal
Conflicts: cups < 1.1.18-alt7

PreReq: cups
Requires: %name-common = %version-%release

%if_enabled python_code
###Requires: python
Requires: python-module-qt => 3.16-alt0
%add_python_lib_path %_datadir/%name
%endif

Requires: service => 0.5.9-alt1
%if_enabled backportM30_mode
BuildRequires: rpm-build-compat >= 0.4
%endif

Source: http://dl.sourceforge.net/hplip/%name-%version.tar.bz2
%if_with external_foomatic_db
Source1: http://www.linuxprinting.org/download/foomatic/%foomaticname.tar.bz2
%endif
Source2: %name.init
Source4: 80-hpmud.perms
Source5: %name.png
Source6: %name-icons.tar.bz2
Source7: %name-fixppd.sh
# fedora fdi policy (examine)
Source100: hplip.fdi

# OpenSuSE based sources

# deprecated; 2.7.7 shows 'can't connect to device'
Source101: hp-toolbox.wrapper
Source102: hpijs.1

Patch0: hplip-2.7.12-alt-automake-ld.patch
Patch1: hplip-2.7.12-alt-urlhandler.patch
Patch2: hplip-2.7.12-alt-fix-udev-rules.patch
Patch3: hplip-2.7.10-alt-hplip-desktop.patch

Patch10: http://www.linuxprinting.org/download/printing/hpijs/hpijs-1.4.1-rss.1.patch
# it is patch 10 rediffed
Patch11: hpijs-1.4.1-rss-alt-for-2.7.7.patch

# fedora patches

Patch103: fedora-2.7.12-4-hplip-quiet.patch
Patch104: fedora-2.7.12-4-hplip-marker-supply.patch
# in patch0
#Patch: fedora-2.7.12-4-hplip-libm.patch
# in patch2
#Patch: fedora-2.7.12-4-hplip-udev-rules.patch
Patch108: fedora-2.7.12-4-hplip-libsane.patch
Patch109: fedora-2.7.12-4-hplip-media-empty.patch
Patch111: fedora-2.7.12-4-hplip-unload-traceback.patch
Patch112: fedora-2.7.12-4-hplip-no-root-config.patch
Patch113: fedora-2.7.12-4-hplip-ui-optional.patch
Patch106: fedora-2.7.12-4-hplip-alloc.patch
#Patch??: fedora-2.7.12-4-hplip-guest.patch

Patch201: hplip-parse-crash-12.patch
Patch202: hplip-static-alerts-table.patch
Patch203: hplip-validate-uri.patch


# for hack around file conflict

BuildRequires: foomatic-db

BuildPreReq: libsane-devel
# Automatically added by buildreq on Thu Sep 22 2005
BuildRequires: gcc-c++ libcups-devel libjpeg-devel libnet-snmp-devel libssl-devel libstdc++-devel libusb-devel

%if_enabled python_code
BuildPreReq: python-module-qt-devel
#RemovedBuildRequires: python-base python-dev python-modules-compiler python-modules-encodings
BuildRequires: python-devel
%endif

%if_enabled PPDs
#cups-common is for cupstestppd
BuildPreReq: perl cups-common
%endif

%description
This is the HP driver package to supply Linux support for most
Hewlett-Packard DeskJet, LaserJet, PSC, OfficeJet, and PhotoSmart
printers and all-in-one peripherals (also known as Multi-Function
Peripherals or MFPs), which can print, scan, copy, fax, and/or access
flash memory cards.

This package contains various tools for memory card access,
ink/toner/battery/consumable level checking, and inkjet printer
maintenance, along with python cups backends.


%if_enabled python_code
%package gui
Summary: HPLIP graphical tools for Hewlett-Packard Co. Inkjet Printers and MFPs
License: GPL
Group: Publishing
Obsoletes: xojpanel <= 0.91
Obsoletes: hpoj-xojpanel <= 0.91
Obsoletes: hplip-tools < 2.0
Provides: hplip-tools = 2.0
# for hp-scan -n
Requires: python-module-imaging
Requires: %name = %version-%release
%if_enabled PPDs
Requires: %name-PPDs = %version-%release
%endif

%description gui
HPLIP is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux.

The HPLIP project provides printing support for nearly 1000 printer models, including Deskjet, Officejet, Photosmart, PSC (Print Scan Copy), Business Inkjet, LaserJet, and LaserJet MFP.

This package contains the gui toolbox application for HPLIP,
with which several tasks such as memory card access,
ink/toner/battery/consumable level checking, and inkjet printer
maintenance can be done.
%endif

%package common
Summary: Hewlett-Packard Co. Inkjet Driver Project
License: GPL
Group: Publishing

%description common
HPLIP is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux.

The HPLIP project provides printing support for nearly 1000 printer models, including Deskjet, Officejet, Photosmart, PSC (Print Scan Copy), Business Inkjet, LaserJet, and LaserJet MFP.

This package contains common libraries for
The Hewlett-Packard  Inkjet  Driver  Project.

%description
This is the HP driver package to supply Linux support for most
Hewlett-Packard DeskJet, LaserJet, PSC, OfficeJet, and PhotoSmart
printers and all-in-one peripherals (also known as Multi-Function
Peripherals or MFPs), which can print, scan, copy, fax, and/or access
flash memory cards.

%if_enabled PPDs
%package PPDs
Summary: PPDs for Hewlett-Packard Co. Inkjet Printers and MFPs
License: MIT
Group: Publishing

%description PPDs
HPLIP is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux.

The HPLIP project provides printing support for nearly 1000 printer models, including Deskjet, Officejet, Photosmart, PSC (Print Scan Copy), Business Inkjet, LaserJet, and LaserJet MFP.

This package contains postscript printer definition files (PPDs)

various tools for memory card access,
ink/toner/battery/consumable level checking, and inkjet printer
maintenance.
%endif

%package hpijs
Summary: Hewlett-Packard Co. Inkjet Driver Project
License: BSD
Group: Publishing
Obsoletes: hpijs < 2.7
Provides: %hpijsname = %version
Requires: %name-common = %version-%release
Requires: ghostscript

%description hpijs
hpijs is a collection of optimized drivers for HP printers.
hpijs supports the DeskJet 350C, 600C, 600C Photo, 630C, Apollo 2000,
Apollo 2100, Apollo 2560, DeskJet 800C, DeskJet 825, DeskJet 900,
PhotoSmart, DeskJet 990C, and PhotoSmart 100 series.

The  Hewlett-Packard  Inkjet  Driver  Project  is  a add-on to the GNU
Ghostscript  application. This driver is open source software based on
the  Hewlett  Packard  Appliance  Printing Development Kit APDK for
deskjet printers.

%if_enabled sane_backend
%package sane
Summary: SANE driver for scanners in HP's multi-function devices (from HPLIP)
License: GPL
Group: Publishing
Requires: libsane
Requires: %name-common = %version-%release
Obsoletes: libsane-hpoj <= 0.91

%description sane
SANE driver for scanners in HP's multi-function devices (from HPLIP)
%endif # sane_backend

%package foomatic
Summary: foomatic data for %name-%hpijsname
Group: Publishing
Requires: %{name}-hpijs = %version-%release
Obsoletes: hpijs-foomatic
Provides: %hpijsname-foomatic = %version
Provides: foomatic-db-hpijs = %fooversion-%foomatic_snapshot
PreReq: foomatic-db-engine >= 3.0.1
%if_enabled backportM30_mode
PreReq: printer-drivers-utils
%endif

%description foomatic
foomatic database for %hpijsname
Snapshot at %foomatic_snapshot


%prep
%if_with external_foomatic_db
%setup -q -a 1
%else
%setup -q
%endif

%patch0 -p1
%patch1 -p1
%patch2 -p1

# Fix desktop file.

%patch3 -p1 -b .desktop

# Quieten hpssd on startup.

%patch103 -p1 -b .quiet

# Low ink is a warning condition, not an error.

%patch104 -p1 -b .marker-supply

# patch0 is better

# libhpip should link against libm (bug #197599).
#%patch105 -p1 -b .libm

%patch106 -p1 -b .alloc

# Link libsane-hpaio against libsane (bug #234813).

%patch108 -p1 -b .libsane

# Clear the media-empty-error printer state.

%patch109 -p1 -b .media-empty

# Prevent a traceback when unloading a photo card (bug #238617).

%patch111 -p1 -b .unload-traceback

# Prevent SELinux audit message from the CUPS backends (bug #241776)

#patch112 -p1 -b .no-root-config

# Make utils.checkPyQtImport() look for the gui sub-package (bug #243273).

%patch113 -p1 -b .ui-optional

%patch201 -p1
%patch202 -p1
%patch203 -p1

fgrep -lZr '#!/usr/bin/env python' . | xargs -r0 %__subst 's,#!/usr/bin/env python,#!/usr/bin/python,'
tar -jxf %SOURCE6

#pushd prnt/hpijs

#%patch10 -p1
#popd
# it is patch 10 rediffed
%patch11 -p1

## fix for possibly broken foomatic_db.inc (was in 2.7.9)

mv foomatic_db.inc foomatic_db.inc.old
cat foomatic_db.inc.old | perl -npe '$_="" if m,PPD/HP/([Hh][Pp][-_].*\.ppd) \\\n, and not -e "foomatic-db/db/source/PPD/HP/$1";' > foomatic_db.inc
echo "any difference?"
diff foomatic_db.inc.old foomatic_db.inc
##################################

%build

export QTDIR=%_libdir/qt3

autoconf
cat > /dev/null <<EOF
--enable-doc-build               enable documentation build (default=yes)
--enable-hpijs-only-build        enable hpijs only build (default=no)
--enable-foomatic-ppd-install    enable foomatic ppd install, uses hpppddir default=no
--enable-foomatic-xml-install    enable foomatic xml install, uses foomaticdir default=yes
--with-cupsbackenddir=DIR        set cups backend install directory, default=/usr/lib/cups/backend
--with-icondir=DIR               set icon install directory, default=/usr/share/applications
--with-hpppddir=DIR              set hp ppd install directory, default=datadir/ppd/HP
--with-docdir=DIR                set hplip documentation directory, default=datadir/doc
--with-foomaticdir=DIR           set foomatic db install directory, default=datadir/foomatic
EOF

#we install foomatic data in separate package

%configure \
%if_enabled PPDs
   --enable-foomatic-ppd-install \
%else
   --disable-foomatic-ppd-install \
%endif
   --enable-foomatic-xml-install \
%if_enabled python_code
   --enable-gui-build \
   --enable-fax-build \
   --enable-network-build=yes \
%if_enabled backportM30_mode
   --enable-cups11-build \
%endif
%if_enabled sane_backend
   --enable-scan-build \
%else
   --disable-scan-build \
%endif
%else
   --enable-hpijs-only-build
%endif

%make

%if_with external_foomatic_db
pushd %foomaticname
# Makefile generation ("./make_configure" for CVS snapshots)
./make_configure
# TODO: whether it is needed in modern times ??
# Fix for lib64 architectures, avoid patch
%__subst "s at /usr/lib/(cups|pdq|ppr) at %_libdir/\1 at g" configure
%configure
%make
popd
%endif

%install
%if_with external_foomatic_db
# TODO: by the way, do we need it now?
pushd %foomaticname
%make DESTDIR=$RPM_BUILD_ROOT install
popd
%endif

install -d $RPM_BUILD_ROOT/%_datadir/cups/model/
%if_disabled PPDs
# in alt, ppds are stored with cups (not good?)
#mv $RPM_BUILD_ROOT/usr/share/ppd/HP/fax/HP-Fax-hplip.ppd.gz $RPM_BUILD_ROOT/%_datadir/cups/model/
install -m644 fax/ppd/HP-Fax-hplip.ppd $RPM_BUILD_ROOT/%_datadir/cups/model/
%endif

%make DESTDIR=$RPM_BUILD_ROOT install
%if_enabled python_code
###
mkdir -p $RPM_BUILD_ROOT%_sysconfdir/security/console.perms.d/
%__install -m 600 %{SOURCE4} $RPM_BUILD_ROOT%_sysconfdir/security/console.perms.d/80-hpmud.perms

#mkdir -p $RPM_BUILD_ROOT%_initdir/

#%__install -m 755 %{SOURCE2} $RPM_BUILD_ROOT%_initdir/%name

mkdir -p $RPM_BUILD_ROOT%_sysconfdir/hp

### add to doc install

%__cp COPYING $RPM_BUILD_ROOT%_docdir/%name-%version/

# # Comment out all "setSizePolicy" calls, this function is incompatible with

# # PyQT/SIP <3.16
# # the code below is correct: it does'nt comments semilines ..., as previous
# # which cause syntax error in 1.6.6a, but is deprecated with PyQT = 3.16
# perl -p -i -e 'if (/^(.*setSizePolicy.*)$/) {$_="#".$_; if (/,\s*$/) {$endcomma=1}} elsif ($endcomma) {$_="#".$_; $endcomma=0}' `grep -l setSizePolicy $RPM_BUILD_ROOT%_datadir/%name/ui/*.py`

# install menu entry

%__install -d $RPM_BUILD_ROOT{%_menudir,%_datadir/applications}
rm -f $RPM_BUILD_ROOT%_menudir/%name
cat << EOF > $RPM_BUILD_ROOT%_menudir/%name
?package(%name): longtitle="%summary - HP Device Manager" \
command="%_bindir/hp-toolbox" title="HP Device Manager" needs="x11" \
section="Configuration/Printing" \
icon="%name.png"
EOF

#subst 's,Categories=Application;Utility;,Categories=Application;Utility;Printing;,' $RPM_BUILD_ROOT%_datadir/applications/%name.desktop


#install -m 755 %{SOURCE101} %{buildroot}%{_bindir}/hp-toolbox.wrapper



# Menu Icons

%__install -pD -m644 %name.16.png $RPM_BUILD_ROOT%_miconsdir/hplip.png
%__install -pD -m644 %name.32.png $RPM_BUILD_ROOT%_niconsdir/hplip.png
%__install -pD -m644 %name.48.png $RPM_BUILD_ROOT%_liconsdir/hplip.png

# Remove the installed /etc/sane.d/dll.conf

# because this is provided by the sane package:
rm -f $RPM_BUILD_ROOT%_sysconfdir/sane.d/dll.conf
# Remove other unneeded files
rm -f $RPM_BUILD_ROOT%_datadir/%name/%name
rm -f $RPM_BUILD_ROOT%_datadir/%name/hplip_readme.html
rm -f $RPM_BUILD_ROOT%_datadir/%name/hplip_overview.png
rm -f $RPM_BUILD_ROOT%_datadir/%name/COPYING
%endif # python_code

# Install other files for HPIJS

mkdir -p $RPM_BUILD_ROOT%_docdir/%hpijsname-%version
%__install -pD -m644 prnt/hpijs/README_LIBJPG  $RPM_BUILD_ROOT%_docdir/%hpijsname-%version/
%__install -d %{buildroot}%{_man1dir}/
%__install -p -m644 %{SOURCE102} %{buildroot}%{_man1dir}/

%if_enabled PPDs
#### Remove the installed /usr/bin/foomatic-rip
#### because this is provided by the foomatic-filters package:
###rm %{buildroot}%{_bindir}/foomatic-rip
%endif # PPDs

%if_enabled PPDs
### a piece of ancient wisdom of SuSE
# Make some general tests and adjustments for all PPDs (see manufacturer-PPDs.spec):
pushd %{buildroot}%{_datadir}/foomatic/db/source/PPD/HP
#pushd foomatic-db/db/source/PPD/HP
for ppd in *.ppd{,.gz,.bz2};
do
[ -e $ppd ] && sh %{SOURCE7} $ppd
done
popd
# End of the general tests and adjustments for all PPDs.
%endif # PPDs

# fedora fdi policy

mkdir -p %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor
install -p -m644 %{SOURCE100} %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor/10-hplip.fdi


# resolving conflicts with foomatic-db

pushd $RPM_BUILD_ROOT/usr/share/foomatic/db/source/printer
for i in *.xml
do
   if [ -f /usr/share/foomatic/db/source/printer/$i ] ; then
echo "foomatic-db conflict: removed $i"
rm -f $i
   fi
done
popd

# removing unpackaged files

pushd $RPM_BUILD_ROOT
rm -f /usr/share/hplip/hplip-install \
     /usr/share/hplip/install.py
popd

%postun -n hplip-gui
%clean_menus


%post -n hplip-gui
%update_menus


%pre
# no more services
if [ -f %_initrddir/%name ]; then
   /sbin/service hplip condstop ||:
   /sbin/chkconfig --del hplip ||:
fi

%post
%update_menus
/sbin/service cups condrestart

%preun
if [ "$RPM_INSTALL_ARG1" -eq 0 ]; then
   /sbin/service cups condrestart
fi

%postun
%clean_menus

%if_enabled backportM30_mode
%post foomatic
/usr/bin/update-printers-db
%endif

%if_enabled sane_backend
%post sane
%post_ldconfig
DLLCONF=%_sysconfdir/sane.d/dll.conf
if ! %__grep -Eqs '^[[:space:]]*hpaio[[:space:]]*$' $DLLCONF; then
       if %__grep -Eqs '^[[:space:]]*#[[:space:]]*hpaio[[:space:]]*$' $DLLCONF;
then
           %__subst 's|^[[:space:]]*#[[:space:]]*hpaio[[:space:]]*$|hpaio|' $DLLCONF
       else
cat  >> $DLLCONF <<EOF
#
# HPLIP backend homepage: http://hpinkjet.sf.net/
# Uncomment the following line if hplip is installed:
hpaio
EOF
    fi
fi

%preun sane
# Remove HPLIP driver from /etc/sane.d/dll.conf
if [ "$1" = 0 ]; then
       %__subst 's|^\([[:space:]]*hpaio[[:space:]]*\)$|#\1|' %_sysconfdir/sane.d/dll.conf
fi
%endif #sane_backend

%files
%if_enabled python_code
%doc %_docdir/%name-%version
%dir %{_sysconfdir}/hp
%config(noreplace) %{_sysconfdir}/hp/hplip.conf
# logged-in user gave direct access to the printers
%_sysconfdir/security/console.perms.d/80-hpmud.perms
#deprecated
#%_initdir/%name
# C libraries for Python
%_libdir/python*/site-packages/*.so*
%exclude %_libdir/python*/site-packages/*.la
# CUPS backend
%_prefix/lib/cups/backend/hp
%_prefix/lib/cups/backend/hpfax
# python
%{_bindir}/hp-align
%{_bindir}/hp-clean
%{_bindir}/hp-colorcal
%{_bindir}/hp-fab
%{_bindir}/hp-firmware
%{_bindir}/hp-info
%{_bindir}/hp-levels
%{_bindir}/hp-makecopies
%{_bindir}/hp-makeuri
%{_bindir}/hp-probe
%{_bindir}/hp-scan
%{_bindir}/hp-sendfax
%{_bindir}/hp-setup
%{_bindir}/hp-testpage
%{_bindir}/hp-timedate
%{_bindir}/hp-unload
# Files
%dir %{_datadir}/hplip
%{_datadir}/hplip/align.py*
%{_datadir}/hplip/clean.py*
%{_datadir}/hplip/colorcal.py*
%{_datadir}/hplip/fab.py*
%{_datadir}/hplip/fax
%{_datadir}/hplip/firmware.py*
%{_datadir}/hplip/hpssd*
%{_datadir}/hplip/info.py*
%{_datadir}/hplip/__init__.py*
%{_datadir}/hplip/levels.py*
%{_datadir}/hplip/makecopies.py*
%{_datadir}/hplip/makeuri.py*
%{_datadir}/hplip/probe.py*
%{_datadir}/hplip/scan.py*
%{_datadir}/hplip/sendfax.py*
%{_datadir}/hplip/setup.py*
%{_datadir}/hplip/testpage.py*
%{_datadir}/hplip/timedate.py*
%{_datadir}/hplip/unload.py*
# Directories
%{_datadir}/hplip/base
%{_datadir}/hplip/copier
%dir %{_datadir}/hplip/data
#%{_datadir}/hplip/data/firmware
%{_datadir}/hplip/data/ldl
%{_datadir}/hplip/data/localization
%{_datadir}/hplip/data/models
%{_datadir}/hplip/data/pcl
%{_datadir}/hplip/data/ps
%{_datadir}/hplip/pcard
%{_datadir}/hplip/prnt
%{_datadir}/hplip/scan
%endif

%if_enabled python_code
%files gui
#_bindir/hp-*
%{_bindir}/hp-print
#%{_bindir}/hp-toolbox.wrapper
%{_bindir}/hp-toolbox
# Files
%{_datadir}/hplip/print.py*
%{_datadir}/hplip/toolbox.py*
# Directories
%{_datadir}/hplip/data/images
%{_datadir}/hplip/plugins
%{_datadir}/hplip/ui
# requires installer
%{_bindir}/hp-check
%{_datadir}/hplip/check.py*
%{_datadir}/hplip/installer

# HPLIP menu files

%if_enabled backportM30_mode
%_menudir/%name
%exclude %_datadir/applications/%name.desktop
%else
%exclude %_menudir/%name
%_datadir/applications/%name.desktop
%endif
%_niconsdir/hplip.png
%_liconsdir/hplip.png
%_miconsdir/hplip.png
%endif

%files common
# HPIP
%_libdir/libhpip*so*
%_libdir/libhpmud*so*
%_sysconfdir/udev/rules.d/*.rules

%files hpijs
#doc prnt/hpijs/COPYING
%doc %_docdir/%hpijsname-%version
%_bindir/%hpijsname
%{_man1dir}/%hpijsname.1*
#HPLIP-PPDS
#%{_datadir}/foomatic/db/source/PPD/HP

%if_enabled sane_backend
# SANE
%files sane
%{_datadir}/hal/fdi/policy/10osvendor/10-hplip.fdi
%_libdir/sane/libsane-hpaio*.so*
%exclude %_libdir/sane/libsane-hpaio*.la
# is it needed?
%{_datadir}/hplip/hpaio.desc
%endif

%if_enabled PPDs
%files PPDs
### TODO !!!!
###%_datadir/cups/model/foomatic-ppds
%_datadir/ppd/HP/*
%else
%_datadir/cups/model/HP-Fax-hplip.ppd*
%endif

%files foomatic
#%doc  %foomaticname/TODO
%doc  %foomaticname/README
%if_with external_foomatic_db
%doc  %foomaticname/{ChangeLog,USAGE}
%endif
%_datadir/foomatic/db/source/driver/*
%_datadir/foomatic/db/source/opt/*
%_datadir/foomatic/db/source/PPD/HP/*
# conflicts with foomatic-db
#%_datadir/foomatic/db/source/printer/*

#TODO

#*** SANE Backend ***
#SANE - need test with real devices and SANE software
#SANE - merge SuSE trigger on installing sane
#*** FOOMATIC ***
#Update version from linuxprinting at new release (foomatic-db too)
#*** CUPS Backend ***
#[FR] Need to see in cups web interface avalable hplip devices - DONE

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin