emmental/Makefile

68 lines
1.9 KiB
Makefile

# Copyright 2019 (c) Anna Schumaker.
export PREFIX = /usr/local
export EMMENTAL_LIB = ${PREFIX}/lib/emmental
export EMMENTAL_BIN = ${PREFIX}/bin
export EMMENTAL_SHARE = ${PREFIX}/share
all: emmental.gresource mpris2 flake8
clean:
find . -type f -name "*gresource*" -exec rm {} \+
find . -type d -name __pycache__ -exec rm -r {} \+
find emmental/mpris2/ -type f -name "*.xml" -exec rm {} \+
find data/ -type d -name "Test Album" -exec rm -r {} \+
find data/ -type d -name "Test Library" -exec rm -r {} \+
.PHONY:flake8
flake8:
flake8 emmental/ tests/
mpris-spec/Makefile:
git submodule init mpris-spec
git submodule update
emmental/mpris2/MediaPlayer2.xml: mpris-spec/Makefile
cp mpris-spec/spec/org.mpris.MediaPlayer2.xml emmental/mpris2/MediaPlayer2.xml
.PHONY: mpris2
mpris2: emmental/mpris2/MediaPlayer2.xml
.PHONY: emmental.gresource.xml
emmental.gresource.xml:
exec tools/find-resources.py
.PHONY: emmental.gresource
emmental.gresource: emmental.gresource.xml
glib-compile-resources emmental.gresource.xml
.PHONY: install
install: emmental.gresource
exec tools/install.sh
.PHONY: uninstall
uninstall:
rm -fv ${EMMENTAL_BIN}/emmental
rm -rfv ${EMMENTAL_LIB}
rm -fv ${EMMENTAL_SHARE}/icons/hicolor/scalable/apps/emmental*.svg
rm -fv ${EMMENTAL_SHARE}/applications/emmental.desktop
.PHONY: pkgbuild
pkgbuild:
$(eval MAJOR := $(shell grep \^MAJOR lib/version.py | awk -F= '{ gsub(/ /,""); print $$2}'))
$(eval MINOR := $(shell grep \^MINOR lib/version.py | awk -F= '{ gsub(/ /,""); print $$2}'))
$(eval TAG := $(shell git describe --tags --abbrev=0))
$(eval CSUM := $(shell git archive --format tar.gz $(TAG) | sha256sum | awk '{print $$1}'))
cp data/PKGBUILD aur/
sed -i 's|{MAJOR}.{MINOR}|${MAJOR}.${MINOR}|' aur/PKGBUILD
sed -i 's|{SHA256SUM}|$(CSUM)|' aur/PKGBUILD
cd aur && makepkg --printsrcinfo > .SRCINFO
.PHONY: pytest
pytest: emmental.gresource mpris2
pytest
.PHONY: tests
tests: pytest flake8