aboutsummaryrefslogtreecommitdiffstats
path: root/community/pdftk/APKBUILD
blob: a4b9ff055cb4aaac0d7c9fafb512943017df6e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Maintainer: Michael Koloberdin <koloberdin@gmail.com>
pkgname=pdftk
pkgver=2.02
pkgrel=1
pkgdesc="Pdftk is a simple tool for doing everyday things with PDF documents"
url="http://www.pdfhacks.com/pdftk"
arch="all"
license="GPL"
depends=""
makedepends="gcc-java findutils"
subpackages="$pkgname-doc"
source="https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/${pkgname}-${pkgver}-src.zip"
builddir="$srcdir/$pkgname-$pkgver-dist/$pkgname"

prepare() {
	cd "$builddir"
	default_prepare
	cat > Makefile.Alpine <<EOF
# Based on https://aur.archlinux.org/cgit/aur.git/tree/Makefile.Arch?h=pdftk
# Which is in turn based on 'Makefile.Debian', part of pdftk
# Copyright (c) 2004-2012 Sid Steward

export CXX= g++
export GCJ= gcj
export GCJH= gcjh
export GJAR= gjar
export LIBGCJ= \`find /usr/share/java -type f -regex '/usr/share/java/libgcj-[0-9].*\\.jar'\`
export AR= ar
export RM= rm
export ARFLAGS= rs
export RMFLAGS= -vf
export CPPFLAGS= -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -DUNBLOCK_SIGNALS -fdollars-in-identifiers -fPIC
export CXXFLAGS= $CXXFLAGS -fPIC
export GCJFLAGS= -Wno-all -fsource=1.3 -O2 -fPIC
export GCJHFLAGS= -force
export LDLIBS= -lgcj

include Makefile.Base
EOF
}

build() {
	cd "$builddir"
	make -j1 -f Makefile.Alpine || return 1
}

package() {
	cd "$builddir"

	# Install binary
	install -D -m 755 pdftk $pkgdir/usr/bin/pdftk || return 1

	# Install licenses and adjust permissions
	cd ..
	LICENSE_DIR="$pkgdir/usr/share/licenses/$pkgname"
	mkdir -p "$LICENSE_DIR" || return 1
	cp -R license_gpl_pdftk/* "$LICENSE_DIR" || return 1
	chmod -R 0755 "$LICENSE_DIR" || return 1
	find "$LICENSE_DIR" -type f -exec chmod -x {} \; || return 1

	# Install manpage
	install -D -m 644 "pdftk.1" "$pkgdir/usr/share/man/man1/pdftk.1" \
		|| return 1
}

md5sums="6534365fd6727724f288a556ede33faa  pdftk-2.02-src.zip"
sha256sums="118f6a25fd3acaafb58824dce6f97cdc07e56050e666b90e4c4ef426ea37b8c1  pdftk-2.02-src.zip"
sha512sums="5c73ab3b7b12cfc24a17c2737d224fdde2ae684e1712031a968b83f5b8d91c521d477e932fc47f8b4a8c0ff0ba183678aaa13a1e7b29107c5c47ded8d960ef54  pdftk-2.02-src.zip"