# -*- makefile -*-

# The debian/local/ directory contains a stripped down version of the
# v1 sources that are needed to build yubikey-agent, which as of
# 2026-01-11 is the only remaining package in Debian that needs v1.

# We hope that upstream will migrated to v2+:
# https://github.com/FiloSottile/yubikey-agent/issues/161

# yubikey-agent 0.1.6-2 go.mod pins on github.com/go-piv/piv-go
# v1.10.0 so that is why we pull in that version.

# You may update the vendored code by running:
#
# make -f debian/README.source

all:
	rm -rfv debian/local
	mkdir -pv debian/local
	wget -nv -O debian/local/piv.go "https://raw.githubusercontent.com/go-piv/piv-go/refs/tags/v1.10.0/piv/piv.go"
	wget -nv -O debian/local/pcsc.go "https://raw.githubusercontent.com/go-piv/piv-go/refs/tags/v1.10.0/piv/pcsc.go"
	wget -nv -O debian/local/pcsc_linux.go "https://raw.githubusercontent.com/go-piv/piv-go/refs/tags/v1.10.0/piv/pcsc_linux.go"
	wget -nv -O debian/local/pcsc_unix.go "https://raw.githubusercontent.com/go-piv/piv-go/refs/tags/v1.10.0/piv/pcsc_unix.go"
	wget -nv -O debian/local/pcsc_errors.go "https://raw.githubusercontent.com/go-piv/piv-go/refs/tags/v1.10.0/piv/pcsc_errors.go"
	wget -nv -O debian/local/key.go "https://raw.githubusercontent.com/go-piv/piv-go/refs/tags/v1.10.0/piv/key.go"

.PHONY: all
