From 74c1a36c8266d99e2c921742ef9646dcb1c4d8db8e09776fdc5d097b5117a702 Mon Sep 17 00:00:00 2001 From: Johannes Meixner Date: Thu, 16 Oct 2014 15:24:13 +0000 Subject: [PATCH] Accepting request 256945 from home:jsmeix:branches:Printing - Make and install Python compiled bytecode files (.pyc compiled python and .pyo optimized compiled python) because normal users do not have write permissions to the install location /usr/share/hplip/ so that for normal users Python would recompile the sources every time, see https://en.opensuse.org/openSUSE:Packaging_Python - Hardlink .pyc and .pyo when they have same content but do not run "fdupes buildroot/_datadir/hplip" because fdupes will link any files with same content there which can have unexpected side-effects (cf. bnc#784670). - Removed RPM preun script that had deleted leftover .pyc and .pyo files if made during run-time (see the entry below dated Fri Feb 16 11:52:28 CET 2007) because now those files are provided in the package. - Removed trailing whitespaces in RPM changelog file. OBS-URL: https://build.opensuse.org/request/show/256945 OBS-URL: https://build.opensuse.org/package/show/Printing/hplip?expand=0&rev=101 --- hplip.changes | 53 ++++++++++++++++++++++++++++++++++----------------- hplip.spec | 37 ++++++++++++++++++++++------------- 2 files changed, 60 insertions(+), 30 deletions(-) diff --git a/hplip.changes b/hplip.changes index f1f8bb2..58c04ac 100644 --- a/hplip.changes +++ b/hplip.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Thu Oct 16 15:37:28 CEST 2014 - jsmeix@suse.de + +- Make and install Python compiled bytecode files + (.pyc compiled python and .pyo optimized compiled python) + because normal users do not have write permissions to the + install location /usr/share/hplip/ so that for normal users + Python would recompile the sources every time, + see https://en.opensuse.org/openSUSE:Packaging_Python +- Hardlink .pyc and .pyo when they have same content but + do not run "fdupes buildroot/_datadir/hplip" because + fdupes will link any files with same content there + which can have unexpected side-effects (cf. bnc#784670). +- Removed RPM preun script that had deleted leftover .pyc + and .pyo files if made during run-time (see the entry below + dated Fri Feb 16 11:52:28 CET 2007) because now those files + are provided in the package. +- Removed trailing whitespaces in RPM changelog file. + ------------------------------------------------------------------- Thu Sep 18 10:31:14 CEST 2014 - jsmeix@suse.de @@ -397,7 +416,7 @@ Fri Sep 28 12:42:33 UTC 2012 - mmeister@suse.com HP's upstream fix is insufficient (not 64-bit safe), see https://bugs.launchpad.net/hplip/+bug/1017496 - Adapted no-chgrp_lp_hplip_Logdir.diff so that it - applies to the HPLIP 3.12.9 sources. + applies to the HPLIP 3.12.9 sources. ------------------------------------------------------------------ Fri Sep 28 08:20:55 UTC 2012 - mmeister@suse.com @@ -782,7 +801,7 @@ Thu Aug 6 10:48:36 CEST 2009 - jsmeix@suse.de Enabled mDNS as the default network search mechanism. Added front-end support for mDNS/Bonjour in setup. Added hpmud support for mDNS. - The tar ball provides a init-suse-firewall init script + The tar ball provides a init-suse-firewall init script for mDNS support which is not included in the RPM. Fixed wificonfig associate issue when called from hp-setup. Added 40-hplip.rules to the tar ball for distros with @@ -834,7 +853,7 @@ Tue Jun 2 14:46:19 CEST 2009 - jsmeix@suse.de "invalid conversion from 'const char*' to 'char*'" errors. The upstream bug report is https://bugs.launchpad.net/hplip/+bug/382720 - + ------------------------------------------------------------------- Tue May 5 14:54:42 CEST 2009 - jsmeix@suse.de @@ -884,7 +903,7 @@ Tue May 5 14:54:42 CEST 2009 - jsmeix@suse.de Many more supported printers and all-in-one devices. Several bug fixes (no Suse bugs). For details see - http://hplipopensource.com/hplip-web/release_notes.html + http://hplipopensource.com/hplip-web/release_notes.html - Updated to version 2.8.9: Added Qt4 configure option but Qt3 is the default. Many bug fixes (no Suse bugs). @@ -966,8 +985,8 @@ Tue Sep 9 14:33:28 CEST 2008 - jsmeix@suse.de - The configure option disable-foomatic-xml-install does no longer exist. - Updated to version 2.8.7: - Some bug fixes (no Suse bugs). - Some more supported printers. + Some bug fixes (no Suse bugs). + Some more supported printers. For details see release_notes.html - Updated to version 2.8.6b: Replaced the doc directory with an abbreviated web document @@ -978,7 +997,7 @@ Tue Sep 9 14:33:28 CEST 2008 - jsmeix@suse.de Changed the hpijs.drv to support multiple products via multiple "Product" entries in the PPD but see https://bugs.launchpad.net/hplip/+bug/235148 - Several bug fixes (no Suse bugs). + Several bug fixes (no Suse bugs). Many more supported printers. For details see release_notes.html - Updated to version 2.8.5: @@ -1060,7 +1079,7 @@ Thu Apr 3 15:59:09 CEST 2008 - jsmeix@suse.de but hp-toolbox and hp-sendfax launch hp-systray automatically and there is also /etc/xdg/autostart/hplip-systray.desktop. When no HPLIP tools are running (e.g. hp-toolbox), - and the user closes or disables hp-systray, + and the user closes or disables hp-systray, there will be no HPLIP processes running whatsoever. Many bug fixes (no Suse bugs). One more supported LaserJet ZJStream printers (M1120), @@ -1068,7 +1087,7 @@ Thu Apr 3 15:59:09 CEST 2008 - jsmeix@suse.de where the latter has a new printer device class (PSB9100). For details see release_notes.html - Adapted the hplip init script to provide backward compatibility: - It still exists to avoid that printer/scanner setup tools fail + It still exists to avoid that printer/scanner setup tools fail when they try to enable the "hplip" service but all it does is to stop a possibly running hpssd. @@ -1111,7 +1130,7 @@ Thu Feb 21 14:35:36 CET 2008 - jsmeix@suse.de Added foomatic-rip-hplip support. Foomatic-rip-hplip is for distros that do not have the latest foomatic-rip which is required for drv support. - Updated the krgb patch for gpl ghostscript 8.61. + Updated the krgb patch for gpl ghostscript 8.61. Updated the "hp" backend to return only hplip supported devices during device discovery. If the device is not in models.dat the "hp" backend will exclude it. @@ -1318,7 +1337,7 @@ Thu Feb 1 15:02:59 CET 2007 - jsmeix@suse.de requires cups-libs because of /usr/bin/hpijs). - Created new package hpijs-standalone and hpijs-standalone.spec for a special version of /usr/bin/hpijs which neither needs - a HPLIP library nor a CUPS library to run it. + a HPLIP library nor a CUPS library to run it. ------------------------------------------------------------------- Wed Jan 31 13:50:12 CET 2007 - jsmeix@suse.de @@ -1397,14 +1416,14 @@ Mon Sep 11 12:14:32 CEST 2006 - jsmeix@suse.de (instead of explicit only cupsext.so and pcardext.so) so that it works now both for Python 2.4 and 2.5 (the latter installs additional *.egg-info files). - + ------------------------------------------------------------------- Mon Sep 4 12:00:12 CEST 2006 - jsmeix@suse.de - Exchanged the hard RPM requirement for ghostscript_any by a supplements entry for hplip-hpijs so that there is no longer a mutual (cyclic) hard RPM dependency between hplip-hpijs - and ghostscript-library. + and ghostscript-library. ------------------------------------------------------------------- Thu Aug 3 11:37:07 CEST 2006 - jsmeix@suse.de @@ -1527,14 +1546,14 @@ Tue Jan 3 14:52:07 CET 2006 - jsmeix@suse.de ------------------------------------------------------------------- Thu Dec 22 15:29:13 CET 2005 - ro@suse.de -- requires: PyQt -> python-qt +- requires: PyQt -> python-qt ------------------------------------------------------------------- Thu Dec 1 16:01:58 CET 2005 - jsmeix@suse.de - Removed unneeded KDE packages from "neededforbuild" since the new package python-qt was split from kdebindings3-python - (see Suse Bugzilla bnc#135250). + (see Suse Bugzilla bnc#135250). ------------------------------------------------------------------- Mon Nov 28 11:30:30 CET 2005 - jsmeix@suse.de @@ -1613,7 +1632,7 @@ Sun Apr 10 12:13:29 CEST 2005 - coolo@suse.de ------------------------------------------------------------------- Tue Mar 22 11:59:00 CET 2005 - jsmeix@suse.de -- Added PreReq. +- Added PreReq. ------------------------------------------------------------------- Thu Mar 17 10:53:11 CET 2005 - jsmeix@suse.de @@ -1657,7 +1676,7 @@ Tue Feb 15 16:57:52 CET 2005 - jsmeix@suse.de ------------------------------------------------------------------- Tue Feb 1 17:06:20 CET 2005 - jsmeix@suse.de -- Updated to version 0.8.7, for details see ChangeLog and +- Updated to version 0.8.7, for details see ChangeLog and http://hpinkjet.sourceforge.net/updates.php - Added triggerin and postun scripts to add and remove the SANE backend "hpaio" in /etc/sane.d/dll.conf diff --git a/hplip.spec b/hplip.spec index d650bc2..20b2791 100644 --- a/hplip.spec +++ b/hplip.spec @@ -431,6 +431,30 @@ make %{?_smp_mflags} %install make install DESTDIR=%{buildroot} +# Make and install Python compiled bytecode files +# (.pyc compiled python and .pyo optimized compiled python) +# because normal users do not have write permissions +# to the install location /usr/share/hplip/ so that +# for normal users Python would recompile the sources every time +# which results longer program startup time and waste of CPU for compiling, +# see https://en.opensuse.org/openSUSE:Packaging_Python#Byte_Compiled_Files +# and http://lists.opensuse.org/opensuse-packaging/2014-10/msg00028.html +# Make and install .pyc files: +%py_compile %{buildroot}%{_datadir}/hplip +# Make and install .pyo files: +%py_compile -O %{buildroot}%{_datadir}/hplip +# Hardlink .pyc and .pyo when they have same content. +# Do not run "fdupes buildroot/_datadir/hplip" because +# fdupes will link any files with same content there +# which can have unexpected side-effects, compare +# https://bugzilla.opensuse.org/show_bug.cgi?id=784670 +for pyc in $( find %{buildroot}%{_datadir}/hplip -name '*.pyc' ) +do pyo="${pyc%.pyc}.pyo" + if test -f $pyo && diff -q $pyc $pyo 1>/dev/null + then echo hardlinking $pyc and $pyo because both have same content + ln -f $pyc $pyo + fi +done # HPLIP's "make install" installs -rw-r--r-- usr/share/hplip/fax/pstotiff # and usr/lib/cups/filter/pstotiff -> usr/share/hplip/fax/pstotiff # so that when the CUPS filter usr/lib/cups/filter/pstotiff is called, @@ -606,19 +630,6 @@ then if ! grep -q 'hpaio' /etc/sane.d/dll.conf fi exit 0 -%preun -# If the package was removed and if it was updated -# remove all byte-compiled Python .pyc (and perhaps .pyo) files -# which are created at run-time by Python in /usr/share/hplip/. -# Use a generic method via "find" so that it works in any case -# without the need to maintain a long list of individual files. -# Even if this may accidentally remove "foreign" .pyc/.pyo files -# which do not originate from matching .py files from this package -# (e.g. third-party stuff in /usr/share/hplip/), there is no damage -# because Python could re-create them or work only with .py files. -find /usr/share/hplip/ -name '*.py[co]' -delete -exit 0 - %postun %if 0%{?suse_version} >= 1140 %desktop_database_postun