updated on Thu Jan 19 00:16:31 UTC 2012
[aur-mirror.git] / dataplot / PKGBUILD
blobf8f213d2997f4511d018ca27c2cf265118995dd0
1 # Contributor: Tom < reztho at archlinux dot us >
3 # Thanks to Alan Heckert from NIST for his support
5 pkgname=dataplot
6 pkgver=2009_08_21
7 pkgrel=4
8 pkgdesc="Software for scientific visualization, statistical analysis, and non-linear modeling."
9 arch=('i686' 'x86_64')
10 url="http://www.itl.nist.gov/div898/software/dataplot.html/"
11 license=('custom')
12 depends=('gd' 'gcc-libs' 'fontconfig' 'expat' 'libpng' 'zlib' 'libjpeg' 'libx11' 'freetype2' 'tcsh')
13 #'readline'
14 makedepends=('imagemagick' 'gcc-fortran')
15 backup=('usr/share/dataplot/frscript/xdpConfig')
16 _dplibver=2009_07_15
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"
21         "dataplot.sh"
22         "xdataplot.desktop")
23 noextract=("dpsrc_${pkgver}.tar.gz"
24                "dplib.${pkgver}.tar.gz")
26 build() {
28   # I make the directory for the dataplot source files
29   if [ ! -d ${srcdir}/dpsrc ];then
30           mkdir -p ${srcdir}/dpsrc
31   fi
32   cd ${srcdir}/dpsrc
33   bsdtar -xf ${srcdir}/dpsrc_${pkgver}.tar.gz
34   
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}
57   fi
59   # Running the build script
60   chmod +x ${_build_script}
61   ./${_build_script}
64 package() {
65   cd ${srcdir}/dpsrc
66   
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
99   # where its files are
100   mkdir -p ${pkgdir}/etc/profile.d/
101   cp ${srcdir}/dataplot.sh ${pkgdir}/etc/profile.d/
102   
103   # License/Disclaimer
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
108 DATAPLOT Disclaimer
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
116 characteristic. 
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')