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

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

source:
  fn: ztable_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/ztable_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/ztable/ztable_{{ version }}.tar.gz
  sha256: 9e4b196b934e6f32200f9661b3efef1f065b0b1590531ec64db06917cb84f33c

build:
  merge_build_host: True  # [win]
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-rcolorbrewer
    - r-flextable
    - r-magrittr
    - r-moonbook
    - r-officer
    - r-scales
    - r-stringr
  run:
    - r-base
    - r-rcolorbrewer
    - r-flextable
    - r-magrittr
    - r-moonbook
    - r-officer
    - r-scales
    - r-stringr

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

about:
  home: http://github.com/cardiomoon/ztable
  license: GPL-2
  summary: Makes zebra-striped tables (tables with alternating row colors) in LaTeX and HTML
    formats easily from a data.frame, matrix, lm, aov, anova, glm, coxph, nls, fitdistr,
    mytable and cbind.mytable objects.
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-2'  # [win]

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
