#!/usr/bin/make -f

PACKAGE := ms-edit

%:
	dh $@

override_dh_install:
	#rustup install nightly
	#rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
	#cargo build --config .cargo/release.toml --release
	install -d debian/$(PACKAGE)/usr/share/applications/
	install -d debian/$(PACKAGE)/usr/bin/
	install -d debian/$(PACKAGE)/etc/
	install -d debian/$(PACKAGE)/usr/share/doc/$(PACKAGE)
	install -d debian/$(PACKAGE)/usr/share/metainfo/
	install -m 644 LICENSE debian/$(PACKAGE)/usr/share/doc/$(PACKAGE)/LICENSE
	install -m 644 assets/com.microsoft.edit.desktop debian/$(PACKAGE)/usr/share/applications/
	install -d debian/ms-edit/usr/share/icons/hicolor/scalable/apps/
	install -m 644 assets/edit.svg debian/ms-edit/usr/share/icons/hicolor/scalable/apps/com.microsoft.edit.svg
	install -m 755 target/release/edit debian/$(PACKAGE)/usr/bin/edit
	install -m 644 assets/com.microsoft.edit.metainfo.xml debian/$(PACKAGE)/usr/share/metainfo/com.microsoft.edit.metainfo.xml
	dh_install
