summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bb9c45c557d4ce8ebfebd723e9d3a413a60c59bc (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
69
70
71
72
73
74
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
# Contributor: Tom < reztho at archlinux dot us >
#
# Thanks to Alan Heckert from NIST for his support

pkgname=dataplot
pkgver=20210713
pkgrel=1
pkgdesc="Software for scientific visualization, statistical analysis, and non-linear modeling."
arch=(x86_64)
url="https://www.itl.nist.gov/div898/software/${pkgname}"
license=('custom')
depends=(cairo gd gcc-libs fontconfig expat libpng zlib libjpeg-turbo libx11 freetype2 tcsh readline termcap tk)
makedepends=(imagemagick gcc-fortran gendesk)
# backup=('usr/share/${pkgname}/frscript/xdpConfig')
source=("${url}/ftp/unix/${pkgname}-${pkgver}.tar.gz"
  "${pkgname}.sh")
sha512sums=('5e1920b1ad795c189a587bd8cc2d26a4fff259c84cc89ee4c5a4d86c6606cc2f61fc9b7dddcea998bf94c4b8123076c35205da828926c637776f481f41c8fbb8'
  '62d40b182ec2212a0cf27ac548a3a4b46598291c7407dbb8d51633bf088841b3bdf1917c0b223c3d234e8eb149aba3a0ec5d35ac66a4ac4f1521a485ca87a411')

prepare() {
  sed -i 's/\/local//g' ${pkgname}/src/Makefile
  sed -i 's/\/local//g' ${pkgname}/lib/frscript/xdpConfig.in
}

build() {
  gendesk -n -f \
    --pkgname="x${pkgname}" \
    --pkgdesc="${pkgdesc}" \
    --name="${pkgname}" \
    --categories="Education;Science;Math;" \
    --exec="/usr/bin/xdataplot" \
    --startupnotify=true

  cd ${pkgname}/src
  make
}

package() {
  cd ${pkgname}/src
  make install DESTDIR="${pkgdir}"

  # Preparing the dataplot auxiliary files
  install -dm755 ${pkgdir}/usr/share/${pkgname}

  # Icon and .desktop files
  install -dm755 ${pkgdir}/usr/share/pixmaps
  /usr/bin/convert ${pkgdir}/usr/lib/dataplot/frscript/xdpIcon.xbm \
    ${pkgdir}/usr/share/pixmaps/xdataplot.png
  install -dm755 ${pkgdir}/usr/share/applications
  install -m644 ${srcdir}/xdataplot.desktop ${pkgdir}/usr/share/applications

  # Copying dataplot.sh to ${pkgdir}/etc/profile.d so dataplot will know
  # where its files are
  install -dm755 ${pkgdir}/etc/profile.d
  cp ${srcdir}/dataplot.sh ${pkgdir}/etc/profile.d

  # License/Disclaimer
  install -dm755 ${pkgdir}/usr/share/licenses/${pkgname}
  cat >${pkgdir}/usr/share/licenses/${pkgname}/${pkgname}.txt <<EOF
http://www.itl.nist.gov/div898/software/dataplot/disclaim.htm

DATAPLOT Disclaimer

This software was developed at the National Institute of Standards and Technology by 
employees of the Federal Government in the course of their official duties. Persuant 
to title 17 section 105 of the United States Code this software is not subject to
copyright protection and is in the public domain. Dataplot is an experimental system.
NIST assumes no responsibility whatsoever for its use by other parties, and makes no
guarantees, expressed or implied, about its quality, reliability, or any other
characteristic. 
EOF
  find "${pkgdir}" -type d -empty -delete
}