Date: Saturday, April 15, 2023 @ 07:09:58
  Author: andyrtr
Revision: 474068

archrelease: copy trunk to testing-x86_64

Added:
  libpaper/repos/testing-x86_64/
  libpaper/repos/testing-x86_64/PKGBUILD
    (from rev 474067, libpaper/trunk/PKGBUILD)
  libpaper/repos/testing-x86_64/localepaper.c
    (from rev 474067, libpaper/trunk/localepaper.c)

---------------+
 PKGBUILD      |   77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 localepaper.c |   44 ++++++++++++++++++++++++++++++++
 2 files changed, 121 insertions(+)

Copied: libpaper/repos/testing-x86_64/PKGBUILD (from rev 474067, 
libpaper/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD                             (rev 0)
+++ testing-x86_64/PKGBUILD     2023-04-15 07:09:58 UTC (rev 474068)
@@ -0,0 +1,77 @@
+# Maintainer: AndyRTR <[email protected]>
+
+# Contributor: Alexander Rødseth <[email protected]>
+# Contributor: Mateusz Herych <[email protected]>
+# Contributor: royrocks <[email protected]>
+
+pkgname=libpaper
+pkgver=2.1.0
+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=('474e9575e1235a0d8e3661f072de0193bab6ea1023363772f698a2cc39d640cf'
+            '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 $LDFLAGS -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 man 1 paper and "paper --no-size 
--all" for possible values' > "$pkgdir"/etc/papersize
+
+  # add libpaper.d directory other packages can use to store files
+  install -dm 755 "$pkgdir"/etc/libpaper.d
+
+  # 
https://github.com/rrthomas/libpaper/commit/b4f6846a3a9ae052a515ac0db913e5a68f947adf
+  # reintroduced deprecated paperconf binary
+#  # add paperconf executable, needed by libreoffice
+#  cat <<EOF > "${pkgdir}"/usr/bin/paperconf
+#exec paper --no-size "\$@"
+#EOF
+#  chmod 755 "${pkgdir}"/usr/bin/paperconf
+
+  # 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/testing-x86_64/localepaper.c (from rev 474067, 
libpaper/trunk/localepaper.c)
===================================================================
--- testing-x86_64/localepaper.c                                (rev 0)
+++ testing-x86_64/localepaper.c        2023-04-15 07:09:58 UTC (rev 474068)
@@ -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
+}

Reply via email to