summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 424f8ee082e05fda636fa33741512be730e71b09 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Maintainer: Samuel Mesa <samuelmesa@linuxmail.org>
# Contributor: mbostwick <mbostwick89@gmail.com>
# Contributor: Christian Wygoda <accounts@wygoda.net>

pkgname=ossim
_pkgname=ossim
pkgver=2.12.0
pkgrel=1
pkgdesc="OSSIM is a powerful suite of geospatial libraries and applications used to process imagery, maps, terrain, and vector data."
url="http://www.ossim.org"
license=('LGPL')
arch=('i686' 'x86_64')
depends=('freetype2' 'gdal' 'libgeotiff' 'libjpeg' 'libtiff' 'openthreads' 'openjpeg'  'doxygen' 
'hdf5-cpp-fortran' 'minizip' 'expat' 'ffmpeg' 'qt5-base' 'podofo' 'bzip2' 'freetype2' 'pdal')
makedepends=('cmake')
optdepends=( 'java-environment-common' 'openmpi' 'gpstk-bin' )
source=(https://github.com/ossimlabs/ossim/archive/${pkgver}.tar.gz
        ossim.sh )
install=ossim.install
md5sums=('6b5930d3eca47555f4031480f8dc8847'
         'cb85c216a099b10f057cddeeae4a57fb')

build() {
  cd $srcdir

  #Build
    if [[ -d "$srcdir/build" ]]; then
    (rm -rf $srcdir/build)
  fi

  mkdir $srcdir/build
  cd $srcdir/build

  OSSIM_DEV_HOME="$srcdir/${pkgname}-${pkgver}";
  buildir="$srcdir/${pkgname}-${pkgver}";

  cmake -G "Unix Makefiles" \
  -DCMAKE_BUILD_TYPE=Release \
  -DFREETYPE_INCLUDE_DIR_ft2build=/usr/include/freetype2 \
  -DCMAKE_INSTALL_PREFIX=/usr \
  -DINSTALL_LIBRARY_DIR:PATH=/usr/lib \
  -DINSTALL_ARCHIVE_DIR:PATH=/usr/lib \
  -DBUILD_GDAL_PLUGIN=ON \
  -DBUILD_MRSID_PLUGIN=OFF \
  -DBUILD_OMS=ON \
  -DBUILD_OSSIM_APPS=ON \
  -DBUILD_OSSIM_CURL_APPS=OFF \
  -DBUILD_OSSIM_FREETYPE_SUPPORT=ON \
  -DBUILD_OSSIM_GUI=ON \
  -DBUILD_OSSIM_PLANET=ON \
  -DBUILD_OSSIM_VIDEO=ON \
  -DBUILD_OSSIM_HDF5_SUPPORT=OFF \
  -DBUILD_KAKADU_PLUGIN=OFF \
  -DBUILD_OSSIM_ID_SUPPORT=ON \
  -DBUILD_OSSIM_MPI_SUPPORT=OFF \
  -DBUILD_OSSIM_WMS=ON \
  -DBUILD_SHARED_LIBS=ON \
  -DBUILD_PDAL_PLUGIN=ON \
  $buildir \

  make -j$(nproc)
}


package() {

  cd $srcdir/build
  buildir="$srcdir/${pkgname}-${pkgver}";
  make DESTDIR=${pkgdir} install || return 1  

  sed -i -e 's|epsg_database_file1: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_epsg_projections-v7_4.csv|epsg_database_file1: $(OSSIM_DATA)/projection/ossim_epsg_projections-v7_4.csv|g' \
  ${buildir}/share/ossim/templates/ossim_preferences_template

  sed -i -e 's|epsg_database_file2: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_harn_state_plane_epsg.csv|epsg_database_file2: $(OSSIM_DATA)/projection/ossim_harn_state_plane_epsg.csv|g' \
  ${buildir}/share/ossim/templates/ossim_preferences_template
  
  sed -i -e 's|epsg_database_file3: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_state_plane_spcs.csv|epsg_database_file3: $(OSSIM_DATA)/projection/ossim_state_plane_spcs.csv|g' \
  ${buildir}/share/ossim/templates/ossim_preferences_template

  sed -i -e 's|epsg_database_file4: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_harn_state_plane_esri.csv|epsg_database_file4: $(OSSIM_DATA)/projection/ossim_harn_state_plane_esri.csv|g' \
  ${buildir}/share/ossim/templates/ossim_preferences_template

  sed -i -e 's|wkt_database_file: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_wkt_pcs.csv|wkt_database_file: $(OSSIM_DATA)/projection/ossim_wkt_pcs.csv|g' \
  ${buildir}/share/ossim/templates/ossim_preferences_template

  sed -i -e 's|geoid_ngs_directory: $(OSSIM_DATA)/ear1/geoid/geoid99|geoid_ngs_directory: $(OSSIM_DATA)/geoids/geoid99|g' \
  ${buildir}/share/ossim/templates/ossim_preferences_template

  sed -i -e 's|geoid_egm_96_grid: $(OSSIM_DATA)/ele1/geoid/geoid96/egm96.grd|geoid_egm_96_grid: $(OSSIM_DATA)/geoids/geoid1996/egm96.grd|g' \
  ${buildir}/share/ossim/templates/ossim_preferences_template

  # Install the templates file
  cp -r ${buildir}/share/ossim/templates ${pkgdir}/usr/share/ossim/

  # Install the configuration file
  mkdir ${pkgdir}/etc
  #install -D -m644 ${buildir}/ossim/etc/config_files/dbossim.cfg ${pkgdir}/etc/ossim/dbossim.cfg

  # Install profile.d file
  install -D ${srcdir}/ossim.sh \
  ${pkgdir}/etc/profile.d/ossim.sh

}