description="A simple way for applications to take actions based on a system/user-specified paper size"
url="http://ftp.debian.org/debian/pool/main/libp/libpaper"

maintainer="rems"
packager="Great-OS Team"

name=libpaper
version=2.2.7
release=2

source=(https://github.com/rrthomas/libpaper/releases/download/v$version/$name-$version.tar.gz
        run-parts)

build () {

  cd $name-$version

  autoreconf -fiv
  
  ./configure --prefix=/usr  \
              --sysconfdir=/etc \
              --disable-static                 

  make
  make DESTDIR=$PKG install
	
  cp -v ../run-parts $PKG/usr/bin/
  chmod -v 755 $PKG/usr/bin/run-parts

  make DESTDIR=$PKG install
	
  cp -v ../run-parts $PKG/usr/bin/
  chmod -v 755 $PKG/usr/bin/run-parts

  # add systemwide default papersize read by many office applications
  install -dm 755 "$PKG"/etc
  echo '# Simply write the paper name. See papersize(5) for possible values' > "$PKG"/etc/papersize

  # add libpaper.d directory other packages can use to store files
  install -dm 755 "$PKG"/etc/libpaper.d
}
