1 # Contributor: Tom < reztho at archlinux dot us >
3 # Thanks to Alan Heckert from NIST for his support
8 pkgdesc="Software for scientific visualization, statistical analysis, and non-linear modeling."
10 url="http://www.itl.nist.gov/div898/software/dataplot.html/"
12 depends=('gd' 'gcc-libs' 'fontconfig' 'expat' 'libpng' 'zlib' 'libjpeg' 'libx11' 'freetype2' 'tcsh')
14 makedepends=('imagemagick' 'gcc-fortran')
15 backup=('usr/share/dataplot/frscript/xdpConfig')
17 _dcommandver=2009_06_21
18 source=("ftp://ftp.nist.gov/pub/dataplot/unix/dpsrc_${pkgver}.tar.gz"
19 "ftp://ftp.nist.gov/pub/dataplot/unix/dplib.${_dplibver}.tar.gz"
20 "ftp://ftp.nist.gov/pub/dataplot/unix/dataplot_command.${_dcommandver}.tar.gz"
23 noextract=("dpsrc_${pkgver}.tar.gz"
24 "dplib.${pkgver}.tar.gz")
28 # I make the directory for the dataplot source files
29 if [ ! -d ${srcdir}/dpsrc ];then
30 mkdir -p ${srcdir}/dpsrc
33 bsdtar -xf ${srcdir}/dpsrc_${pkgver}.tar.gz
35 # Copy the build script...
36 _build_script=build_linux_gfortran.bash
37 cp ${srcdir}/command/${_build_script} ${srcdir}/dpsrc/ || return 1
39 # ...and configure it:
40 # - Changing the build directory
41 sed -i "s@/usr/local/src/dataplot@${srcdir}/dpsrc@g" ${srcdir}/dpsrc/${_build_script}
43 # - I prefer not to sacrifice precision and/or good behaviour for speed
44 # If you want speed, just comment the next line
45 sed -i 's@IOPT="-O2"@#IOPT="-O2"@' ${srcdir}/dpsrc/${_build_script}
47 # - Enabling readline support
48 # sed -i 's@HAVE_RL=off@#HAVE_RL=off@' ${srcdir}/dpsrc/${_build_script}
49 # sed -i 's@#HAVE_RL=on@HAVE_RL=on@' ${srcdir}/dpsrc/${_build_script}
50 # sed -i 's@-ltermcap@@g' ${srcdir}/dpsrc/${_build_script}
52 # - By default, the build script is for i686 machines, so I change it in case of
53 # compiling the package in a 64 bit machine
54 if [ "${CARCH}" = "x86_64" ]; then
55 sed -i 's@IBIT=32@#IBIT=32@' ${srcdir}/dpsrc/${_build_script}
56 sed -i 's@#IBIT=64@IBIT=64@' ${srcdir}/dpsrc/${_build_script}
59 # Running the build script
60 chmod +x ${_build_script}
67 # Moving the dataplot binary to ${pkgdir}
68 mkdir -p ${pkgdir}/usr/bin/
69 mv ${srcdir}/dpsrc/dataplot ${pkgdir}/usr/bin/ || return 1
71 # Preparing the dataplot auxiliary files
72 mkdir -p ${pkgdir}/usr/share/dataplot/
73 cd ${pkgdir}/usr/share/dataplot/
74 bsdtar -xf ${srcdir}/dplib.${_dplibver}.tar.gz
76 # - Modifying the xdataplot script
77 sed -i 's@/usr/local/lib/dataplot@/usr/share/dataplot@' frscript/xdataplot
78 sed -i 's@/usr/share/dataplot/tcl@/usr/lib/tcl8.5/@' frscript/xdataplot
79 sed -i 's@/usr/share/dataplot/tk@/usr/lib/tk8.5/@' frscript/xdataplot
81 # - Modifying the xdp script
82 # sed -i 's@#!/itl/links/generic/bin/wish@#!/usr/bin/tclsh -f@' frscript/xdp
84 # - Modifying the config file of xdataplot
85 sed -i 's@dataplot unix /usr/local/bin/dataplot@dataplot unix /usr/bin/dataplot@' frscript/xdpConfig
86 sed -i 's@library unix /usr/local/lib/dataplot@library unix /usr/share/dataplot@' frscript/xdpConfig
88 # - Symbolic link for xdataplot in /usr/bin
89 ln -s /usr/share/dataplot/frscript/xdataplot ${pkgdir}/usr/bin/xdataplot
91 # Icon and .desktop files
92 mkdir -p ${pkgdir}/usr/share/pixmaps
93 /usr/bin/convert ${pkgdir}/usr/share/dataplot/frscript/xdpIcon.xbm \
94 ${pkgdir}/usr/share/pixmaps/xdataplot.png || return 1
95 mkdir -p ${pkgdir}/usr/share/applications
96 install -m 644 ${srcdir}/xdataplot.desktop ${pkgdir}/usr/share/applications/ || return 1
98 # Copying dataplot.sh to ${pkgdir}/etc/profile.d so dataplot will know
100 mkdir -p ${pkgdir}/etc/profile.d/
101 cp ${srcdir}/dataplot.sh ${pkgdir}/etc/profile.d/
104 mkdir -p ${pkgdir}/usr/share/licenses/${pkgname}
105 cat > ${pkgdir}/usr/share/licenses/${pkgname}/${pkgname}.txt << EOF
106 http://www.itl.nist.gov/div898/software/dataplot/disclaim.htm
110 This software was developed at the National Institute of Standards and Technology by
111 employees of the Federal Government in the course of their official duties. Persuant
112 to title 17 section 105 of the United States Code this software is not subject to
113 copyright protection and is in the public domain. Dataplot is an experimental system.
114 NIST assumes no responsibility whatsoever for its use by other parties, and makes no
115 guarantees, expressed or implied, about its quality, reliability, or any other
119 # Correcting the permissions and user/group owners
120 find ${pkgdir}/ -type f -exec chmod 644 {} \;
121 find ${pkgdir}/ -type d -exec chmod 755 {} \;
122 chown -R root:root ${pkgdir}/*
123 chmod 755 ${pkgdir}/etc/profile.d/dataplot.sh
124 chmod 755 ${pkgdir}/usr/bin/dataplot
125 chmod 755 ${pkgdir}/usr/share/dataplot/frscript/xdataplot
126 chmod 755 ${pkgdir}/usr/share/dataplot/frscript/xdp
129 md5sums=('d69caec4a853043dc6c4390da61cc34f'
130 '6f978d7df658207bf64a08c1edb57b6b'
131 'ba4d5a06ca69fa8878c559f4ad6ba73b'
132 'd212f5842a9bab712d6353dbb66198d8'
133 '5cd4b7779bbfb926bf9daf27d0bd5faf')