Date: Sunday, February 12, 2023 @ 21:27:59
Author: andyrtr
Revision: 468684
archrelease: copy trunk to staging-x86_64
Added:
libpaper/repos/staging-x86_64/
libpaper/repos/staging-x86_64/PKGBUILD
(from rev 468683, libpaper/trunk/PKGBUILD)
libpaper/repos/staging-x86_64/localepaper.c
(from rev 468683, libpaper/trunk/localepaper.c)
---------------+
PKGBUILD | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
localepaper.c | 44 +++++++++++++++++++++++++++++++++++
2 files changed, 113 insertions(+)
Copied: libpaper/repos/staging-x86_64/PKGBUILD (from rev 468683,
libpaper/trunk/PKGBUILD)
===================================================================
--- staging-x86_64/PKGBUILD (rev 0)
+++ staging-x86_64/PKGBUILD 2023-02-12 21:27:59 UTC (rev 468684)
@@ -0,0 +1,69 @@
+# Maintainer: AndyRTR <[email protected]>
+
+# Contributor: Alexander Rødseth <[email protected]>
+# Contributor: Mateusz Herych <[email protected]>
+# Contributor: royrocks <[email protected]>
+
+pkgname=libpaper
+pkgver=2.0.8
+pkgrel=1
+pkgdesc="Library for handling paper characteristics"
+arch=('x86_64')
+url="https://github.com/rrthomas/libpaper"
+license=('LGPL2.1' 'GPL3')
+depends=('glibc')
+backup=('etc/papersize')
+source=(https://github.com/rrthomas/libpaper/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz
+ localepaper.c)
+sha256sums=('e543bdfdcdd8935e09da6a0ebc1ea154ee565055bc06cc936631ee49fc8baf5f'
+ '7e49c6ce67fbaea77929ab5849026412d0f91f692a902805c0134a071cccde22')
+provides=('paper')
+replaces=('paper')
+conflicts=('paper')
+
+prepare() {
+ cd "$pkgname-$pkgver"
+ cp ../localepaper.c src/
+ #autoreconf -vfi
+}
+
+build() {
+ cd "$pkgname-$pkgver"
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --sbindir=/usr/bin
+ make
+ # localepaper
+ pushd src
+ gcc $CFLAGS -I.. -Ilibgnu -o localepaper localepaper.c
libgnu/.libs/libgnupaper.a
+ popd
+}
+
+check() {
+ cd "$pkgname-$pkgver"
+ make -k check
+}
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+
+ # localepaper
+ install -Dt "$pkgdir/usr/lib" -m0755 src/localepaper
+
+
+ # add systemwide default papersize read by many office applications
+ install -dm 755 "$pkgdir"/etc
+ echo '# Simply write the paper name. See papersize(5) for possible values' >
"$pkgdir"/etc/papersize
+
+ # add libpaper.d directory other packages can use to store files
+ install -dm 755 "$pkgdir"/etc/libpaper.d
+
+ # currently no localisation available
+# pushd debian/po
+# for i in `ls *.po`; do
+# install -dm 755 "${pkgdir}"/usr/share/locale/${i%.po}/LC_MESSAGES/;
+# msgfmt $i -o
"${pkgdir}"/usr/share/locale/${i%.po}/LC_MESSAGES/${pkgname}.mo;
+# done
+# popd
+}
Copied: libpaper/repos/staging-x86_64/localepaper.c (from rev 468683,
libpaper/trunk/localepaper.c)
===================================================================
--- staging-x86_64/localepaper.c (rev 0)
+++ staging-x86_64/localepaper.c 2023-02-12 21:27:59 UTC (rev 468684)
@@ -0,0 +1,44 @@
+/*
+ * localepaper: print the dimensions in mm of the current locale's
+ * paper size, if possible.
+ *
+ * Based on a patch by Caolan McNamara:
+ * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=481213
+ *
+ * Copyright (C) Reuben Thomas <[email protected]>, 2013.
+ *
+ * Copying and distribution of this file, with or without modification,
+ * are permitted in any medium without royalty provided the copyright
+ * notice and this notice are preserved.
+ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <locale.h>
+#if defined LC_PAPER && defined _GNU_SOURCE
+#include <langinfo.h>
+#endif
+
+#include "progname.h"
+
+int main(int argc, char *argv[])
+{
+ set_program_name(argv[0]);
+ argc = argc; /* Avoid a compiler warning. */
+
+#if defined LC_PAPER && defined _GNU_SOURCE
+ setlocale(LC_ALL, "");
+
+#define NL_PAPER_GET(x) \
+ ((union { char *string; unsigned word; })nl_langinfo(x)).word
+
+ printf("%d %d\n", NL_PAPER_GET(_NL_PAPER_WIDTH),
NL_PAPER_GET(_NL_PAPER_HEIGHT));
+ return EXIT_SUCCESS;
+
+#else
+ printf("%s: locale paper size information is not supported on this system",
program_name);
+ return EXIT_FAILURE;
+#endif
+}