{% set version = '1.4-4' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/rgdal_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/rgdal/rgdal_{{ version }}.tar.gz
  sha256: 2532e76e0af27d145f799d70006a5dbecb2d3be698e3d0bbf580f4c41a34c5d7

build:
  merge_build_host: True  # [win]
  # If this is a new build for the same version, increment the build number.
  number: 0

  # This is required to make R link correctly on Linux.
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}sed               # [win]
    - {{posix}}grep              # [win]
    - {{posix}}autoconf
    - {{posix}}automake          # [not win]
    - {{posix}}automake-wrapper  # [win]
    - {{posix}}pkg-config
    - {{posix}}make
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]

  host:
    - r-base
    - r-sp >=1.1_0
    - gdal >=1.11.4
    - libgdal >=1.11.4
    -  proj4

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-sp >=1.1_0
    - gdal >=1.11.4
    - proj4

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('rgdal')"           # [not win]
    - "\"%R%\" -e \"library('rgdal')\""  # [win]

  # You can also put a file called run_test.py, run_test.sh, or run_test.bat
  # in the recipe that will be run at test time.

  # requires:
    # Put any additional test requirements here.

about:
  home: http://rgdal.r-forge.r-project.org, https://www.gdal.org, https://proj4.org, https://r-forge.r-project.org/projects/rgdal/
  license: GPL-2
  summary: 'Provides bindings to the ''Geospatial'' Data Abstraction Library (''GDAL'') (>= 1.11.4)
    and access to projection/transformation operations from the ''PROJ.4'' library.
    The ''GDAL'' and ''PROJ.4'' libraries are external to the package, and, when installing
    the package from source, must be correctly installed first. From ''rgdal'' 1.4.1,
    provision is made for ''PROJ6'' accommodation, with ''PROJ6'' functionality to follow;
    from 1.4.1 ''rgdal'' will build and function when ''PROJ'' >= 6. Both ''GDAL'' raster
    and ''OGR'' vector map data can be imported into R, and ''GDAL'' raster data and
    ''OGR'' vector data exported. Use is made of classes defined in the ''sp'' package.
    Windows and Mac Intel OS X binaries (including ''GDAL'', ''PROJ.4'' and ''Expat'')
    are provided on ''CRAN''. '

  license_family: GPL2
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

extra:
  recipe-maintainers:
    - katietz

# The original CRAN metadata for this package was:

# Package: rgdal
# Title: Bindings for the 'Geospatial' Data Abstraction Library
# Version: 1.4-4
# Date: 2019-05-03
# Depends: R (>= 3.3.0), methods, sp (>= 1.1-0)
# Imports: grDevices, graphics, stats, utils
# LinkingTo: sp
# NeedsCompilation: yes
# Description: Provides bindings to the 'Geospatial' Data Abstraction Library ('GDAL') (>= 1.11.4) and access to projection/transformation operations from the 'PROJ.4' library. The 'GDAL' and 'PROJ.4' libraries are external to the package, and, when installing the package from source, must be correctly installed first. From 'rgdal' 1.4.1, provision is made for 'PROJ6' accommodation, with 'PROJ6' functionality to follow; from 1.4.1 'rgdal' will build and function when 'PROJ' >= 6. Both 'GDAL' raster and 'OGR' vector map data can be imported into R, and 'GDAL' raster data and 'OGR' vector data exported. Use is made of classes defined in the 'sp' package. Windows and Mac Intel OS X binaries (including 'GDAL', 'PROJ.4' and 'Expat') are provided on 'CRAN'.
# Authors@R: c( person("Roger", "Bivand", role = c("cre", "aut"), email = "Roger.Bivand@nhh.no", comment=c(ORCID="0000-0003-2392-6140")), person("Tim", "Keitt", role = "aut"), person("Barry", "Rowlingson", role = c("aut", "ctb")), person("Edzer", "Pebesma", role = "ctb"), person("Michael", "Sumner", role = "ctb"), person("Robert", "Hijmans", role = "ctb"), person("Even", "Rouault", role = c("cph", "ctb")), person("Frank", "Warmerdam", role = c("cph", "ctb")), person("Jeroen", "Ooms", role = "ctb"), person("Colin", "Rundel", role = "ctb"))
# License: GPL (>= 2)
# URL: http://rgdal.r-forge.r-project.org, https://www.gdal.org, https://proj4.org, https://r-forge.r-project.org/projects/rgdal/
# SystemRequirements: for building from source: GDAL >= 1.11.4, library from https://trac.osgeo.org/gdal/wiki/DownloadSource and PROJ.4 (proj >= 4.8.0) from https://download.osgeo.org/proj/; GDAL OSX frameworks built by William Kyngesburye at http://www.kyngchaos.com/ may be used for source installs on OSX. For installation with older external dependencies, override configure checks with --configure-args="enable-deprecated=yes". Consider source installations using archived versions of rgdal contemporary with installed external dependencies, for example rgdal_0.8-7 for PROJ4 4.8.0 (March 2012).
# RoxygenNote: 6.1.1
# Packaged: 2019-05-28 11:02:46 UTC; rsb
# Author: Roger Bivand [cre, aut] (<https://orcid.org/0000-0003-2392-6140>), Tim Keitt [aut], Barry Rowlingson [aut, ctb], Edzer Pebesma [ctb], Michael Sumner [ctb], Robert Hijmans [ctb], Even Rouault [cph, ctb], Frank Warmerdam [cph, ctb], Jeroen Ooms [ctb], Colin Rundel [ctb]
# Maintainer: Roger Bivand <Roger.Bivand@nhh.no>
# Repository: CRAN
# Date/Publication: 2019-05-29 14:30:03 UTC

# See
# https://docs.conda.io/projects/conda-build for
# more information about meta.yaml
