PKGBUILD 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  2. # Contributor (Hyperbola): André Silva <emulatorman@hyperbola.info>
  3. pkgname=netpbm
  4. pkgver=10.73.31
  5. pkgrel=1
  6. pkgrel+=.parabola1
  7. pkgdesc="A toolkit for manipulation of graphic images"
  8. pkgdesc+=", without nonfree parts and patent issues"
  9. arch=('x86_64')
  10. arch+=('i686' 'armv7h')
  11. license=('custom' 'BSD' 'GPL' 'LGPL')
  12. url="http://netpbm.sourceforge.net/"
  13. depends=('perl' 'libpng' 'libtiff' 'libxml2')
  14. makedepends=('python2' 'jbigkit' 'subversion')
  15. options=('!makeflags')
  16. # Get docs with: wget --recursive --relative -nH http://netpbm.sourceforge.net/doc/
  17. source=(https://downloads.sourceforge.net/project/netpbm/super_stable/$pkgver/netpbm-$pkgver.tgz
  18. https://sources.archlinux.org/other/packages/netpbm/netpbm-doc-31Jan2014.tar.xz{,.sig}
  19. netpbm-CAN-2005-2471.patch netpbm-security-code.patch netpbm-security-scripts.patch)
  20. sha256sums=('584c95f1ccdcd66d5ca68d7d5501728ae1184cba324d713f6b2a3ca86424243b'
  21. '74bcf840ee643c6917330c382484010cb99c004a3fcf05391bebcac63815acb3'
  22. 'SKIP'
  23. '991aba7897e0710687369b4e2edfba1397ecd77d62578eac496afbc47b5ca970'
  24. '2eaa0f842d90bb3dcbc66273d58ec9117b97029da231b141159e580e65b98eb0'
  25. '2c397588d9cba2c40dee55c07713d5e77e0e04245db939fdc1962d7de4cf4a33')
  26. validpgpkeys=('5357F3B111688D88C1D88119FCF2CB179205AC90')
  27. prepare() {
  28. cd $pkgname-$pkgver
  29. # Removing hpcdtoppm/pcdindex (non comercial)
  30. rm -rv converter/ppm/hpcdtoppm
  31. # Removing ppmtogif/giftopnm (patent restriction)
  32. rm -v converter/other/giftopnm.c converter/ppm/ppmtogif.c
  33. rm -v test/gif-quant-roundtrip.test test/gif-roundtrip.test test/all-in-place.ok
  34. # Removing programs without license information
  35. rm -v other/pamchannel.c test/pamchannel.ok
  36. rm -v converter/other/pamtopnm.c
  37. rm -v converter/pbm/pbmto4425.c
  38. rm -v converter/pbm/pbmtoln03.c
  39. rm -v converter/pbm/pbmtolps.c
  40. rm -v converter/pbm/pbmtopk.c
  41. rm -v converter/pbm/pktopbm.c
  42. rm -v converter/ppm/ppmtopjxl.c
  43. rm -v converter/pgm/spottopgm.c
  44. rm -v test/avs-roundtrip.test test/facesaver-roundtrip.test test/ilbm-roundtrip.test test/pamchannel.test \
  45. test/pamditherbw.test test/pamenlarge.test test/pamfile.test test/pfm-roundtrip.test \
  46. test/pgmtoppm.test test/pict-roundtrip.test test/pnminvert.test test/pnmremap1.test \
  47. test/pnmremap2.test test/pnmtopnm-plain.test test/pnm-pam-roundtrip.test test/pnm-plain-roundtrip.test \
  48. test/ps-alt-roundtrip.test test/ps-roundtrip.test test/sbig-roundtrip.test test/st4-roundtrip.test \
  49. test/targa-roundtrip.test test/utahrle-roundtrip.test test/winicon-roundtrip.test test/xwd-roundtrip.test
  50. # Removing references about hpcdtoppm/pcdindex (non comercial)
  51. sed -i 's/hpcdtoppm//g' converter/ppm/Makefile
  52. sed -i 's/hpcdtoppm\.1//g' buildtools/manpage.mk
  53. sed -i 's/pcdindex\.1//g' buildtools/manpage.mk
  54. # Removing references about ppmtogif/giftopnm (patent restriction)
  55. sed -i 's/ppmtogif//g' converter/ppm/Makefile test/all-in-place.test
  56. sed -i 's/ppmtogif\.1//g' buildtools/manpage.mk
  57. sed -i 's/giftopnm//g' converter/other/Makefile test/all-in-place.test
  58. sed -i 's/giftopnm\.1//g' buildtools/manpage.mk
  59. sed -i '/giftopnm/d' converter/other/pnmtopalm/README
  60. # Removing references about programs without license information
  61. sed -i 's/pamchannel//g' other/Makefile test/all-in-place.test
  62. sed -i 's/pamchannel\.1//g' buildtools/manpage.mk
  63. sed -i 's/pamchannel\.test//g' test/Test-Order
  64. sed -i 's/pamtopnm//g' converter/other/Makefile test/all-in-place.test
  65. sed -i 's/pamtopnm\.1//g' buildtools/manpage.mk
  66. sed -i '/pnmtopnm/d' netpbm.c
  67. sed -i 's/pbmto4425//g' converter/pbm/Makefile test/all-in-place.test
  68. sed -i 's/pbmto4425\.1//g' buildtools/manpage.mk
  69. sed -i 's/pbmtoln03//g' converter/pbm/Makefile test/all-in-place.test
  70. sed -i 's/pbmtoln03\.1//g' buildtools/manpage.mk
  71. sed -i 's/pbmtolps//g' converter/pbm/Makefile test/all-in-place.test
  72. sed -i 's/pbmtolps\.1//g' buildtools/manpage.mk
  73. sed -i 's/pbmtopk//g' converter/pbm/Makefile test/all-in-place.test
  74. sed -i 's/pbmtopk\.1//g' buildtools/manpage.mk
  75. sed -i 's/pktopbm//g' converter/pbm/Makefile test/all-in-place.test
  76. sed -i 's/pktopbm\.1//g' buildtools/manpage.mk
  77. sed -i 's/ppmtopjxl//g' converter/ppm/Makefile test/all-in-place.test
  78. sed -i 's/ppmtopjxl\.1//g' buildtools/manpage.mk
  79. sed -i 's/spottopgm//g' converter/pgm/Makefile test/all-in-place.test
  80. sed -i 's/spottopgm\.1//g' buildtools/manpage.mk
  81. #Removing references about nonfree licenses part
  82. sed -i '338,383d' doc/copyright_summary
  83. patch -p1 < ../netpbm-CAN-2005-2471.patch
  84. patch -p1 < ../netpbm-security-code.patch
  85. patch -p1 < ../netpbm-security-scripts.patch
  86. sed -i 's|#!/usr/bin/python|#!/usr/bin/python2|' buildtools/makeman
  87. sed -i 's|@python|@python2|' buildtools/manpage.mk
  88. cp config.mk.in config.mk
  89. [ "${CARCH}" = 'x86_64' ] && echo 'CFLAGS_SHLIB = -fPIC' >> config.mk
  90. [ "${CARCH}" = 'armv7h' ] && echo 'CFLAGS_SHLIB = -fPIC' >> config.mk
  91. echo "NETPBM_DOCURL = file://${srcdir}/doc" >> config.mk
  92. echo 'TIFFLIB = libtiff.so' >> config.mk
  93. echo 'JPEGLIB = libjpeg.so' >> config.mk
  94. echo 'PNGLIB = libpng.so' >> config.mk
  95. echo 'ZLIB = libz.so' >> config.mk
  96. echo 'JBIGLIB = /usr/lib/libjbig.a' >> config.mk
  97. sed -i 's|misc|share/netpbm|' common.mk
  98. sed -i 's|/link|/lib|' lib/Makefile
  99. sed -i 's|install.manwebmain install.manweb install.man|install.man|' GNUmakefile
  100. }
  101. build() {
  102. cd $pkgname-$pkgver
  103. make
  104. # Generating useful man pages with html doc
  105. make MAKEMAN="${srcdir}/$pkgname-$pkgver/buildtools/makeman" USERGUIDE=. \
  106. -C ../doc -f "${srcdir}/$pkgname-$pkgver/buildtools/manpage.mk" manpages
  107. }
  108. package() {
  109. cd $pkgname-$pkgver
  110. make pkgdir="${pkgdir}/usr" PKGMANDIR=share/man install-run install-dev
  111. # Removing dummy man pages
  112. rm "${pkgdir}"/usr/share/man/man{1,3,5}/*
  113. make MAKEMAN="${srcdir}/$pkgname-$pkgver/buildtools/makeman" MANDIR="${pkgdir}/usr/share/man" \
  114. -C ../doc -f "${srcdir}/$pkgname-$pkgver/buildtools/manpage.mk" installman
  115. # Replace obsolete utility
  116. echo -e '#!/bin/sh\npamditherbw $@ | pamtopnm\n' > "${pkgdir}/usr/bin/pgmtopbm"
  117. # Licensing. Note that each program in the package has a separate license.
  118. install -D -m644 "${srcdir}/$pkgname-$pkgver/doc/copyright_summary" \
  119. "${pkgdir}/usr/share/licenses/${pkgname}/copyright_summary.txt"
  120. }