Comment 4 for bug 1201935

Revision history for this message
Johannes Meixner (jsmeix) wrote :

Hello Sanjay Kumar,

many thanks for your description above how to
add custom paper size in hpcups.

At the end you wrote "New ppd file will be now generated
from the hpcups.drv file".

At least for openSUSE's HPLIP RPM packages this is not true
because intentionally I provide ready-made static PPDs in
our HPLIP RPM packages (I compile HPLIP with matching
configure options).

In particular note that dynamic PPDs will be deprecated
in the future in CUPS, see CUPS STR #3772.

For details and reasoning see
https://build.opensuse.org/package/view_file/Printing/hplip?expand=1&file=hplip.spec
--------------------------------------------------------------------------------
%build
...
# Static "hpijs" PPD files via enable-foomatic-ppd-install
# require foomatic-rip-hplip via their cupsFilter entries
# so that enable-foomatic-rip-hplip-install is also needed.
# Since version 3.9.6 the default printer driver install changed
# from hpijs to hpcups.
# According to http://hplipopensource.com/hplip-web/release_notes.html
# all drv installs require CUPSDDK 1.2.3 or higher.
# Otherwise a static PPD install must be performed.
# Furthermore dynamic PPDs will be deprecated in the future in CUPS,
# see http://www.cups.org/str.php?L3772
# For hpcups static PPD install one needs:
# --enable-hpcups-install enable hpcups install (default=yes)
# --disable-cups-drv-install enable cups dynamic ppd install (default=yes)
# --enable-cups-ppd-install enable cups static ppd install (default=no)
# For both hpcups and hpijs install with static PPDs one needs additionally:
# --enable-hpijs-install enable hpijs install (default=no)
# --disable-foomatic-drv-install enable foomatic dynamic
# ppd install (default=no), uses drvdir and hpppddir
# --enable-foomatic-ppd-install enable foomatic static
# ppd install (default=no), uses hpppddir
# --enable-foomatic-rip-hplip-install enable foomatic-rip-hplip
# install (default=no), uses cupsfilterdir
# Because foomatic-rip-hplip has CVE-2011-2697 (bnc#698451)
# plus a leftover in CVE-2004-0801 (bnc#59233)
# which are fixed up to openSUSE 11.4 with patches,
# after openSUSE 11.4 (i.e. since openSUSE 12.1)
# foomatic-rip-hplip is no longer installed and foomatic-rip
# from foomatic-filters is used instead so that
# --disable-foomatic-rip-hplip-install is explicitly set
# and as a consequence the "cupsFilter" entries
# in the static PPDs are changed in the install section
# to use foomatic-rip.
./configure --prefix=/usr \
            --libdir=%{_libdir} \
            --disable-qt3 \
            --enable-qt4 \
            --disable-policykit \
            --enable-doc-build \
            --enable-network-build \
            --enable-pp-build \
            --enable-scan-build \
            --enable-gui-build \
            --enable-fax-build \
            --enable-dbus-build \
            --enable-hpcups-install \
            --disable-cups-drv-install \
            --enable-cups-ppd-install \
            --enable-hpijs-install \
            --disable-foomatic-drv-install \
            --enable-foomatic-ppd-install \
            --disable-foomatic-rip-hplip-install \
            --with-hpppddir=%{_datadir}/cups/model/manufacturer-PPDs/%{name} \
            --with-cupsbackenddir=/usr/lib/cups/backend \
            --with-cupsfilterdir=/usr/lib/cups/filter \
            --with-drvdir=/usr/lib/cups/driver \
            --with-mimedir=%{_sysconfdir}/cups \
            --with-docdir=%{_defaultdocdir}/%{name}
make

%install
...
# Because foomatic-rip-hplip has CVE-2011-2697 (bnc#698451)
# plus a leftover in CVE-2004-0801 (bnc#59233)
# foomatic-rip-hplip is no longer installed and foomatic-rip
# from foomatic-filters is used instead so that
# the "cupsFilter" entries in the static PPDs must
# be changed accordingly:
echo "Replacing insecure foomatic-rip-hplip with foomatic-rip everywhere in in the PPDs..."
for p in *.ppd
do sed -i -e 's/foomatic-rip-hplip/foomatic-rip/' $p
done
--------------------------------------------------------------------------------

I would appreciate it if you could enhance your description
and add information how to add custom paper size
in case of static PPD files.

I would suggest that you make the final description
generally available on http://hplipopensource.com/
via your HPLIP Knowlege Base.