{% set version = "0.9-3" %}

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

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

source:
  fn: maptools_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/maptools_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/maptools/maptools_{{ version }}.tar.gz
  sha256: 289f5051e6b562f7a5e88fdcf8db9fa01b0e4261f7c5c7330ef3a71a03d8ab43

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base
    - r-foreign >=0.8
    - r-lattice
    - r-sp >=1.0_11

  run:
    - r-base
    - r-foreign >=0.8
    - r-lattice
    - r-sp >=1.0_11

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

about:
  home: http://r-forge.r-project.org/projects/maptools/
  license: GPL (>= 2)
  summary: Set of tools for manipulating and reading geographic data, in particular 'ESRI Shapefiles';
    C code used from 'shapelib'. It includes binary access to 'GSHHG' shoreline files.
    The package also provides interface wrappers for exchanging spatial objects with
    packages such as 'PBSmapping', 'spatstat', 'maps', 'RArcInfo', 'Stata tmap', 'WinBUGS',
    'Mondrian', and others.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
