Move apps into share directory

This commit is contained in:
Bob Mottram 2016-07-06 20:06:57 +01:00
parent 94b3b80aa9
commit c4abe22744
7 changed files with 22 additions and 70 deletions

View File

@ -16,6 +16,7 @@ source:
gzip -f9n ../${APP}_${VERSION}.orig.tar gzip -f9n ../${APP}_${VERSION}.orig.tar
install: install:
mkdir -p ${DESTDIR}${PREFIX}/bin mkdir -p ${DESTDIR}${PREFIX}/bin
mkdir -p ${DESTDIR}/usr/share/${APP}/apps
mkdir -p ${DESTDIR}/etc/${APP} mkdir -p ${DESTDIR}/etc/${APP}
cp -r image_build/* ${DESTDIR}/etc/${APP} cp -r image_build/* ${DESTDIR}/etc/${APP}
install -m 755 img/backgrounds/${APP}_mesh_background.png ${DESTDIR}${PREFIX}/share install -m 755 img/backgrounds/${APP}_mesh_background.png ${DESTDIR}${PREFIX}/share
@ -27,6 +28,7 @@ install:
install -m 755 src/${APP}-backup-local ${DESTDIR}${PREFIX}/bin/backup2friends install -m 755 src/${APP}-backup-local ${DESTDIR}${PREFIX}/bin/backup2friends
install -m 755 src/${APP}-restore-local ${DESTDIR}${PREFIX}/bin/restore install -m 755 src/${APP}-restore-local ${DESTDIR}${PREFIX}/bin/restore
install -m 755 src/${APP}-restore-remote ${DESTDIR}${PREFIX}/bin/restorefromfriend install -m 755 src/${APP}-restore-remote ${DESTDIR}${PREFIX}/bin/restorefromfriend
mv ${DESTDIR}${PREFIX}/bin/${APP}-app-* ${DESTDIR}/usr/share/${APP}/apps
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/man/man1 mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/man/man1
install -m 644 man/*.1.gz ${DESTDIR}${PREFIX}/share/man/man1 install -m 644 man/*.1.gz ${DESTDIR}${PREFIX}/share/man/man1
install -m 644 man/${APP}-backup-local.1.gz ${DESTDIR}${PREFIX}/share/man/man1/backup.1.gz install -m 644 man/${APP}-backup-local.1.gz ${DESTDIR}${PREFIX}/share/man/man1/backup.1.gz

View File

@ -446,11 +446,7 @@ function mesh_tox_node_remove {
function mesh_tox_node { function mesh_tox_node {
# obtain commits from the main file # obtain commits from the main file
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXCORE_COMMIT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXCORE_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
TOXCORE_COMMIT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXCORE_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
else
TOXCORE_COMMIT_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXCORE_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
fi
if [ ${#TOXCORE_COMMIT_MAIN} -gt 10 ]; then if [ ${#TOXCORE_COMMIT_MAIN} -gt 10 ]; then
TOXCORE_COMMIT=$TOXCORE_COMMIT_MAIN TOXCORE_COMMIT=$TOXCORE_COMMIT_MAIN
fi fi
@ -459,11 +455,7 @@ function mesh_tox_node {
exit 76325 exit 76325
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXID_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
TOXID_REPO_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
else
TOXID_REPO_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
fi
if [ ${#TOXID_REPO_MAIN} -gt 5 ]; then if [ ${#TOXID_REPO_MAIN} -gt 5 ]; then
TOXID_REPO=$TOXID_REPO_MAIN TOXID_REPO=$TOXID_REPO_MAIN
fi fi
@ -472,11 +464,7 @@ function mesh_tox_node {
exit 78252 exit 78252
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOX_PORT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
TOX_PORT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
else
TOX_PORT_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
fi
if [ ${#TOX_PORT_MAIN} -gt 2 ]; then if [ ${#TOX_PORT_MAIN} -gt 2 ]; then
TOX_PORT=$TOX_PORT_MAIN TOX_PORT=$TOX_PORT_MAIN
fi fi
@ -485,11 +473,7 @@ function mesh_tox_node {
exit 32856 exit 32856
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXCORE_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXCORE_REPO=" | head -n 1 | awk -F '"' '{print $2}')
TOXCORE_REPO_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXCORE_REPO=" | head -n 1 | awk -F '"' '{print $2}')
else
TOXCORE_REPO_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXCORE_REPO=" | head -n 1 | awk -F '"' '{print $2}')
fi
if [ ${#TOXCORE_REPO_MAIN} -gt 10 ]; then if [ ${#TOXCORE_REPO_MAIN} -gt 10 ]; then
TOXCORE_REPO=$TOXCORE_REPO_MAIN TOXCORE_REPO=$TOXCORE_REPO_MAIN
fi fi
@ -595,27 +579,15 @@ function mesh_tox_client_remove {
} }
function mesh_tox_client { function mesh_tox_client {
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
else
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
fi
# obtain commits from the main file # obtain commits from the main file
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_COMMIT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
TOXIC_COMMIT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
else
TOXIC_COMMIT_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
fi
if [ ${#TOXIC_COMMIT_MAIN} -gt 10 ]; then if [ ${#TOXIC_COMMIT_MAIN} -gt 10 ]; then
TOXIC_COMMIT=$TOXIC_COMMIT_MAIN TOXIC_COMMIT=$TOXIC_COMMIT_MAIN
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_REPO=" | head -n 1 | awk -F '"' '{print $2}')
TOXIC_REPO_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_REPO=" | head -n 1 | awk -F '"' '{print $2}')
else
TOXIC_REPO_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_REPO=" | head -n 1 | awk -F '"' '{print $2}')
fi
if [ ${#TOXIC_REPO_MAIN} -gt 5 ]; then if [ ${#TOXIC_REPO_MAIN} -gt 5 ]; then
TOXIC_REPO=$TOXIC_REPO_MAIN TOXIC_REPO=$TOXIC_REPO_MAIN
fi fi
@ -684,11 +656,7 @@ function mesh_zeronet_remove {
function mesh_zeronet { function mesh_zeronet {
# obtain commits from the main file # obtain commits from the main file
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then ZERONET_COMMIT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
ZERONET_COMMIT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
else
ZERONET_COMMIT_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
fi
if [ ${#ZERONET_COMMIT_MAIN} -gt 10 ]; then if [ ${#ZERONET_COMMIT_MAIN} -gt 10 ]; then
ZERONET_COMMIT=$ZERONET_COMMIT_MAIN ZERONET_COMMIT=$ZERONET_COMMIT_MAIN
fi fi
@ -697,11 +665,7 @@ function mesh_zeronet {
exit 37046 exit 37046
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then ZERONET_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_REPO_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_REPO=" | head -n 1 | awk -F '"' '{print $2}')
else
ZERONET_REPO_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_REPO=" | head -n 1 | awk -F '"' '{print $2}')
fi
if [ ${#ZERONET_REPO_MAIN} -gt 5 ]; then if [ ${#ZERONET_REPO_MAIN} -gt 5 ]; then
ZERONET_REPO=$ZERONET_REPO_MAIN ZERONET_REPO=$ZERONET_REPO_MAIN
fi fi
@ -710,11 +674,7 @@ function mesh_zeronet {
exit 37046 exit 37046
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then ZERONET_PORT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_PORT=" | head -n 1 | awk -F '=' '{print $2}')
ZERONET_PORT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_PORT=" | head -n 1 | awk -F '=' '{print $2}')
else
ZERONET_PORT_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_PORT=" | head -n 1 | awk -F '=' '{print $2}')
fi
if [ ${#ZERONET_PORT_MAIN} -gt 1 ]; then if [ ${#ZERONET_PORT_MAIN} -gt 1 ]; then
ZERONET_PORT=$ZERONET_PORT_MAIN ZERONET_PORT=$ZERONET_PORT_MAIN
fi fi
@ -796,11 +756,7 @@ function mesh_zeronet {
} }
function install_batman_client { function install_batman_client {
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
else
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
fi
if [ ! -f ${rootdir}/tmp/meshtype ]; then if [ ! -f ${rootdir}/tmp/meshtype ]; then
$CHROOT_PREFIX sudo apt-get -y install iproute bridge-utils libnetfilter-conntrack3 batctl $CHROOT_PREFIX sudo apt-get -y install iproute bridge-utils libnetfilter-conntrack3 batctl

View File

@ -58,7 +58,7 @@ if [ ! -f $MAIN_COMMAND ]; then
MAIN_COMMAND=/usr/bin/${PROJECT_NAME} MAIN_COMMAND=/usr/bin/${PROJECT_NAME}
fi fi
REPOS=($(cat ${MAIN_COMMAND} ${MAIN_COMMAND}-utils-* ${MAIN_COMMAND}-app-* | grep "_REPO=\"" | uniq -u | sed 's|${PROJECT_NAME}|'"${PROJECT_NAME}"'|g')) REPOS=($(cat ${MAIN_COMMAND} ${MAIN_COMMAND}-utils-* /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-* | grep "_REPO=\"" | uniq -u | sed 's|${PROJECT_NAME}|'"${PROJECT_NAME}"'|g'))
# obtain the mirrors password if it exists # obtain the mirrors password if it exists

View File

@ -58,11 +58,7 @@ function test_app_function_type {
} }
function test_app_functions { function test_app_functions {
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
FILES=/usr/local/bin/${PROJECT_NAME}-app-*
else
FILES=/usr/bin/${PROJECT_NAME}-app-*
fi
# check that these functions exist # check that these functions exist
interface_functions=( install remove backup_local backup_remote upgrade ) interface_functions=( install remove backup_local backup_remote upgrade )

View File

@ -65,7 +65,7 @@ function get_apps_installed {
} }
function detect_apps { function detect_apps {
FILES=$PROJECT_INSTALL_DIR/${PROJECT_NAME}-app-* FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
APPS_AVAILABLE=() APPS_AVAILABLE=()
APPS_CHOSEN=() APPS_CHOSEN=()
@ -89,7 +89,7 @@ function detect_apps {
function choose_apps_for_variant { function choose_apps_for_variant {
variant_name="$1" variant_name="$1"
FILES=$PROJECT_INSTALL_DIR/${PROJECT_NAME}-app-* FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
APPS_AVAILABLE=() APPS_AVAILABLE=()
APPS_CHOSEN=() APPS_CHOSEN=()

View File

@ -236,10 +236,8 @@ function remove_default_user {
} }
function upgrade_installation { function upgrade_installation {
if [ ! -d /usr/share/${PROJECT_NAME}/apps ]; then # TODO
mkdir -p /usr/share/${PROJECT_NAME}/apps echo ''
fi
mv /usr/local/bin/${PROJECT_NAME}-app-* /usr/share/${PROJECT_NAME}/apps
} }
function setup_firewall { function setup_firewall {

View File

@ -88,8 +88,8 @@ do
done done
#include apps #include apps
APP_FILES=$PROJECT_INSTALL_DIR/${PROJECT_NAME}-app-* APP_FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
for f in $UTILS_FILES for f in $APP_FILES
do do
source $f source $f
done done