hplip/hplip.spec

877 lines
27 KiB
RPMSpec
Raw Normal View History

2012-02-01 15:16:03 +04:00
# Define if you want to build the sane backend (default)
%define sane_backend 1
%{?_with_sane: %global sane_backend 1}
%{?_without_sane: %global sane_backend 0}
2012-02-01 15:16:03 +04:00
%define major 0
%define libhpip %mklibname hpip %{major}
2015-06-17 14:51:26 +03:00
%define libhpipp %mklibname hpipp %{major}
%define libhpmud %mklibname hpmud %{major}
2016-04-03 18:51:59 +03:00
%define libhpdiscovery %mklibname hpdiscovery %{major}
%define sanemaj 1
%define libsane %mklibname sane-hpaio %{sanemaj}
%define devname %mklibname hpip -d
2012-02-01 15:16:03 +04:00
# Suppress automatically generated Requires for devel packages
2012-08-22 11:04:03 +04:00
%define __noautoreq 'devel\(.*\)'
2012-02-01 15:16:03 +04:00
%define extraversion %nil
Summary: HP printer/all-in-one driver infrastructure
Name: hplip
Version: 3.20.6
Release: 1
2012-02-01 15:16:03 +04:00
License: GPLv2+ and MIT
Group: System/Printing
Url: http://hplip.sourceforge.net/
#Source0: http://garr.dl.sourceforge.net/sourceforge/hplip/%{name}-%{version}%{extraversion}.tar.gz
Source0: https://sourceforge.net/projects/hplip/files/%{name}/%{version}/%{name}-%{version}.tar.gz
2012-04-11 18:54:50 +04:00
Source1: hpcups-update-ppds.sh
2014-06-24 15:13:53 +04:00
Source2: copy-deviceids.py
# http://www.iconfinder.com/icondetails/6393/128/fax_hardware_icon
Source3: hp-sendfax.png
Source4: hplip.rpmlintrc
2013-11-25 18:39:05 +04:00
# http://hplipopensource.com/node/367
Source5: http://hplipopensource.com/hplip-web/smartinstall/SmartInstallDisable-Tool.run
Source6: README.urpmi
2013-11-26 16:59:00 +04:00
# (Anssi) Apply udev rules even on ACTION=="change", otherwise the permissions
# do not get applied in %%post on a new installation:
2014-06-24 15:13:53 +04:00
Patch2: hplip-apply-udev-rules-on-action-change.patch
2012-02-01 15:16:03 +04:00
# Fedora patches
Patch101: hplip-pstotiff-is-rubbish.patch
Patch102: hplip-strstr-const.patch
2016-09-26 10:15:09 +03:00
Patch103: hplip-3.16.8-ui-optional.patch
Patch104: hplip-no-asm.patch
Patch105: hplip-deviceIDs-drv.patch
Patch107: hplip-deviceIDs-ppd.patch
Patch108: hplip-retry-open.patch
Patch109: hplip-snmp-quirks.patch
Patch111: hplip-hpijs-marker-supply.patch
Patch112: hplip-clear-old-state-reasons.patch
Patch114: hplip-hpcups-sigpipe.patch
Patch115: hplip-logdir.patch
Patch116: hplip-bad-low-ink-warning.patch
Patch121: hplip-ppd-ImageableArea.patch
# fedora patch not necessary. done via sed call
#Patch129: hplip-makefile-chgrp.patch
2013-11-26 16:59:00 +04:00
Patch134: hplip-udev-rules.patch
2012-02-01 15:16:03 +04:00
# Debian/Ubuntu patches
2012-08-22 11:04:03 +04:00
# taken from http://patch-tracker.debian.org/package/hplip/3.11.7-1
Patch201: 01_rss.dpatch
Patch203: 14_charsign_fixes.dpatch
Patch204: 85_rebuild_python_ui.dpatch
Patch206: hplip-photosmart_b9100_support.patch
Patch207: pjl-duplex-binding.dpatch
#hplip-pjl-duplex-binding.patch
Patch209: hp-check-groups.dpatch
Patch210: hplip-3.15.11-mga-plasma-delay-startup.patch
Patch220: add-lidil-two-cartridge-modes.dpatch
Patch221: add_missing_newline_for_error_log.dpatch
Patch225: hpfax-bug-function-used-before-importing-log.dpatch
Patch226: hp-systray-make-menu-title-visible-in-sni-qt-indicator.dpatch
Patch227: hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde.dpatch
Patch228: hpaio-option-duplex.diff
Patch301: hplip-3.16.8-cups-2.2.patch
2014-06-24 15:13:53 +04:00
Patch302: hplip-CVE-2013-4325.patch
2015-06-17 14:51:26 +03:00
Patch304: hplip-3.15.6-hpipp_linkage.patch
2017-01-27 00:27:54 +10:00
Patch305: hpps-3.16.11-fix-syntax.patch
Patch306: fix-shortcuts-3.16.11.patch
BuildRequires: desktop-file-utils
BuildRequires: imagemagick
BuildRequires: polkit
2012-02-01 15:16:03 +04:00
BuildRequires: python-sip >= 4.1.1
BuildRequires: net-snmp-devel
2012-08-22 11:04:03 +04:00
BuildRequires: cups-devel
BuildRequires: cups-common
BuildRequires: jpeg-devel
BuildRequires: pkgconfig(dbus-1)
2012-09-13 04:19:03 +00:00
BuildRequires: pkgconfig(libgphoto2)
BuildRequires: pkgconfig(libusb)
BuildRequires: pkgconfig(libv4l1)
2015-06-15 18:00:32 +03:00
BuildRequires: pkgconfig(python3)
BuildRequires: pkgconfig(udev)
2015-06-15 18:00:32 +03:00
# Make sure we get postscriptdriver tags.
BuildRequires: python3-cups
%if %{sane_backend}
BuildRequires: pkgconfig(sane-backends)
BuildRequires: xsane
%endif
Requires(post): systemd
2012-02-01 15:16:03 +04:00
Requires: cups
# For dynamic ppd generation.
Requires: foomatic-filters
Requires: hplip-model-data
Requires: hplip-hpijs
2012-02-01 15:16:03 +04:00
Requires: hplip-hpijs-ppds
2014-06-24 13:13:58 +04:00
Requires: sip-api(%{sip_api_major}) = %{sip_api}
2012-02-01 15:16:03 +04:00
# Needed for communicating with ethernet-connected printers
Requires: net-snmp-mibs
# Needed to generate fax cover pages
2015-06-15 18:00:32 +03:00
Requires: python3-reportlab
2012-02-01 15:16:03 +04:00
# Needed since 2.8.4 for IPC
2015-06-15 18:00:32 +03:00
Requires: python3-dbus
2012-02-01 15:16:03 +04:00
Requires: polkit-agent
Requires: usermode-consoleonly
2015-06-17 14:51:26 +03:00
Requires: python3-gobject3
2012-02-01 15:16:03 +04:00
# Required by hp-scan for command line scanning
2015-06-15 18:00:32 +03:00
Requires: python3-pillow
2012-08-22 11:04:03 +04:00
Requires: sane-backends-hpaio
# Needed to avoid misleading errors about network connectivity (RH bug #705843)
Requires: wget
# (tpg) hp-check needs this
Requires: acl
# hplip tools use internal symbols from libhplip that can change among versions
Requires: %{libhpip} = %{version}
2015-06-17 14:51:26 +03:00
Requires: %{libhpipp} = %{version}
2012-08-22 11:04:03 +04:00
# Some HP ppds are in foomatic-db and foomatic-db-hpijs (mdv bug #47415)
2012-02-01 15:16:03 +04:00
Suggests: foomatic-db-hpijs
2013-11-25 18:39:05 +04:00
# hp-doctor requires gui modules
Requires: hplip-gui
2015-03-30 05:33:46 -04:00
Requires: gnupg
2015-06-15 22:14:50 +03:00
# due to hp-plugin
Requires: %{name}-compat-libs = %{version}-%{release}
2012-02-01 15:16:03 +04:00
2013-11-26 16:59:00 +04:00
2012-02-01 15:16:03 +04:00
# foomatic-db-hpijs drivers are provided by hp and by this package now
# NOTE: remove the foomatic-db-hpijs deps sometime in 2010-10-?? ?
Provides: foomatic-db-hpijs = %{version}-%{release}
%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.
It is work in progress, but printing, scanning, memory card access,
ink/toner/battery/consumable level checking, and inkjet printer
maintenance are supported on most models, when either connected to the
USB or LAN (built-in interfaces or selected HP JetDirect models) on a
Linux workstation with CUPS printing system.
For status and consumable checking and also for inkjet maintenance
there is the graphical tool "hp-toolbox" available (Menu:
"System"/"Monitoring"/"HP Printer Toolbox").
2016-04-03 18:51:59 +03:00
%package -n %{libhpdiscovery}
Summary: Dynamic hpdiscovery library
Group: System/Printing
%description -n %{libhpdiscovery}
Dynamic hpdiscovery library
%package -n %{libhpip}
Summary: Dynamic library for the "hplip" HP printer/all-in-one drivers
Group: System/Printing
2012-02-01 15:16:03 +04:00
%description -n %{libhpip}
2012-02-01 15:16:03 +04:00
Library needed for the "hplip" HP printer/all-in-one drivers
2015-06-17 14:51:26 +03:00
%package -n %{libhpipp}
Summary: Dynamic library for the "hplip" HP printer/all-in-one drivers
Group: System/Printing
%description -n %{libhpipp}
Library needed for the "hplip" HP printer/all-in-one drivers
%package -n %{libhpmud}
Summary: Dynamic library for the "hplip" HP printer/all-in-one drivers
Group: System/Printing
Conflicts: %{_lib}hpip0 < 3.13.2-4
2012-02-01 15:16:03 +04:00
%description -n %{libhpmud}
Library needed for the "hplip" HP printer/all-in-one drivers
%package -n %{devname}
Summary: Headers and links to compile against the "%{libhpip}" ("hplip") library
Group: Development/C
Requires: %{libhpip} >= %{version}-%{release}
2015-06-17 14:51:26 +03:00
Requires: %{libhpipp} >= %{version}-%{release}
Requires: %{libhpmud} >= %{version}-%{release}
Requires: %{libsane} >= %{version}-%{release}
Provides: libhpip-devel = %{version}-%{release}
Obsoletes: %{_lib}hpip0-devel < 3.13.2-4
%description -n %{devname}
2012-02-01 15:16:03 +04:00
This package contains all files which one needs to compile programs using
the "%{libhpip}" library.
2012-02-01 15:16:03 +04:00
%if %{sane_backend}
%package -n %{libsane}
Summary: SANE driver for scanners in HP's multi-function devices (from HPLIP)
Group: System/Printing
Provides: sane-backends-hpaio = %{version}-%{release}
2012-08-22 11:04:03 +04:00
# (cjw) for system-config-printer
2017-01-27 00:27:54 +10:00
Provides: libsane-hpaio = %{version}-%{release}
2012-02-01 15:16:03 +04:00
%description -n %{libsane}
2012-02-01 15:16:03 +04:00
SANE driver for scanners in HP's multi-function devices (from HPLIP)
%endif
%package model-data
Summary: Data file listing the HP printer models supported by HPLIP
Group: System/Printing
2012-02-01 15:16:03 +04:00
%description model-data
HPLIP supports most current HP printers and multifunction devices, but
there are some older models not supported. This package contains the
list of supported models. Printerdrake installs it automatically to
determine whether HPLIP has to be installed or not.
2015-06-15 22:14:08 +03:00
%package compat-libs
Summary: HPLIP Python 2 modules
License: GPLv2+ and MIT
Requires: %{name} = %{version}-%{release}
Requires: python-pillow
Requires: python-dbus
Requires: python
BuildRequires: python-devel
%description compat-libs
Python 2 modules needed by HP plugin.
2012-02-01 15:16:03 +04:00
%package gui
Summary: HPLIP graphical tools
Group: System/Printing
Requires: %{name} = %{version}-%{release}
2016-09-26 16:58:08 +03:00
Requires: python3-qt5-core
Requires: python3-qt5-dbus
Requires: python3-qt5-gui
Requires: python3-qt5-widgets
Requires: usermode
2012-02-01 15:16:03 +04:00
%description gui
HPLIP graphical tools.
%package hpijs
Summary: HPs printer driver IJS plug-in for GhostScript
Group: System/Printing
Requires: ghostscript
Provides: hpijs = %{EVRD}
2012-02-01 15:16:03 +04:00
%description hpijs
HPs printer driver IJS plug-in for GhostScript. This driver gives full
printing support for nearly all non-PostScript inkjet and laser
printers made by HP.
%package hpijs-ppds
Summary: PPD files for the HPIJS printer driver
Group: System/Printing
Requires: foomatic-filters
Requires: hplip-hpijs
2012-02-01 15:16:03 +04:00
%description hpijs-ppds
PPD files to use the HPIJS printer driver with foomatic-rip and a
printer spooler like CUPS, LPRng, PDQ, ...
%package doc
Summary: Documentation for HPLIP
Group: System/Printing
%description doc
This package contains documentation for the HPLIP driver.
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.
%prep
%setup -qn %{name}-%{version}%{extraversion}
2012-02-01 15:16:03 +04:00
#patch2 -p1 -b .udev-rules-on-action-change
2013-11-26 16:59:00 +04:00
2012-02-01 15:16:03 +04:00
# Fedora patches
# The pstotiff filter is rubbish so replace it (launchpad #528394).
#patch101 -p1 -b .pstotiff-is-rubbish
2012-02-01 15:16:03 +04:00
# Fix compilation.
#patch102 -p1 -b .strstr-const
2012-02-01 15:16:03 +04:00
# Make utils.checkPyQtImport() look for the gui sub-package (RH bug #243273).
2016-09-26 16:58:08 +03:00
# % patch103 -p1 -b .ui-optional
2012-02-01 15:16:03 +04:00
2013-11-26 16:59:00 +04:00
# Make sure to avoid handwritten asm.
#patch104 -p1 -b .no-asm
2013-11-26 16:59:00 +04:00
2013-12-09 21:33:07 +04:00
# Corrected several IEEE 1284 Device IDs using foomatic data.
# Color LaserJet CM1312nfi (bug #581005)
# Color LaserJet 3800 (bug #581935)
# Color LaserJet 2840 (bug #582215)
# Color LaserJet CP1518ni (bug #613689)
# Color LaserJet 2600n (bug #613712)
# Color LaserJet 2500/3700/4550/4600/4650/4700/5550/CP1515n/CP2025n
# CP3525/CP4520 Series/CM2320nf (bug #659040)
# Color LaserJet CP2025dn (bug #651509)
# Color LaserJet CM4730 MFP (bug #658831)
# Color LaserJet CM3530 MFP (bug #659381)
# LaserJet 4050 Series/4100 Series/2100 Series/4350/5100 Series/8000 Series
2017-01-27 00:27:54 +10:00
# P3005/P3010 Series/P4014/P4515 (bug #659039)
2013-12-09 21:33:07 +04:00
# LaserJet Professional P1606dn (bug #708472)
# LaserJet Professional M1212nf MFP (bug #742490)
# LaserJet M1536dnf MFP (bug #743915)
# LaserJet M1522nf MFP (bug #745498)
# LaserJet M1319f MFP (bug #746614)
# LaserJet M1120 MFP (bug #754139)
# LaserJet P1007 (bug #585272)
# LaserJet P1505 (bug #680951)
# LaserJet P2035 (Ubuntu #917703)
# PSC 1600 series (bug #743821)
# Officejet 6300 series (bug #689378)
# LaserJet Professional P1102w (bug #795958)
# Color LaserJet CM4540 MFP (bug #968177)
# Color LaserJet cp4005 (bug #980976)
#patch105 -p1 -b .ids
2013-11-13 16:39:35 +04:00
2013-12-06 13:37:49 +04:00
chmod +x %{SOURCE2}
mv prnt/drv/hpijs.drv.in{,.deviceIDs-drv-hpijs}
%{SOURCE2} prnt/drv/hpcups.drv.in \
prnt/drv/hpijs.drv.in.deviceIDs-drv-hpijs \
> prnt/drv/hpijs.drv.in
2013-12-09 21:48:37 +04:00
# Add Device ID for
2013-12-09 21:33:07 +04:00
# LaserJet 1200 (bug #577308)
# LaserJet 1320 series (bug #579920)
# LaserJet 2300 (bug #576928)
# LaserJet P2015 Series (bug #580231)
# LaserJet 4250 (bug #585499)
# Color LaserJet 2605dn (bug #583953)
# Color LaserJet 3800 (bug #581935)
# Color LaserJet 2840 (bug #582215)
# LaserJet 4050 Series/4100 Series/2100 Series/2420/4200/4300/4350/5100 Series
# 8000 Series/M3027 MFP/M3035 MFP/P3005/P3010 Series (bug #659039)
# Color LaserJet 2500/2550/2605dn/3700/4550/4600
# 4650/4700/5550/CP3525 (bug #659040)
# Color LaserJet CM4730 MFP (bug #658831)
# Color LaserJet CM3530 MFP (bug #659381)
# Designjet T770 (bug #747957)
# Color LaserJet CM4540 MFP (bug #968177)
# Color LaserJet cp4005 (bug #980976)
#for ppd_file in $(grep '^diff' %{PATCH107} | cut -d " " -f 4);
#do
# gunzip ${ppd_file#*/}.gz
#done
2013-12-09 21:33:07 +04:00
#patch107 -p1 -b .deviceIDs-ppd
#for ppd_file in $(grep '^diff' %{PATCH107} | cut -d " " -f 4);
#do
# gzip -n ${ppd_file#*/}
#done
2012-02-01 15:16:03 +04:00
2013-12-06 13:37:49 +04:00
2012-02-01 15:16:03 +04:00
# Retry when connecting to device fails (RH bug #532112).
#patch108 -p1 -b .retry-open
2012-02-01 15:16:03 +04:00
2012-08-22 11:04:03 +04:00
# Mark SNMP quirks in PPD for HP OfficeJet Pro 8500 (RH bug #581825).
#patch109 -p1 -b .snmp-quirks
2012-08-22 11:04:03 +04:00
# Fixed bogus low ink warnings from hpijs driver (RH bug #643643).
#patch111 -p1 -b .hpijs-marker-supply
2012-02-01 15:16:03 +04:00
2012-08-22 11:04:03 +04:00
# Clear old printer-state-reasons we used to manage (RH bug #510926).
#patch112 -p1 -b .clear-old-state-reasons
2012-02-01 15:16:03 +04:00
# Avoid busy loop in hpcups when backend has exited (RH bug #525944).
#patch114 -p1 -b .hpcups-sigpipe
2012-02-01 15:16:03 +04:00
#patch115 -p1 -b .logdir
2012-08-22 11:04:03 +04:00
2012-02-01 15:16:03 +04:00
# Fixed Device ID parsing code in hpijs's dj9xxvip.c (RH bug #510926).
#patch116 -p1 -b .bad-low-ink-warning
2012-02-01 15:16:03 +04:00
2012-08-22 11:04:03 +04:00
# Fix ImageableArea for Laserjet 8150/9000 (RH bug #596298).
#for ppd_file in $(grep '^diff' %{PATCH121} | cut -d " " -f 4);
#do
# gunzip ${ppd_file#*/}.gz
#done
#patch121 -p1 -b .ImageableArea
#for ppd_file in $(grep '^diff' %{PATCH121} | cut -d " " -f 4);
#do
# gzip -n ${ppd_file#*/}
#done
2012-02-01 15:16:03 +04:00
# Don't run 'chgrp lp /var/log/hp' in makefile (removes all lines with "chgrp")
#sed -i '/chgrp/d' Makefile.am
2012-02-01 15:16:03 +04:00
#sed -i.duplex-constraints \
# -e 's,\(UIConstraints.* \*Duplex\),//\1,' \
# prnt/drv/hpcups.drv.in
2012-02-01 15:16:03 +04:00
2013-11-26 16:59:00 +04:00
# Removed SYSFS use in udev rules and actually made them work (bug #560754).
# Move udev rules to /lib/udev/rules.d (bug #748208).
#patch134 -p1 -b .udev-rules
2013-04-15 09:59:51 +04:00
2012-08-22 11:04:03 +04:00
# Debian/Ubuntu patches
2012-02-01 15:16:03 +04:00
2012-08-22 11:04:03 +04:00
# This patch tries to make sure that black is printed with just
# the black pen, if the printer supports it
#patch201 -p1 -b .01_rss
2012-02-01 15:16:03 +04:00
2012-08-22 11:04:03 +04:00
# code cleanup related to char signedness
#patch203 -p1 -b .14_charsign
2012-02-01 15:16:03 +04:00
2012-08-22 11:04:03 +04:00
# compiling ui files to py
#patch204 -p1 -b .85_rebuild_python_ui
2012-02-01 15:16:03 +04:00
2012-08-22 11:04:03 +04:00
# Corrections on the models.dat entry for the HP PhotoSmart Pro B9100,
# especially for the correct color calibration mode.
#patch206 -p1 -b .hplip-photosmart_b9100_support
2012-02-01 15:16:03 +04:00
2012-08-22 11:04:03 +04:00
# Fixes Short-edge duplex printing if duplex is PJL-controlled
2012-02-01 15:16:03 +04:00
# https://bugs.launchpad.net/hplip/+bug/244295
#patch207 -p1 -b .hplip-pjl-duplex-binding
2012-02-01 15:16:03 +04:00
2012-08-22 11:04:03 +04:00
# https://bugs.launchpad.net/debian/+source/hplip/+bug/530746
#patch209 -p1 -b .hp-check-groups
2012-02-01 15:16:03 +04:00
#patch210 -p1 -b .plasma
#patch220 -p1 -b .add-lidil-two-cartridge-modes
2012-02-01 15:16:03 +04:00
#patch225 -p1 -b .hpfax-bug-function-used-before-importing-log
2012-02-01 15:16:03 +04:00
#patch226 -p1 -b .hp-systray-make-menu-title-visible-in-sni-qt-indicator
2012-02-01 15:16:03 +04:00
#patch227 -p1 -b .hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde
2012-08-22 11:04:03 +04:00
#patch228 -p1 -b .hpaio-option-duplex
2013-04-15 09:59:51 +04:00
#patch301 -p1
2016-09-26 10:15:09 +03:00
#patch302 -p0
2013-11-26 16:59:00 +04:00
#patch304 -p1
#patch305 -p1
2015-06-17 14:51:26 +03:00
2017-01-27 00:27:54 +10:00
#sed -i.duplex-constraints \
# -e 's,\(UIConstraints.* \*Duplex\),//\1,' \
# prnt/drv/hpcups.drv.in
2013-12-09 21:33:07 +04:00
# Change shebang /usr/bin/env python -> /usr/bin/python (bug #618351).
#find -name '*.py' -print0 | xargs -0 \
# sed -i.env-python -e 's,^#!/usr/bin/env python,#!/usr/bin/python3,'
2012-04-11 18:54:50 +04:00
#sed -i.env-python -e 's,^#!/usr/bin/env python,#!/usr/bin/python3,' \
# fax/filters/pstotiff
2015-06-15 22:14:08 +03:00
2012-02-01 15:16:03 +04:00
# Make all files in the source user-writable
chmod -R u+w .
2015-06-15 22:14:08 +03:00
# compat-libs
rm -rf ../compat-libs
cp -a . ../compat-libs
2012-02-01 15:16:03 +04:00
%build
%serverbuild
2012-08-22 11:04:03 +04:00
#needed by patches 204 and 205
# create required files as placeholder, otherwise autoreconf fails
#touch NEWS README AUTHORS ChangeLog
#autoreconf -ifv
2012-02-01 15:16:03 +04:00
2015-06-15 22:14:08 +03:00
pushd ../compat-libs
2015-06-15 22:22:17 +03:00
# create required files as placeholder, otherwise autoreconf fails
#touch NEWS README AUTHORS ChangeLog
2015-06-15 22:22:17 +03:00
autoreconf -ifv
2016-09-23 10:17:50 +03:00
%configure2_5x PYTHON=/usr/bin/python2
2015-06-15 22:14:08 +03:00
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make libhpmud.la hpmudext.la libhpipp.la cupsext.la pcardext.la scanext.la
popd
2012-02-01 15:16:03 +04:00
%if !%{sane_backend}
WITHOUT_SANE="--without-sane"
%endif
%configure2_5x \
$WITHOUT_SANE \
2012-02-01 15:16:03 +04:00
--disable-foomatic-rip-hplip-install \
--enable-scan-build \
--enable-gui-build \
--enable-fax-build \
--enable-pp-build \
2016-09-26 16:58:08 +03:00
--enable-qt5 --disable-qt4 \
2012-02-01 15:16:03 +04:00
--enable-hpcups-install \
--enable-cups-drv-install \
--enable-cups-ppd-install \
--enable-hpijs-install \
--enable-udev-acl-rules \
2013-12-06 13:37:49 +04:00
--disable-policykit \
2015-06-15 22:14:08 +03:00
--with-mimedir=%{_datadir}/cups/mime \
PYTHON=/usr/bin/python3
2012-02-01 15:16:03 +04:00
#sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
#sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
2012-02-01 15:16:03 +04:00
%make
%install
2015-06-15 22:14:08 +03:00
pushd ../compat-libs
make install-libLTLIBRARIES \
install-hpmudextLTLIBRARIES \
install-cupsextLTLIBRARIES \
install-pcardextLTLIBRARIES \
install-scanextLTLIBRARIES \
DESTDIR=%{buildroot} PYTHON=/usr/bin/python
2015-06-17 14:51:26 +03:00
rm -f %{buildroot}%{py_platsitedir}/*.la
2015-06-15 22:14:08 +03:00
popd
2012-02-01 15:16:03 +04:00
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_initrddir}
mkdir -p %{buildroot}%{_sysconfdir}/hp
2015-06-15 22:14:08 +03:00
%makeinstall_std PYTHON=/usr/bin/python3
2012-02-01 15:16:03 +04:00
# Install files which the "make install" missed to install
install -m 644 ip/hpip.h %{buildroot}%{_includedir}
install -m 644 ip/xform.h %{buildroot}%{_includedir}
# Move doc in sub-package
mv %{buildroot}%{_docdir}/%{name}-%{version}%{extraversion} %{buildroot}%{_docdir}/%{name}-doc-%{version}%{extraversion}
# Remove static libraries of SANE driver
rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.la
rm -f %{buildroot}%{_sysconfdir}/sane.d/dll.conf
mkdir -p %{buildroot}%{_sysconfdir}/sane.d/dll.d
echo 'hpaio' > %{buildroot}%{_sysconfdir}/sane.d/dll.d/hpaio
2012-02-01 15:16:03 +04:00
# Remove other unneeded/unwanted files
2013-12-09 21:33:07 +04:00
# Remove files we don't want to package.
rm -f %{buildroot}%{_datadir}/hplip/hpaio.desc
rm -f %{buildroot}%{_datadir}/hplip/hplip-install
rm -rf %{buildroot}%{_datadir}/hplip/install.*
rm -f %{buildroot}%{_datadir}/hplip/uninstall.*
rm -f %{buildroot}%{_bindir}/hp-uninstall
rm -f %{buildroot}%{_datadir}/hplip/upgrade.*
2013-11-25 18:05:25 +04:00
rm -f %{buildroot}%{_bindir}/hp-upgrade
rm -f %{buildroot}%{_bindir}/hp-config_usb_printer
2013-11-26 16:59:00 +04:00
rm -f %{buildroot}%{_unitdir}/hplip-printer@.service
2013-11-25 18:05:25 +04:00
rm -f %{buildroot}%{_datadir}/hplip/config_usb_printer.*
2013-12-09 21:33:07 +04:00
rm -f %{buildroot}%{_datadir}/hplip/hpijs.drv.in.template
rm -f %{buildroot}%{_datadir}/cups/mime/pstotiff.types
rm -f %{buildroot}%{_datadir}/hplip/fax/pstotiff*
rm -f %{buildroot}%{_cups_serverbin}/filter/hpcac
2015-06-17 14:51:26 +03:00
rm -f %{buildroot}%{py3_platsitedir}/*.la
2015-06-15 22:14:08 +03:00
2012-02-01 15:16:03 +04:00
mkdir -p %{buildroot}%{_datadir}/applications
2012-02-01 15:16:03 +04:00
desktop-file-install --vendor='' \
--dir=%{buildroot}%{_datadir}/applications \
--remove-category='Application' \
--remove-category='Utility' \
--add-category='System' \
--add-category='Settings' \
--add-category='Printing' \
--add-category='Qt' \
--add-category='HardwareSettings' \
2012-02-01 15:16:03 +04:00
--remove-key='Version' \
%{buildroot}%{_datadir}/applications/hplip.desktop
2012-02-01 15:16:03 +04:00
2013-12-05 10:56:22 +04:00
# Create /run/hplip
mkdir -p %{buildroot}/run/hplip
# install /usr/lib/tmpfiles.d/hplip.conf (bug #1015831)
mkdir -p %{buildroot}%{_tmpfilesdir}
cat > %{buildroot}%{_tmpfilesdir}/hplip.conf <<EOF
# See tmpfiles.d(5) for details
d /run/hplip 0775 root lp -
EOF
# install menu icons
for N in 16 32 48 64; do convert %{SOURCE3} -resize ${N}x${N} $N.png; done
install -D -m 0644 16.png %{buildroot}%{_iconsdir}/hicolor/16x16/apps/hp-sendfax.png
install -D -m 0644 32.png %{buildroot}%{_iconsdir}/hicolor/32x32/apps/hp-sendfax.png
install -D -m 0644 48.png %{buildroot}%{_iconsdir}/hicolor/48x48/apps/hp-sendfax.png
install -D -m 0644 64.png %{buildroot}%{_iconsdir}/hicolor/64x64/apps/hp-sendfax.png
install -D -m 0644 %{SOURCE3} %{buildroot}%{_iconsdir}/hicolor/128x128/apps/hp-sendfax.png
for N in 16 32 64 128 256;
do
install -D -m 0644 %{buildroot}%{_datadir}/hplip/data/images/${N}x${N}/hp_logo.png \
%{buildroot}%{_iconsdir}/hicolor/${N}x${N}/apps/hp_logo.png
done
2013-11-26 16:59:00 +04:00
# (cg) Correct the udev rules dir
mkdir -p %{buildroot}/lib
mv %{buildroot}%{_sysconfdir}/udev %{buildroot}/lib/
2012-02-01 15:16:03 +04:00
# Regenerate hpcups PPDs on upgrade if necessary (bug #579355).
install -p -m755 %{SOURCE1} %{buildroot}%{_bindir}/hpcups-update-ppds
2013-11-25 18:39:05 +04:00
# A tool disable smart install feature in HP printer(s) from linux
# HP Smart Install is a service running on firmware which makes printer to appear
# as "Mass Storage Devices" when connected via USB cable. This is to install the
# minimal printer software from flash memory of printer. This service needs to be
# disabled on linux in order to have the device function as a printer.
install -p -m755 %{SOURCE5} %{buildroot}%{_bindir}/SmartInstallDisable-Tool.run
mkdir -p %{buildroot}%{_docdir}/%{name}
install -p -m755 %{SOURCE6} %{buildroot}%{_docdir}/%{name}
2012-02-01 15:16:03 +04:00
# Make sure pyc files are generated, otherwise we can get
# difficult to debug problems
pushd %{buildroot}%{_datadir}/%{name}
2015-06-15 18:00:32 +03:00
python3 -m compileall .
2012-02-01 15:16:03 +04:00
popd
2013-12-06 13:37:49 +04:00
# create empty /var/lib/hp/hplip.state to fix hp-plugin installation (mga#5395)
mkdir -p %{buildroot}%{_localstatedir}/lib/hp/
touch %{buildroot}%{_localstatedir}/lib/hp/hplip.state
2013-12-06 13:37:49 +04:00
# Create an empty plugins directory to make sure it gets the right
2013-12-09 21:33:07 +04:00
mkdir -p %{buildroot}%{_datadir}/hplip/prnt/plugins
2013-12-06 13:37:49 +04:00
2013-11-26 16:59:00 +04:00
# create empty log directory so that it can be owned
mkdir -p %{buildroot}%{_localstatedir}/log/hp/tmp
2013-11-25 18:57:56 +04:00
mkdir -p %{buildroot}%{_unitdir}
mv -f %{buildroot}/usr/lib/systemd/system/hplip-printer@.service %{buildroot}%{_unitdir}/hplip-printer@.service
2013-12-09 21:33:07 +04:00
# Images in docdir should not be executable (bug #440552).
find doc/images -type f -exec chmod 644 {} \;
2013-12-09 22:36:47 +04:00
#We do not need hal
rm -f %{buildroot}%{_datadir}/hal/fdi/preprobe/10osvendor/20-hplip-devices.fdi
2013-12-09 21:33:07 +04:00
#Add rules for all hp printers
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", GROUP="lp", MODE:="666"' >> %{buildroot}/lib/udev/rules.d/56-hpmud.rules
# consolehelper config
#
2013-12-12 09:44:25 +04:00
mkdir -p %{buildroot}%{_sbindir}
# - console user, no password
for pak in hp-setup hp-diagnose_plugin; do
mv %{buildroot}%{_bindir}/$pak %{buildroot}%{_sbindir}/$pak
ln -sf %{_bindir}/consolehelper %{buildroot}%{_bindir}/$pak
mkdir -p %{buildroot}%{_sysconfdir}/security/console.apps/
cat > %{buildroot}%{_sysconfdir}/security/console.apps/$pak <<EOF
USER=root
PROGRAM=%{_sbindir}/$pak
FALLBACK=false
SESSION=true
EOF
mkdir -p %{buildroot}%{_sysconfdir}/pam.d/
cat > %{buildroot}%{_sysconfdir}/pam.d/$pak <<EOF
#%PAM-1.0
auth include config-util-user
account include config-util-user
session include config-util-user
EOF
done
%post
2014-06-24 15:13:53 +04:00
%tmpfiles_create %{name}.conf
2012-02-01 15:16:03 +04:00
%post -n hplip-hpijs
%{_bindir}/hpcups-update-ppds &>/dev/null ||:
%post -n hplip-model-data
/sbin/udevadm trigger --subsystem-match=usb --attr-match=idVendor=03f0
2012-08-22 11:04:03 +04:00
# ensure permissions are ready when installation completes
/sbin/udevadm settle --timeout=15
:
2012-02-01 15:16:03 +04:00
%files
%config(noreplace) %{_sysconfdir}/hp
%dir %{_localstatedir}/lib/hp/
2012-02-01 15:16:03 +04:00
%{_bindir}/hp-align
%{_bindir}/hp-clean
%{_bindir}/hp-colorcal
%{_bindir}/hp-devicesettings
2012-08-22 11:04:03 +04:00
%{_bindir}/hp-diagnose_plugin
%{_bindir}/hp-diagnose_queues
%{_bindir}/hp-doctor
%{_datadir}/hplip/doctor.py*
2012-02-01 15:16:03 +04:00
%{_bindir}/hp-fab
%{_bindir}/hp-faxsetup
%{_bindir}/hp-firmware
%{_bindir}/hp-info
%{_bindir}/hp-levels
%{_bindir}/hp-linefeedcal
2012-09-13 04:19:03 +00:00
%{_bindir}/hp-logcapture
2012-02-01 15:16:03 +04:00
%{_bindir}/hp-makecopies
%{_bindir}/hp-makeuri
%{_bindir}/hp-pkservice
%{_bindir}/hp-plugin
%{_bindir}/hp-pqdiag
%{_bindir}/hp-printsettings
%{_bindir}/hp-probe
%{_bindir}/hp-query
%{_bindir}/hp-scan
%{_bindir}/hp-sendfax
%{_bindir}/hp-setup
%{_bindir}/hp-testpage
%{_bindir}/hp-timedate
%{_bindir}/hp-unload
%{_bindir}/hp-wificonfig
2013-11-25 18:57:56 +04:00
%{_sbindir}/hp-diagnose_plugin
%{_sbindir}/hp-setup
2013-12-12 10:14:22 +04:00
%{_sysconfdir}/pam.d/hp-diagnose_plugin
%{_sysconfdir}/pam.d/hp-setup
%{_sysconfdir}/security/console.apps/hp-diagnose_plugin
%{_sysconfdir}/security/console.apps/hp-setup
2013-12-12 10:01:06 +04:00
2013-11-25 18:57:56 +04:00
# A tool to disable Smart Install
%{_bindir}/SmartInstallDisable-Tool.run
2013-09-06 10:25:06 +04:00
2012-02-01 15:16:03 +04:00
%exclude %{_datadir}/hplip/data/models
# C libraries for Python
2015-06-17 14:51:26 +03:00
%{_libdir}/python3*/*/*.so*
2012-02-01 15:16:03 +04:00
# CUPS backends (0755 permissions, so that CUPS 1.2 runs these backends
# as lp user)
2017-01-27 00:27:54 +10:00
# Note: this must be /usr/lib not _{_libdir}, since that's the
2012-02-01 15:16:03 +04:00
# CUPS serverbin directory.
%attr(0755,root,root) %{_prefix}/lib/cups/backend/hp*
%{_prefix}/lib/cups/filter/hpcups
%{_prefix}/lib/cups/filter/hpcupsfax
2012-08-22 11:04:03 +04:00
%{_prefix}/lib/cups/filter/hpps
2012-02-01 15:16:03 +04:00
%{_prefix}/lib/cups/filter/pstotiff
%{_datadir}/ppd/HP/HP-Fax*.ppd*
%{_datadir}/cups/drv/hp/hpcups.drv
# Files
%dir %{_datadir}/hplip
2015-06-17 14:51:26 +03:00
%{_datadir}/hplip/__pycache__
2012-02-01 15:16:03 +04:00
%{_datadir}/hplip/align.py*
2012-08-22 11:04:03 +04:00
%{_datadir}/hplip/check-plugin.py*
2012-02-01 15:16:03 +04:00
%{_datadir}/hplip/clean.py*
%{_datadir}/hplip/colorcal.py*
2013-11-26 16:59:00 +04:00
#{_datadir}/hplip/config_usb_printer.py*
2012-02-01 15:16:03 +04:00
%{_datadir}/hplip/devicesettings.py*
2012-08-22 11:04:03 +04:00
%{_datadir}/hplip/diagnose_plugin.py*
%{_datadir}/hplip/diagnose_queues.py*
2012-02-01 15:16:03 +04:00
%{_datadir}/hplip/fab.py*
%{_datadir}/hplip/fax
%{_datadir}/hplip/faxsetup.py*
%{_datadir}/hplip/firmware.py*
%{_datadir}/hplip/hpdio.py*
%{_datadir}/hplip/hpssd*
%{_datadir}/hplip/info.py*
%{_datadir}/hplip/__init__.py*
%{_datadir}/hplip/levels.py*
%{_datadir}/hplip/linefeedcal.py*
2012-09-13 04:19:03 +00:00
%{_datadir}/hplip/logcapture.py*
2012-02-01 15:16:03 +04:00
%{_datadir}/hplip/makecopies.py*
%{_datadir}/hplip/makeuri.py*
%{_datadir}/hplip/pkservice.py*
%{_datadir}/hplip/plugin.py*
%{_datadir}/hplip/pqdiag.py*
%{_datadir}/hplip/printsettings.py*
%{_datadir}/hplip/probe.py*
%{_datadir}/hplip/query.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*
%{_datadir}/hplip/wificonfig.py*
# Directories
%{_datadir}/hplip/base
%{_datadir}/hplip/copier
%dir %{_datadir}/hplip/data
%{_datadir}/hplip/data/ldl
%{_datadir}/hplip/data/localization
%{_datadir}/hplip/data/models
%{_datadir}/hplip/data/pcl
%{_datadir}/hplip/data/ps
%{_datadir}/hplip/installer
%{_datadir}/hplip/pcard
%{_datadir}/hplip/prnt
%{_datadir}/hplip/scan
2013-12-06 13:37:49 +04:00
#{_datadir}/polkit-1/actions/com.hp.hplip.policy
#{_datadir}/dbus-1/system-services/com.hp.hplip.service
%{_localstatedir}/lib/hp/hplip.state
2013-11-25 18:39:05 +04:00
%{_docdir}/%{name}/README.urpmi
2013-12-05 10:56:22 +04:00
%dir %attr(0775,root,lp) /run/hplip
%{_tmpfilesdir}/hplip.conf
2013-11-25 18:57:56 +04:00
%{_unitdir}/hplip-printer@.service
%{_datadir}/hplip/hplip_clean.sh
2013-12-06 13:37:49 +04:00
%{_datadir}/cups/mime/pstotiff.convs
2012-02-01 15:16:03 +04:00
%files doc
%doc %{_docdir}/%{name}-doc-%{version}%{extraversion}
2016-04-03 18:51:59 +03:00
%files -n %{libhpdiscovery}
%{_libdir}/libhpdiscovery.so.%{major}*
%files -n %{libhpip}
%{_libdir}/libhpip.so.%{major}*
2015-06-17 14:51:26 +03:00
%files -n %{libhpipp}
%{_libdir}/libhpipp.so.%{major}*
%files -n %{libhpmud}
%{_libdir}/libhpmud.so.%{major}*
2012-02-01 15:16:03 +04:00
%files -n %{devname}
2012-02-01 15:16:03 +04:00
%{_includedir}/hpip.h
%{_includedir}/xform.h
%{_libdir}/libhpip.so
2015-06-17 14:51:26 +03:00
%{_libdir}/libhpipp.so
2012-02-01 15:16:03 +04:00
%{_libdir}/libhpmud.so
2016-04-03 18:51:59 +03:00
%{_libdir}/libhpdiscovery.so
2012-02-01 15:16:03 +04:00
%if %{sane_backend}
%{_libdir}/sane/libsane-hpaio.so
%endif
%if %{sane_backend}
%files -n %{libsane}
%{_libdir}/sane/libsane-hpaio.so.%{sanemaj}*
# Not really a shared library package so it's OK to have config here
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
2012-02-01 15:16:03 +04:00
%endif
2015-06-15 22:14:08 +03:00
%files compat-libs
# Python extensions
2015-06-17 14:51:26 +03:00
%{py_platsitedir}/*.so
2015-06-15 22:14:08 +03:00
2012-02-01 15:16:03 +04:00
%files model-data
%{_udevrulesdir}/*.rules
2012-02-01 15:16:03 +04:00
%{_datadir}/hplip/data/models
%files gui
%{_bindir}/hp-check
%{_bindir}/hp-print
%{_bindir}/hp-systray
%{_bindir}/hp-toolbox
%{_datadir}/applications/*.desktop
%{_iconsdir}/hicolor/*/apps/hp-sendfax.png
%{_iconsdir}/hicolor/*/apps/hp_logo.png
2013-12-12 18:10:39 +04:00
%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
2012-02-01 15:16:03 +04:00
# Files
%{_datadir}/hplip/check.py*
%{_datadir}/hplip/print.py*
%{_datadir}/hplip/systray.py*
%{_datadir}/hplip/toolbox.py*
# Directories
%{_datadir}/hplip/data/images
2016-09-26 16:58:08 +03:00
%{_datadir}/hplip/ui5
2012-02-01 15:16:03 +04:00
%files hpijs
%{_bindir}/hpijs
# Needed for both printing and fax PPDs. They all need HPIJS, therefore
# the link is here
%dir %{_datadir}/ppd
%dir %{_datadir}/ppd/HP
2013-11-26 16:59:00 +04:00
#{_datadir}/cups/drv/hp/hpijs.drv
2012-02-01 15:16:03 +04:00
%{_bindir}/hpcups-update-ppds
%files hpijs-ppds
%{_datadir}/ppd/HP/apollo*.ppd*
%{_datadir}/ppd/HP/hp-*.ppd*