summaryrefslogtreecommitdiff
path: root/manualPorts/netpbm/Pkgfile
blob: e92fdfea3df7020dcf33f38f48462c51fec81d28 (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
# Description: A toolkit for manipulation of graphic images.
# URL: http://netpbm.sourceforge.net/
# Maintainer: Erich Eckner, crux at eckner dot net
# Depends on: perl libpng libtiff libxml2 python jbigkit subversion

name=netpbm
version=10.73.32
release=1
source=(https://downloads.sourceforge.net/project/netpbm/super_stable/$version/netpbm-$version.tgz
        https://sources.archlinux.org/other/packages/netpbm/netpbm-doc-31Jan2014.tar.xz{,.sig}
        netpbm-CAN-2005-2471.patch netpbm-security-code.patch netpbm-security-scripts.patch
        reproducible-man-gzip.patch use-source-date-epoch.patch)

build() {
  cd $name-$version

  patch -p1 < ../netpbm-CAN-2005-2471.patch
  patch -p1 < ../netpbm-security-code.patch
  patch -p1 < ../netpbm-security-scripts.patch
  patch -p1 < ../reproducible-man-gzip.patch
  patch -p1 < ../use-source-date-epoch.patch

  cp config.mk.in  config.mk
  echo 'CFLAGS_SHLIB = -fPIC' >> config.mk
  echo "NETPBM_DOCURL = file://${SRC}/doc" >> config.mk
  echo 'TIFFLIB = libtiff.so' >> config.mk
  echo 'JPEGLIB = libjpeg.so' >> config.mk
  echo 'PNGLIB = libpng.so' >> config.mk
  echo 'ZLIB = libz.so' >> config.mk
  echo 'JBIGLIB = /usr/lib/libjbig.a' >> config.mk

  sed -i 's|misc|share/netpbm|' common.mk
  sed -i 's|/link|/lib|' lib/Makefile
  sed -i 's|install.manwebmain install.manweb install.man|install.man|' GNUmakefile

  make
  # Generating useful man pages with html doc
  make MAKEMAN="${SRC}/$name-$version/buildtools/makeman" USERGUIDE=. \
    -C ../doc -f "${SRC}/$name-$version/buildtools/manpage.mk" manpages

  make pkgdir="${PKG}/usr" PKGMANDIR=share/man install-run install-dev

# Removing dummy man pages
  rm "${PKG}"/usr/share/man/man{1,3,5}/*

  make MAKEMAN="${SRC}/$name-$version/buildtools/makeman" MANDIR="${PKG}/usr/share/man" \
    -C ../doc -f "${SRC}/$name-$version/buildtools/manpage.mk" installman

# Replace obsolete utility
  echo -e '#!/bin/sh\npamditherbw $@ | pamtopnm\n' > "${PKG}/usr/bin/pgmtopbm"

# Licensing.  Note that each program in the package has a separate license.
  install -D -m644 "${SRC}/$name-$version/doc/copyright_summary" \
    "${PKG}/usr/share/licenses/${name}/copyright_summary.txt"
}