# Version and year are read from the package metadata rather than typed here, so
# a release cannot leave the citation naming an older version. CRAN adds
# `Date/Publication` to the installed DESCRIPTION; a development install has no
# such field and falls back to the current year.
version <- meta$Version
year <- sub("-.*", "", meta$`Date/Publication`)
if (!length(year) || is.na(year) || !nzchar(year)) year <- format(Sys.Date(), "%Y")

citHeader("To cite gkwdist in publications use:")

bibentry(
  bibtype  = "Manual",
  title    = "{gkwdist}: Generalized Kumaraswamy Distribution Family",
  author   = person(given = "José Evandeilton",
                    family = "Lopes",
                    email = "evandeilton@gmail.com",
                    comment = c(ORCID = "0009-0007-5887-4084")),
  year     = year,
  note     = paste("R package version", version),
  url      = "https://CRAN.R-project.org/package=gkwdist",
  textVersion = paste0(
    "Lopes, J.E. (", year, "). ",
    "gkwdist: Generalized Kumaraswamy Distribution Family. ",
    "R package version ", version, ". ",
    "https://CRAN.R-project.org/package=gkwdist"
  )
)
