Create install and uninstall targets in the Makefile
And create helper scripts under tools/ Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
66e1ba8b44
commit
b0838beb6f
17
Makefile
17
Makefile
|
@ -1,10 +1,27 @@
|
|||
# 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
|
||||
|
||||
clean:
|
||||
find . -type d -name __pycache__ -exec rm -r {} \+
|
||||
find data/ -type d -name "Test Album" -exec rm -r {} \+
|
||||
find data/ -type d -name "Test Library" -exec rm -r {} \+
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
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: tests
|
||||
tests:
|
||||
python tools/generate_tracks.py
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
python {EMMENTAL_LIB}/emmental.py $*
|
|
@ -0,0 +1,10 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.5
|
||||
Name=Emmental
|
||||
GenericName=Music Player
|
||||
Comment=Listen to your music
|
||||
Exec={EMMENTAL_BIN}/emmental
|
||||
Icon=emmental
|
||||
Terminal=false
|
||||
Categories=AudioVideo;Audio;
|
|
@ -0,0 +1,44 @@
|
|||
#!/bin/bash
|
||||
|
||||
function install_file()
|
||||
{
|
||||
install -p -v $* | grep -v "^removed"
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Install source files
|
||||
#
|
||||
install -d -v -m 755 $EMMENTAL_LIB
|
||||
install_file -m 644 emmental.py $EMMENTAL_LIB/emmental.py
|
||||
|
||||
for dir in `tools/list_install_dirs.py`; do
|
||||
install -d -v -m 755 $EMMENTAL_LIB/$dir
|
||||
|
||||
files=`find $dir -not -name "test_*.py" -name "*.py"`
|
||||
install_file -m 644 $files $EMMENTAL_LIB/$dir/
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Install icons
|
||||
#
|
||||
EMMENTAL_ICONS=$EMMENTAL_SHARE/icons/hicolor/scalable/apps
|
||||
install -d -v -m 755 $EMMENTAL_ICONS
|
||||
install_file -m 644 data/hicolor/scalable/apps/*.svg $EMMENTAL_ICONS/
|
||||
|
||||
|
||||
#
|
||||
# Install and adjust executable
|
||||
#
|
||||
install -d -v -m 755 $EMMENTAL_BIN
|
||||
install_file -m 655 data/emmental $EMMENTAL_BIN/emmental
|
||||
sed -i "s|{EMMENTAL_LIB}|$EMMENTAL_LIB|" $EMMENTAL_BIN/emmental
|
||||
|
||||
|
||||
#
|
||||
# Install and adjust .desktop file
|
||||
#
|
||||
install -d -v -m 755 $EMMENTAL_SHARE/applications
|
||||
install_file -m 644 data/emmental.desktop $EMMENTAL_SHARE/applications
|
||||
sed -i "s|{EMMENTAL_BIN}|$EMMENTAL_BIN|" $EMMENTAL_SHARE/applications/emmental.desktop
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/python
|
||||
import pathlib
|
||||
|
||||
exclude = [ ".git", "data", "tools" ]
|
||||
|
||||
for p in pathlib.Path(".").iterdir():
|
||||
if p.is_dir() and not str(p) in exclude:
|
||||
print(p)
|
Loading…
Reference in New Issue