# frozen_string_literal: true

lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "libptouch/version"

Gem::Specification.new do |spec|
  spec.name = "libptouch"
  spec.version = Libptouch::VERSION
  spec.authors = ["knb"]
  spec.email = ["knb@artif.org"]

  spec.summary = "FFI bindings for libptouch (Brother P-touch USB raster printing)"
  spec.description = [
    "Ruby wrapper around the ptouch_label C library libptouch.",
    "Supports PT-P900W, PT-P750W, PT-P710BT and related open_usb_vid_pid / --pid.",
    "Requires libptouch shared library (libusb, libpng)."
  ].join(" ")
  spec.license = "MIT"
  spec.required_ruby_version = ">= 3.0"
  repo = "https://gitea.artif.org/knb/ptouch_label"
  spec.homepage = repo
  spec.metadata["source_code_uri"] = repo
  spec.metadata["rubygems_mfa_required"] = "true"

  spec.files = Dir.chdir(__dir__) { Dir["lib/**/*.rb", "exe/*", "README.md"] }
  spec.bindir = "exe"
  spec.executables = ["ptouch-label", "ptouch-print-png"]
  spec.require_paths = ["lib"]

  spec.add_dependency "ffi", "~> 1.15"
end
