archrelease: copy trunk to extra-x86_64
[arch-packages.git] / libpaper / repos / extra-x86_64 / PKGBUILD
blob9d6bfcea7b088ba7bfec205aba40d2faedcf42cd
1 # Maintainer: AndyRTR <andyrtr@archlinux.org>
3 # Contributor: Alexander Rødseth <rodseth@gmail.com>
4 # Contributor: Mateusz Herych <heniekk@gmail.com>
5 # Contributor: royrocks <royrocks13@gmail.com>
7 pkgname=libpaper
8 pkgver=2.1.0
9 pkgrel=1
10 pkgdesc="Library for handling paper characteristics"
11 arch=('x86_64')
12 url="https://github.com/rrthomas/libpaper"
13 license=('LGPL2.1' 'GPL3')
14 depends=('glibc')
15 backup=('etc/papersize')
16 source=(https://github.com/rrthomas/libpaper/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz
17         localepaper.c)
18 sha256sums=('474e9575e1235a0d8e3661f072de0193bab6ea1023363772f698a2cc39d640cf'
19             '7e49c6ce67fbaea77929ab5849026412d0f91f692a902805c0134a071cccde22')
20 provides=('paper')
21 replaces=('paper')
22 conflicts=('paper')
24 prepare() {
25   cd "$pkgname-$pkgver"
26   cp ../localepaper.c src/
27   #autoreconf -vfi
30 build() {
31   cd "$pkgname-$pkgver"
32   ./configure \
33     --prefix=/usr \
34     --sysconfdir=/etc \
35     --sbindir=/usr/bin
36   make
37   # localepaper
38   pushd src
39   gcc $CFLAGS $LDFLAGS -I.. -Ilibgnu -o localepaper localepaper.c libgnu/.libs/libgnupaper.a
40   popd
43 check() {
44   cd "$pkgname-$pkgver"
45   make -k check
47 package() {
48   cd "$pkgname-$pkgver"
49   make DESTDIR="$pkgdir" install
50   
51   # localepaper
52   install -Dt "$pkgdir/usr/lib" -m0755 src/localepaper 
53   
55   # add systemwide default papersize read by many office applications
56   install -dm 755 "$pkgdir"/etc
57   echo '# Simply write the paper name. See man 1 paper and "paper --no-size --all" for possible values' > "$pkgdir"/etc/papersize
59   # add libpaper.d directory other packages can use to store files
60   install -dm 755 "$pkgdir"/etc/libpaper.d
62   # https://github.com/rrthomas/libpaper/commit/b4f6846a3a9ae052a515ac0db913e5a68f947adf
63   # reintroduced deprecated paperconf binary
64 #  # add paperconf executable, needed by libreoffice
65 #  cat <<EOF > "${pkgdir}"/usr/bin/paperconf
66 #exec paper --no-size "\$@"
67 #EOF
68 #  chmod 755 "${pkgdir}"/usr/bin/paperconf
70   # currently no localisation available
71 #  pushd debian/po
72 #  for i in `ls *.po`; do
73 #       install -dm 755 "${pkgdir}"/usr/share/locale/${i%.po}/LC_MESSAGES/;
74 #       msgfmt $i -o "${pkgdir}"/usr/share/locale/${i%.po}/LC_MESSAGES/${pkgname}.mo;
75 #  done
76 #  popd