Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37501637
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 

%def_enable sane_backend
%def_enable python_tools
%def_disable foomatic_ppd
#def_enable foomatic_ppd
%def_without service59
### This minor is for syncronized HPLIP minor version and HPIJS minor version
%define hplip_minor 6.6a

Name: hplip
Version: 1.%hplip_minor
Release: alt0.M30.4.1

%define foomatic_snapshot 20060712
%define fooversion 1.%hplip_minor
%define hpijsname hpijs
### Number of version you can get from hplip-0.9.1/prnt/hpijs/configure.in
%define hpijsversion 2.%hplip_minor
%define foomaticname foomatic-db-%hpijsname-%foomatic_snapshot

Summary: Solution for printing, scanning, and faxing with Hewlett-Packard inkjet and laser printers.
License: GPL/MIT/BSD
Group: Publishing
URL: http://hpinkjet.sourceforge.net

Conflicts: ghostscript <= 7.05-alt15
#Conflicts: hpijs <= 2.0
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_tools
###Requires: python
Requires: python-module-PyQt
Requires: python-module-qt => 3.16-alt0
%add_python_lib_path %_datadir/%name
%endif

%if_with service59
# in fact, Recommends: service => 0.5.9-alt1
Requires: service => 0.5.9-alt1
%endif

Source: http://hpinkjet.sourceforge.net/%name-%version.tar.bz2
Source1: http://www.linuxprinting.org/download/foomatic/%foomaticname.tar.bz2
Source2: %name.init
# Need remove when all wiil be GOOD
Source21: %name.init.new
Source5: %name.png.bz2
Source6: %name-icons.tar.bz2

# OpenSuSE based sources

Source101: hp-toolbox.wrapper
Source102: hpijs.1

Patch: hplip-1.6.6a-alt-automake-ld.patch
Patch1: hplip-1.6.6a-alt-urlhandler.patch

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_tools
BuildPreReq: python-module-PyQt-devel
#RemovedBuildRequires: python-base python-dev python-modules-compiler python-modules-encodings
BuildRequires: python-devel
%endif

%if_enabled foomatic_ppd
BuildPreReq: perl cups-common #for cupstestppd
%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.

%if_enabled python_tools
%package tools
Summary: Hewlett-Packard Co. Inkjet Printers and MFPs utilities
License: GPL
Group: Publishing
Obsoletes: xojpanel <= 0.91
Obsoletes: hpoj-xojpanel <= 0.91

%description tools
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 various tools for memory card access,
ink/toner/battery/consumable level checking, and inkjet printer
maintenance.
In addition, there is the toolbox application with which several
maintenance and status check tasks 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.

%package hpijs
Summary: Hewlett-Packard Co. Inkjet Driver Project
License: BSD
Group: Publishing
Obsoletes: hpijs
Provides: %hpijsname = %hpijsversion
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-%hpijsname = %version-%release
Obsoletes: hpijs-foomatic
Provides: %hpijsname-foomatic = %hpijsversion
Provides: foomatic-db-hpijs = %fooversion-%foomatic_snapshot
PreReq: foomatic-db-engine >= 3.0.1
PreReq: printer-drivers-utils


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


%prep
%setup -q -a 1
%patch0 -p1
%patch1 -p0
fgrep -lZr '#!/usr/bin/env python' . | xargs -r0 %__subst 's,#!/usr/bin/env python,#!/usr/bin/python,'
tar -jxf %SOURCE6

%build
export QTDIR=%_libdir/qt3
autoconf

#we install foomatic data in separate package

# --enable-rpm_install=yes \
%configure \
--enable-network-build=yes \
%if_enabled foomatic_ppd
%else
--disable-foomatic-install \
%endif
%if_enabled sane_backend
--with-sane \
%else
--without-sane \
%endif

%if_enabled foomatic_ppd
### a piece of ancient wisdom of SuSE
# Make some general tests and adjustments for all PPDs (see manufacturer-PPDs.spec):
#pushd %{buildroot}%{_datadir}/cups/model/manufacturer-PPDs/%{name}
pushd prnt/hpijs/ppd
# uncomment if in destination dir
####gunzip *.ppd.gz

# Correct or remove non-working PPDs:

# Several HP PPDs contain "600x600x2dpi" which is not allowed
# according to the Adobe PPD specification section 5.9
# and which can be simply replaced by "600x1200dpi"
# because "600x1200dpi" is not used elsewhere in the PPD.
# Some PPDs contain a "*cupsFilter: ... hppostprocessing" line
# which cannot work because there is no "hppostprocessing" filter.
# Some PPDs contain "1284DeviceId" which must be "1284DeviceID".
for p in *.ppd
do perl -pi -e 's/600x600x2dpi/600x1200dpi/;' $p
  grep -q '^\*cupsFilter:.*hppostprocessing' $p && rm -v $p
  perl -pi -e 's/1284DeviceId/1284DeviceID/;' $p
done
# HP_LaserJet_5Si.ppd works only when this printer has the optional PostScript module:
sed -i -e '/^\*NickName:/s/ (recommended)//' HP_LaserJet_5Si.ppd
sed -i -e '/^\*ModelName:/s/5Si/5Si MX/' HP_LaserJet_5Si.ppd
# HP_LaserJet_5MP.ppd works only for the model with the built-in PostScript module ("MP"):
sed -i -e '/^\*ModelName:/s/5P/5MP/' HP_LaserJet_5MP.ppd
# Change default media size to A4 if this is an available choice in the PPD and then
# set DefaultPageSize, DefaultPageRegion, DefaultImageableArea, DefaultPaperDimension to A4:
for p in *.ppd
do for i in PageSize PageRegion ImageableArea PaperDimension
  do if grep -q "^\*$i[[:space:]]*A4[:/]" $p
     then grep -q "^\*Default$i:[[:space:]]*A4\$" $p || perl -pi -e "s/^\*Default$i:.*/\*Default$i: A4/" $p
     fi
  done
done
# Final test by cupstestppd:
# Only keep files which don't FAIL for cupstestppd.
# To save disk space gzip the files (gzipped PPDs can also be used by CUPS):
for p in *.ppd
do cupstestppd $p || { rm -v $p ; continue ; }
# uncomment if in destination dir
####   gzip $p
done
popd
# End of the general tests and adjustments for all PPDs.
%endif # foomatic_ppd

%make

(cd %foomaticname
# Makefile generation ("./make_configure" for CVS snapshots)
./make_configure
# Fix for lib64 architectures, avoid patch
perl -pi -e "s at /usr/lib/(cups|pdq|ppr) at %_libdir/\1 at g" configure
%configure
%make
)




%install
%make DESTDIR=$RPM_BUILD_ROOT install

(cd %foomaticname
%make DESTDIR=$RPM_BUILD_ROOT install
)

install -d $RPM_BUILD_ROOT/%_datadir/cups/model/
%if_disabled foomatic_ppd
# 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/
%endif

###

mkdir -p $RPM_BUILD_ROOT%_sysconfdir/hp

# remove original service

rm -f $RPM_BUILD_ROOT/etc/init.d/%name
%if_with service59
%__install -pD -m755 %SOURCE21 $RPM_BUILD_ROOT%_initdir/%name
%else
%__install -pD -m755 %SOURCE2 $RPM_BUILD_ROOT%_initdir/%name
%endif
%__cp COPYING $RPM_BUILD_ROOT%_docdir/%name-%version/

mv $RPM_BUILD_ROOT/%_datadir/%name/%name.conf $RPM_BUILD_ROOT/%_sysconfdir/hp

# Because enable configure options --enable-rpm_install=yes

# we must create link hp-*
# peer in Makefile.am for complete list of dist_cmd_SCRIPTS
DIST_CMD_SCRIPTS="align info print toolbox clean colorcal unload testpage makeuri check fab levels sendfax setup makecopies"
for app_name in $DIST_CMD_SCRIPTS; do
%__ln_s -f $(relative %_datadir/%name/$app_name %_bindir/%name) %buildroot%_bindir/hp-$app_name;
done


# # 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`


# Enter directories in startup file

perl -p -i -e 's:HPIODDIR=:HPIODDIR=%_sbindir:' $RPM_BUILD_ROOT%_datadir/%name/%name.sh
perl -p -i -e 's:HPSSDDIR=:HPSSDDIR=%_datadir/%name:' $RPM_BUILD_ROOT%_datadir/%name/%name.sh

# install menu entry

%__install -d $RPM_BUILD_ROOT{%_menudir,%_datadir/applications}
cat << EOF > $RPM_BUILD_ROOT%_menudir/%name
?package(%name): longtitle="%summary - HP Device Manager" \
command="%_bindir/hp-toolbox.wrapper" title="HP Device Manager" needs="x11" \
section="Configuration/Printing" \
icon="%name.png"
EOF
cat << EOF > $RPM_BUILD_ROOT%_datadir/applications/%name.desktop
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=HPLIP
GenericName=HP Device Manager
Comment=HP Linux Imaging and Printing System - HP Device Manager
Icon=hplip.png
TryExec=%{_bindir}/hp-toolbox.wrapper
Exec=%{_bindir}/hp-toolbox.wrapper
Terminal=false
Categories=QT;Application;System;Printing;
EOF
#Exec=/usr/share/hplip/hplip
# what's this? (fedora)
#echo 'Hidden=true' >> %{buildroot}%{_datadir}/hplip/data/hplip.desktop

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


# Menu Icons

# backwards compatibility with Master 2x/Compact 30
%{?!_niconsdir:%define _niconsdir %_iconsdir}
%__install -pD -m644 %name.16.png $RPM_BUILD_ROOT%_miconsdir/hplip.png
%__install -pD -m644 %name.32.png $RPM_BUILD_ROOT%_iconsdir/hplip.png
%__install -pD -m644 %name.48.png $RPM_BUILD_ROOT%_liconsdir/hplip.png

# Install other files for HPIJS

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


# Move SANE backend into correct directory

mkdir -p %{buildroot}%{_libdir}/sane
mv %{buildroot}%{_libdir}/libsane-*.so* %{buildroot}%{_libdir}/sane
# instead of:
#%__ln_s %_libdir/libsane-hpaio.so.1 %buildroot%_libdir/sane

# 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

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


%post
%update_menus
%post_service hplip
/sbin/service cups condrestart

%preun
%preun_service hplip

%postun
%clean_menus
/sbin/service cups condrestart

%post foomatic
/usr/bin/update-printers-db

%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
%doc %_docdir/%name-%version
%dir %{_sysconfdir}/hp
%config(noreplace) %{_sysconfdir}/hp/hplip.conf
%config(noreplace) %_initrddir/%name
# HPLIP
%_sbindir/hpiod
# CUPS backend
%_libdir/cups/backend/hp
%_libdir/cups/backend/hpfax
# ppd
%if_enabled foomatic_ppd
%_datadir/cups/model/foomatic-ppds
%_datadir/ppd/HP/*
%else
%_datadir/cups/model/HP-Fax-hplip.ppd.gz
%endif
# HPLIP menu files
%_menudir/%name
%_datadir/applications/%name.desktop
%_iconsdir/hplip.png
%_liconsdir/hplip.png
%_miconsdir/hplip.png

%if_enabled python_tools
%files tools
#_bindir/hp-*
%{_bindir}/hp-toolbox.wrapper
%{_bindir}/hp-toolbox
%{_bindir}/hp-align
%{_bindir}/hp-check
%{_bindir}/hp-clean
%{_bindir}/hp-colorcal
%{_bindir}/hp-fab
%{_bindir}/hp-info
%{_bindir}/hp-levels
%{_bindir}/hp-makecopies
%{_bindir}/hp-makeuri
%{_bindir}/hp-print
%{_bindir}/hp-sendfax
%{_bindir}/hp-setup
%{_bindir}/hp-testpage
%{_bindir}/hp-unload
%_datadir/%name
# C libraries for Python
%_libdir/python*/site-packages/*.so*
%endif

%files common
# HPIP
%_libdir/libhpip*

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

%if_enabled sane_backend
# SANE
%files sane
%_libdir/sane/libsane-hpaio*.so*
%endif

%files foomatic
%doc  %foomaticname/TODO   %foomaticname/USAGE
%doc  %foomaticname/ChangeLog %foomaticname/README
%_datadir/foomatic/db

#TODO

#*** GLOBAL ***
#[FR] Need RPM's conflicts and provides, and Requires!!!
#[DONE] Create correct initscript for ALT Linux
#[FR] merge old alt and new hplip initscript
#*** SANE Backend ***
#[DONE - Need test!!!] Move configs to %_sysconfdir/hplip
#SANE - need test with real devices and SANE software
#*** FOMATIC ***
#Update version from linuxprinting at new release
#*** CUPS Backend ***
#[FR] Need create somthing to see in cups web interface avalable hplip devices
#*** HPIJS Backend ***


%changelog

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

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