#!/usr/bin/make -f

%:
	dh $@

# Makefile does not follow any conventions
override_dh_auto_install:
	true

override_dh_strip:
	dh_strip -Xstart.elf -Xstart4.elf

override_dh_install:
	# Copy the pinned firmware version
	rm -rf temp
	mkdir -p temp/firmware/2711
	mkdir -p temp/firmware/2712

	cp /lib/firmware/raspberrypi/bootloader-2711/latest/pieeprom-2024-07-30.bin temp/firmware/2711/pieeprom.bin
	cp /lib/firmware/raspberrypi/bootloader-2711/latest/recovery.bin temp/firmware/2711/recovery.bin
	cp /lib/firmware/raspberrypi/bootloader-2712/latest/pieeprom-2024-09-23.bin temp/firmware/2712/pieeprom.bin
	cp /lib/firmware/raspberrypi/bootloader-2712/latest/recovery.bin temp/firmware/2712/recovery.bin
	dh_install
	find $(CURDIR)/debian -name .gitignore -delete
	rm -rf temp
