summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b9b8bf8aea57c081b0592c31dffb70946470dac6 (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
# Maintainer: WhiredPlanck

pkgname=astap-bin
_pkgname=astap
pkgver=2023.05.31
pkgrel=2
pkgdesc="Astrometric (plate) solver, stacking of images, photometry and FITS viewer. Gtk2 version."
arch=('i686' 'x86_64')
url="http://www.hnsky.org/astap.htm"
license=('GPL')
source_i686=("${_pkgname}_i386.deb::https://sourceforge.net/projects/astap-program/files/linux_installer/astap_i386.deb/download")
source_x86_64=("${_pkgname}_amd64.deb::https://sourceforge.net/projects/astap-program/files/linux_installer/astap_amd64.deb/download")
sha256sums_i686=('a3d2fd2b941979da09e520d32d340beb20786b3e75e1d60e740d0b5c8e2ca8e1')
sha256sums_x86_64=('667c0db4ca252407bbc6a893349f9c46b1177e3171e1d9dfbe8bdda26cd1b89b')
optdepends=('hyperleda-galaxy-db-astap: 25MB database of 1.3m galaxies and 171k other non-star objects'
            'w08-star-db-astap: 250KB database of stars up to magnitude 8, reliable above 20° FOV'
	    'd05-star-db-astap: 100MB database of 500 stars per square degree, reliable with 0.6-10° FOV'
	    'd20-star-db-astap: 400MB database of 2000 stars per square degree, reliable with 0.3-10° FOV'
            'd50-star-db-astap: 900MB database of 5000 stars per square degree, reliable with 0.2-10° FOV')

mkinfo() { echo -e "[\e[96mMKINFO\e[0m]:  \e[1m$*\e[0m"; }


build() {
    if [[ "$CARCH" == "i686" ]]; then
      ar x "${srcdir}/${_pkgname}_i386.deb"
    else
      ar x "${srcdir}/${_pkgname}_amd64.deb"
    fi
}

package() {
    mkinfo "Extracting data.tat.xz ..."
    tar -xpvf "${srcdir}"/data.tar.xz

    mkinfo "Preparing needed directories ..."
    mkdir -pv "${pkgdir}"/usr/{bin,lib,licenses/"${_pkgname}"}

    mkinfo "Install binaries ..."
    cp -rv "${srcdir}"/opt/"${_pkgname}" "${pkgdir}"/usr/lib/

    mkinfo "Installing shared files ..."
    cp -rv "${srcdir}"/usr/share "${pkgdir}"/usr

    mkinfo "Installing licenses ..."
    install -Dvm644 "${pkgdir}"/usr/lib/"${_pkgname}"/*.txt \
        -t "${pkgdir}/usr/share/licenses/${_pkgname}"

    mkinfo "Modifying path to executable in desktop file ..."
    sed -e "s|Exec=/opt/astap/astap|Exec=astap|g" \
        -i "${pkgdir}"/usr/share/applications/*.desktop

    mkinfo "Removeing unneeded resources ..."
    rm -rv "${pkgdir}"/usr/lib/"${_pkgname}"/*.txt

    mkinfo "Creating application symlinks to /usr/bin ..."
    ln -sv ../lib/"${_pkgname}"/"${_pkgname}" "${pkgdir}"/usr/bin/"${_pkgname}"
}