aboutsummaryrefslogtreecommitdiff
blob: 6f135fbca4909e5cdb330ad39c86d60ea4c78df3 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="4"

DESCRIPTION="a set of crystallographic tools mainly for Rietveld analysis"
HOMEPAGE="http://www.ill.eu/sites/fullprof/index.html"
SRC_URI="http://www.ill.eu/sites/fullprof/downloads/FullProf_Suite_Nov2012_Lin.tgz"
LICENSE="freedist HPND"
# There is no clear license specified. But according to Docs/Readme_Fp_Suite.txt
# those two seem to be appropriate.
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="+X +doc +examples"

RDEPEND="X? ( >=x11-libs/motif-2.3 )"

S="${WORKDIR}/"

src_install() {
        BASEDIR="/opt/fullprof"
        echo "FULLPROF=\"${BASEDIR}\"" > 99fullprof
        doenvd 99fullprof
        rm 99fullprof || die

        if use !examples; then
          rm -r Examples || die
        fi

        if use !doc; then
          rm -r Docs || die
          rm -r Html || die
        else
          # fix (html) documentation to actually work
          # as upstream is using inconsistent upper and lower case
          mv Docs docs || die
          cd docs || die
          for i in *.HTM; do
            mv "$i" "${i,,}" || die
          done
          mv "FullProf_Manual.pdf" "Fullprof_Manual.pdf" || die
          mv "Manual_FullProf_Studio.pdf" "Manual_Fullprof_Studio.pdf" || die
          mv "FullProf_News.htm" "Fullprof_News.htm" || die
          for i in FullProf_News_200?.htm; do
            mv "$i" "${i/FullProf/Fullprof}" || die
          done
          cd .. || die
        fi

        if use !X; then
          rm tfp tfp.set winplotr-2006 check_group cryscal edpcr fp_studio || die
          rm gbasireps gbond_str gdatared gfourier gfourier.hlp gxlens || die
          rm powderpat resvis symmcal wfp2k winplotr.* || die
          rm -r Fps_Icons || die
        fi

        mkdir -p "${D}/${BASEDIR}" || die
        # make symlinks
        for i in * ; do
          [[ -x $i && ! -d $i ]] && dosym "../fullprof/${i}" /opt/bin/"${i##*/}"
        done
        mv "${S}"/* "${D}/${BASEDIR}" || die
}