{% set version = '1.0.1' %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-satellite
  version: {{ version|replace("-", "_") }}

source:
  fn: satellite_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/satellite_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/satellite/satellite_{{ version }}.tar.gz
  sha256: 20fa9bda1fd063f0eaaf68dba1f86ca5fbbb9ee4251e78a5a0a6acdd34fd1fbd

build:
  number: 0
  script: R CMD INSTALL --build .
  skip: True  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-rcpp
    - r-plyr
    - r-raster
    - posix  # [win]
    - {{native}}toolchain  # [win]
    - gcc  # [not win]
  run:
    - r-base
    - r-rcpp
    - r-plyr
    - r-raster
    - libgcc  # [not win]

test:
  commands:
    - $R -e "library('satellite')"  # [not win]
    - "\"%R%\" -e \"library('satellite')\""  # [win]

about:
  home: https://CRAN.R-project.org/package=satellite
  license: GPL (>= 3)
  license_file: LICENSE
  summary: Herein, we provide a broad variety of functions which are useful for handling, manipulating,
    and visualizing satellite-based remote sensing  data. These operations range from
    mere data import and layer handling (eg  subsetting), over Raster* typical data
    wrangling (eg crop, extend), to more  sophisticated (pre-)processing tasks typically
    applied to satellite imagery  (eg atmospheric and topographic correction). This
    functionality is  complemented by a full access to the satellite layers' metadata
    at any  stage and the documentation of performed actions in a separate log file.  Currently
    available sensors include Landsat 4-5 (TM), 7 (ETM+), and 8  (OLI/TIRS Combined),
    and additional compatibility is ensured for the Landsat  Global Land Survey data
    set. Moreover, support for Terra and Aqua-MODIS as  well as PROBA-V is expected
    to arrive shortly.

extra:
  recipe-maintainers:
    - ocefpaf
