libpaper-1.1.24+nmu5

#### Beyond Linux® From Scratch - Version 2019-02-27

### Chapter 9. General Libraries

- Prev

  libmbim-1.18.0

- Next

  libqmi-1.22.0

- Up
- Home

# libpaper-1.1.24+nmu5

## Introduction to libpaper

This package is intended to provide a simple way for applications to take actions based on a system or user-specified paper size.

This package is known to build and work properly using an LFS-8.4 platform.

### Package Information

- Download (HTTP): http://ftp.debian.org/debian/pool/main/libp/libpaper/libpaper_1.1.24+nmu5.tar.gz

- Download MD5 sum: 38bc55688c0fc5544edaa5a951a45fbd

- Download size: 48 KB

- Estimated disk space required: 3.5 MB

- Estimated build time: less than 0.1 SBU

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/libpaper

## Installation of libpaper

Install libpaper by running the following commands:

    autoreconf -fi                &&
    ./configure --prefix=/usr     \
                --sysconfdir=/etc \
                --disable-static &&
    make

This package does not come with a test suite.

Now, as the `root` user:

    make install &&
    mkdir -vp /etc/libpaper.d &&

    cat > /usr/bin/run-parts << "EOF"
    #!/bin/sh
    # run-parts:  Runs all the scripts found in a directory.
    # from Slackware, by Patrick J. Volkerding with ideas borrowed
    # from the Red Hat and Debian versions of this utility.

    # keep going when something fails
    set +e

    if [ $# -lt 1 ]; then
      echo "Usage: run-parts <directory>"
      exit 1
    fi

    if [ ! -d $1 ]; then
      echo "Not a directory: $1"
      echo "Usage: run-parts <directory>"
      exit 1
    fi

    # There are several types of files that we would like to
    # ignore automatically, as they are likely to be backups
    # of other scripts:
    IGNORE_SUFFIXES="~ ^ , .bak .new .rpmsave .rpmorig .rpmnew .swp"

    # Main loop:
    for SCRIPT in $1/* ; do
      # If this is not a regular file, skip it:
      if [ ! -f $SCRIPT ]; then
        continue
      fi
      # Determine if this file should be skipped by suffix:
      SKIP=false
      for SUFFIX in $IGNORE_SUFFIXES ; do
        if [ ! "$(basename $SCRIPT $SUFFIX)" = "$(basename $SCRIPT)" ]; then
          SKIP=true
          break
        fi
      done
      if [ "$SKIP" = "true" ]; then
        continue
      fi
      # If we've made it this far, then run the script if it's executable:
      if [ -x $SCRIPT ]; then
        $SCRIPT || echo "$SCRIPT failed."
      fi
    done

    exit 0
    EOF

    chmod -v 755 /usr/bin/run-parts

## Command Explanations

`--disable-static`: This switch prevents installation of static versions of the libraries.

mkdir -pv /etc/libpaper.d: libpaper expects that packages will install files into this directory.

cat > /usr/bin/run-parts << "EOF" : `paperconfig` is a script which will invoke run-parts if `/etc/libpaper.d` exists. No other BLFS package installs this, so we create it here.

## Configuring libpaper

### Configuration Information

Create `/etc/papersize` to set the default system paper size. Issue the following command as the `root` user to set this to 'A4' (libpaper prefers the lowercase form). You may wish to use a different size, such as letter.

    cat > /etc/papersize << "EOF"
    a4
    EOF

## Contents

Installed Programs: paperconf, paperconfig, run-parts
Installed Library: libpaper.so
Installed Directories: /etc/libpaper.d

### Short Descriptions

paperconf | prints paper configuration information.
paperconfig | configures the system default paper size.
run-parts | runs all the scripts found in a directory.
`libpaper.so` | contains functions for interrogating the paper library.

Last updated on 2019-02-15 15:01:29 -0600

- Prev

  libmbim-1.18.0

- Next

  libqmi-1.22.0

- Up
- Home