1 # Define if you want to build the sane backend (default)
3 %{?_with_sane: %global sane_backend 1}
4 %{?_without_sane: %global sane_backend 0}
7 %define hpip_libname %mklibname hpip %{hpip_major}
9 %define sane_hpaio_major 1
10 %define sane_hpaio_libname %mklibname sane-hpaio %{sane_hpaio_major}
12 # Suppress automatically generated Requires for devel packages
13 %define _requires_exceptions devel\(.*\)
17 Summary: HP Linux Imaging and Printing Project
21 License: GPLv2+ and MIT
22 Group: System Environment/Daemons
23 Source: %{name}-%{version}.tar.gz
25 # taken from http://patch-tracker.debian.org/package/hplip/3.11.7-1
27 Patch2: 10_shebang_fixes.dpatch
28 Patch3: 14_charsign_fixes.dpatch
29 Patch4: 85_rebuild_python_ui.dpatch
30 Patch5: 87_move_documentation.dpatch
31 Patch6: hp_photosmart_pro_b9100_support.dpatch
32 Patch7: pjl-duplex-binding.dpatch
33 Patch8: kde4-kdesudo-support.dpatch
34 Patch9: hp-check-groups.dpatch
35 Patch10: hp-check_debian.dpatch
36 Patch11: hp-setup-prompt-for-custom-PPD.dpatch
37 Patch12: hplip-systray-longer-timeout-for-system-tray-start.dpatch
39 Patch14: udev-rules-use-attrs-not-sysfs-and-hp-mkuri-call-fix.dpatch
40 Patch15: hp-mkuri-take-into-account-already-installed-plugin-also-for-exit-value.dpatch
41 Patch16: ubuntu-hp-mkuri-notification-text.dpatch
42 Patch17: simple-scan-as-default.dpatch
43 Patch18: make-commafy-correctly-work-with-python-2.dpatch
44 Patch19: remove-duplicate-entry-for-cp1700-in-drv-files.dpatch
45 Patch20: black-stripes-on-pcl5c-printouts.dpatch
46 Patch21: try_libhpmud.so.0.dpatch
47 Patch22: add-lidil-two-cartridge-modes.dpatch
48 Patch23: add_missing_newline_for_error_log.dpatch
49 Patch24: CVE-2010-4267.dpatch
50 Patch25: large-sizes-borderless-on-photosmart-pro-b-series.dpatch
51 Patch26: more-user-friendly-choice-names-for-installed-cartridges.dpatch
52 Patch27: hplip-syslog-fix-debug-messages-to-error.dpatch
53 Patch28: cups-1.5.0-compatibility.dpatch
54 Patch29: mdns-py-network-printer-search-key-error.dpatch
55 Patch30: mdns-py-typo.dpatch
56 Patch31: hpfax-bug-function-used-before-importing-log.dpatch
57 Patch32: hp-systray-make-menu-title-visible-in-sni-qt-indicator.dpatch
58 Patch33: hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde.dpatch
59 Patch34: hpcups-top-margins-not-respected.dpatch
61 BuildRoot: %{_tmppath}/%{name}-%{version}-build
63 #BuildRequires: python-sip >= 4.1.1
64 #BuildRequires: net-snmp-devel
66 #hplip should use libusb-compat-devel not libusb-devel
67 BuildRequires: pkgconfig(libusb)
68 #BuildRequires: imagemagick
69 BuildRequires: autoconf
70 BuildRequires: cups-devel
71 BuildRequires: libjpeg-devel
72 #BuildRequires: python-devel
73 #BuildRequires: desktop-file-utils
74 #BuildRequires: libdbus-devel
75 #BuildRequires: udev-devel
76 #BuildRequires: polkit
77 #BuildRequires: gphoto2-devel
78 #BuildRequires: libv4l-devel
80 # For dynamic ppd generation.
81 #Requires: cupsddk-drivers >= 1.2.3-2mdv
82 #Requires: foomatic-filters
83 #Requires: hplip-model-data
84 #Requires: hplip-hpijs
85 #Requires: hplip-hpijs-ppds
86 #Requires: python-sip >= 4.1.1
87 # Needed for communicating with ethernet-connected printers
88 #Requires: net-snmp-mibs
89 # Needed to generate fax cover pages
90 #Requires: python-reportlab
91 # Needed since 2.8.4 for IPC
92 #Requires: python-dbus
93 #Requires: polkit-agent
94 #Requires: usermode-consoleonly
95 #Requires: python-gobject
96 # Required by hp-scan for command line scanning
97 #Requires: python-imaging
98 #Requires: sane-backends-hpaio
99 # Needed to avoid misleading errors about network connectivity (RH bug #705843)
101 # Some HP ppds are in foomatic-db and foomatic-db-hpijs (mdv bug #47415)
103 # foomatic-db-hpijs drivers are provided by hp and by this package now
104 # NOTE: remove the foomatic-db-hpijs deps sometime in 2010-10-?? ?
105 Provides: foomatic-db-hpijs = %{version}-%{release}
106 Obsoletes: foomatic-db-hpijs
110 This is the HP driver package to supply Linux support for most
111 Hewlett-Packard DeskJet, LaserJet, PSC, OfficeJet, and PhotoSmart
112 printers and all-in-one peripherals (also known as Multi-Function
113 Peripherals or MFPs), which can print, scan, copy, fax, and/or access
116 It is work in progress, but printing, scanning, memory card access,
117 ink/toner/battery/consumable level checking, and inkjet printer
118 maintenance are supported on most models, when either connected to the
119 USB or LAN (built-in interfaces or selected HP JetDirect models) on a
120 Linux workstation with CUPS printing system.
122 For status and consumable checking and also for inkjet maintenance
123 there is the graphical tool "hp-toolbox" available (Menu:
124 "System"/"Monitoring"/"HP Printer Toolbox").
127 #Summary: Dynamic library for the "hplip" HP printer/all-in-one drivers
128 #Group: System/Printing
131 #Library needed for the "hplip" HP printer/all-in-one drivers
134 Summary: Headers and links to compile against the "lib" ("hplip") library
136 #Requires: libs >= %{version}-%{release}
137 Provides: devel = %{version}-%{release}
140 This package contains all files which one needs to compile programs using
144 #Summary: Data file listing the HP printer models supported by HPLIP
145 #Group: System/Printing
147 #%description model-data
148 #HPLIP supports most current HP printers and multifunction devices, but
149 #there are some older models not supported. This package contains the
150 #list of supported models. Printerdrake installs it automatically to
151 #determine whether HPLIP has to be installed or not.
154 #Summary: Documentation for HPLIP
155 #Group: System/Printing
158 #This package contains documentation for the HPLIP driver.
159 #This is the HP driver package to supply Linux support for most
160 #Hewlett-Packard DeskJet, LaserJet, PSC, OfficeJet, and PhotoSmart
161 #printers and all-in-one peripherals (also known as Multi-Function
162 #Peripherals or MFPs), which can print, scan, copy, fax, and/or access
203 # Make all files in the source user-writable
205 touch NEWS README AUTHORS ChangeLog
206 chmod +x debian/autogen.sh
207 echo "Running autoreconf..."
208 autoreconf --force --install
212 %configure HPLIP_PPD_PATH=/opt/etc/cups/ppd \
214 --disable-dependency-tracking \
216 --mandir=\$${prefix}/share/man \
217 --infodir=\$${prefix}/share/info \
218 --docdir=\$${prefix}/share/doc/hplip \
219 --with-docdir=\$${prefix}/share/doc/hplip \
220 --disable-foomatic-drv-install \
221 --disable-foomatic-ppd-install \
222 --disable-foomatic-rip-hplip-install \
223 --with-drvdir=\$${prefix}/share/cups/drv \
224 --with-hpppddir=\$${prefix}/share/ppd/hplip/HP \
225 --datadir=\$${prefix}/share \
226 --libexecdir=\$${prefix}/lib \
227 --localstatedir=/var \
228 --sysconfdir=/opt/etc \
230 --disable-hpijs-only-build \
231 --enable-hpcups-only-build \
232 --enable-hpcups-install \
233 --enable-new-hpcups \
234 --disable-network-build \
236 --disable-scan-build \
237 --disable-gui-build \
238 --disable-fax-build \
239 --disable-dbus-build \
240 --disable-cups11-build \
241 --disable-udev-acl-rules \
242 --enable-cups-drv-install \
243 --enable-cups-ppd-install \
248 #sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
249 #sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
254 mkdir -p %{buildroot}%{_bindir}
255 mkdir -p %{buildroot}%{_includedir}
256 mkdir -p %{buildroot}%{_initrddir}
257 mkdir -p %{buildroot}%{_sysconfdir}/hp
258 mkdir -p %{buildroot}/opt/var/run/hplip
260 # Do not use the macro here, use the standard DESTDIR method as it works
261 # with HPLIP, in contrary to the non-standard Mandriva method
262 #make test-destdir DESTDIR=%{buildroot}
263 make install DESTDIR=%{buildroot}
265 # Install files which the "make install" missed to install
266 install -m 644 ip/hpip.h %{buildroot}%{_includedir}
267 install -m 644 ip/xform.h %{buildroot}%{_includedir}
269 # Move doc in sub-package
270 #mv %{buildroot}%{_docdir}/%{name}-%{version} %{buildroot}%{_docdir}/%{name}-doc-%{version}
272 # Remove static libraries of SANE driver
273 rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.so
274 rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.la
275 rm -f %{buildroot}%{_sysconfdir}/sane.d/dll.conf
277 # Remove other unneeded files
278 rm -f %{buildroot}%{py_platsitedir}/*.la
280 #mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
281 #desktop-file-install --vendor='' \
282 # --dir=%{buildroot}%{_datadir}/applications \
283 # --remove-category='Application' \
284 # --remove-category='Utility' \
285 # --add-category='System' \
286 # --add-category='Settings' \
287 # --add-category='Printing' \
288 # --add-category='Qt' \
289 # --add-category='HardwareSettings' \
290 # --add-category='X-MandrivaLinux-CrossDesktop' \
291 # --remove-key='Version' \
292 # %{buildroot}%{_datadir}/applications/hplip.desktop
294 #cat > $RPM_BUILD_ROOT%{_datadir}/applications/%{_real_vendor}-hp-sendfax.desktop << EOF
297 #Comment=Utility for sending faxes with HP's multi-function devices
298 #Exec=%{_bindir}/hp-sendfax
299 #Icon=%{_datadir}/%{name}/data/images/32x32/fax_machine.png
302 #Categories=TelephonyTools;Qt;Printing;Utility;X-MandrivaLinux-CrossDesktop;
304 #' #Fix vim's stupid syntax
306 # The systray applet doesn't work properly (displays icon as a
307 # window), so don't ship the launcher yet.
308 rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
311 # switched to udev, no need for hal information
312 rm -rf %{buildroot}%{_datadir}/hal/fdi
314 rm -f %{buildroot}%{_libdir}/*.la \
315 %{buildroot}%{python_sitearch}/*.la \
316 %{buildroot}%{_libdir}/sane/*.la
318 # Regenerate hpcups PPDs on upgrade if necessary (bug #579355).
319 #install -p -m755 %{SOURCE1} %{buildroot}%{_bindir}/hpcups-update-ppds
322 #rm -f %{buildroot}%{_sysconfdir}/cups/pstotiff.types
323 #rm -f %{buildroot}%{_datadir}/cups/mime/pstotiff.types
324 #rm -f %{buildroot}%{_datadir}/hplip/fax/pstotiff*
325 #rm -f %{buildroot}%{_prefix}/lib/cups/filter/hpcac
328 install -d %{buildroot}%{_sysconfdir}/cups
329 #cp -p %{buildroot}%{_datadir}/cups/mime/pstotiff.convs %{buildroot}%{_sysconfdir}/cups/pstotiff.convs
331 # set up consolehelper
332 #mkdir -p %{buildroot}%{_sbindir}
333 #mv %{buildroot}%{_bindir}/hp-setup %{buildroot}%{_sbindir}/hp-setup
334 #ln -s consolehelper %{buildroot}%{_bindir}/hp-setup
336 # Make sure pyc files are generated, otherwise we can get
337 # difficult to debug problems
338 #pushd %{buildroot}%{_datadir}/%{name}
339 #python -m compileall .
342 %triggerin -- hplip < 2.7.7
343 chkconfig --del hplip
345 # Restart CUPS to make the Fax PPD known to it
346 #if [ -f /etc/init.d/cups ]; then
347 # /sbin/service cups condrestart || :
350 #%post -n hplip-model-data
351 #/sbin/udevadm trigger --subsystem-match=usb --attr-match=idVendor=03f0
353 # Restart CUPS to make the removal of the Fax PPD known to it
354 #if [ -f /etc/init.d/cups ]; then
355 # /sbin/service cups condrestart || :
362 #%manifest hplip.manifest
363 %defattr(-,root,root)
365 #%config(noreplace) %{_sysconfdir}/hp
366 #%dir /opt/var/run/hplip/
369 #%{_bindir}/hp-colorcal
370 #%{_bindir}/hp-devicesettings
372 #%{_bindir}/hp-faxsetup
373 #%{_bindir}/hp-firmware
375 #%{_bindir}/hp-levels
376 #%{_bindir}/hp-linefeedcal
377 #%{_bindir}/hp-makecopies
378 #%{_bindir}/hp-makeuri
380 #%{_bindir}/hp-pkservice
381 #%{_bindir}/hp-plugin
382 #%{_bindir}/hp-pqdiag
383 #%{_bindir}/hp-printsettings
387 #%{_bindir}/hp-sendfax
389 #%{_sbindir}/hp-setup
390 #%{_bindir}/hp-testpage
391 #%{_bindir}/hp-timedate
392 #%{_bindir}/hp-unload
393 #%{_bindir}/hp-wificonfig
395 #%exclude %{_datadir}/hplip/data/models
396 # C libraries for Python
397 #%{_libdir}/python*/*/*.so*
398 # CUPS backends (0755 permissions, so that CUPS 1.2 runs these backends
400 # Note: this must be /usr/lib not %{_libdir}, since that's the
401 # CUPS serverbin directory.
402 #%attr(0755,root,root) %{_prefix}/lib/cups/backend/hp*
403 #%{_prefix}/lib/cups/filter/hplipjs
404 %{_prefix}/lib/cups/filter/hpcups
405 #%{_prefix}/lib/cups/filter/hpcupsfax
406 #%{_prefix}/lib/cups/filter/hpps
407 #%{_prefix}/lib/cups/filter/pstotiff
408 #%{_datadir}/cups/mime/pstotiff.convs
409 #%config(noreplace) %{_sysconfdir}/cups/pstotiff.convs
410 #%{_datadir}/ppd/HP/HP-Fax*.ppd*
411 #%{_datadir}/cups/drv/hp/hpcups.drv
413 #%dir %{_datadir}/hplip
414 #%{_datadir}/hplip/align.py*
415 #%{_datadir}/hplip/clean.py*
416 #%{_datadir}/hplip/colorcal.py*
417 #%{_datadir}/hplip/devicesettings.py*
418 #%{_datadir}/hplip/fab.py*
419 #%{_datadir}/hplip/fax
420 #%{_datadir}/hplip/faxsetup.py*
421 #%{_datadir}/hplip/firmware.py*
422 #%{_datadir}/hplip/hpdio.py*
423 #%{_datadir}/hplip/hpssd*
424 #%{_datadir}/hplip/info.py*
425 #%{_datadir}/hplip/__init__.py*
426 #%{_datadir}/hplip/levels.py*
427 #%{_datadir}/hplip/linefeedcal.py*
428 #%{_datadir}/hplip/makecopies.py*
429 #%{_datadir}/hplip/makeuri.py*
430 #%{_datadir}/hplip/pkservice.py*
431 #%{_datadir}/hplip/plugin.py*
432 #%{_datadir}/hplip/pqdiag.py*
433 #%{_datadir}/hplip/printsettings.py*
434 #%{_datadir}/hplip/probe.py*
435 #%{_datadir}/hplip/query.py*
436 #%{_datadir}/hplip/scan.py*
437 #%{_datadir}/hplip/sendfax.py*
438 #%{_datadir}/hplip/setup.py*
439 #%{_datadir}/hplip/testpage.py*
440 #%{_datadir}/hplip/timedate.py*
441 #%{_datadir}/hplip/unload.py*
442 #%{_datadir}/hplip/wificonfig.py*
444 #%{_datadir}/hplip/base
445 #%{_datadir}/hplip/copier
446 #%dir %{_datadir}/hplip/data
447 #%{_datadir}/hplip/data/ldl
448 #%{_datadir}/hplip/data/localization
449 #%{_datadir}/hplip/data/models
450 #%{_datadir}/hplip/data/pcl
451 #%{_datadir}/hplip/data/ps
452 #%{_datadir}/hplip/installer
453 #%{_datadir}/hplip/pcard
454 #%{_datadir}/hplip/prnt
455 #%{_datadir}/hplip/scan
456 #%{_datadir}/polkit-1/actions/com.hp.hplip.policy
457 #%{_datadir}/dbus-1/system-services/com.hp.hplip.service
458 #%{_localstatedir}/lib/hp/hplip.state
459 #%config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.hp.hplip.conf
462 #%defattr(-,root,root)
463 #%doc %{_docdir}/%{name}-doc-%{version}
466 #%defattr(-,root,root)
467 #%{_libdir}/libhpip*.so.*
468 #%{_libdir}/libhpmud.so.*
471 %defattr(-,root,root)
472 %{_includedir}/hpip.h
473 %{_includedir}/xform.h
474 #%{_libdir}/libhpip*.so
475 #%{_libdir}/libhpmud.so
478 #%defattr(-,root,root)
479 #%{_sysconfdir}/udev/rules.d/*.rules
480 #%{_datadir}/hplip/data/models