Skip to content

Commit

Permalink
[enh] Add debian subdirectory and change root yolo structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Lebleu committed Jan 31, 2015
1 parent eebefb8 commit 3a76e95
Show file tree
Hide file tree
Showing 47 changed files with 991 additions and 1,207 deletions.
1,207 changes: 0 additions & 1,207 deletions actionsmap/yunohost.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
471 changes: 471 additions & 0 deletions debian/changelog

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
21 changes: 21 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Source: moulinette-yunohost
Section: net
Priority: extra
Maintainer: Jérôme Lebleu <[email protected]>
Build-Depends: debhelper (>=8.0.0)
Standards-Version: 3.9.4
Homepage: https://yunohost.org/

Package: moulinette-yunohost
Architecture: all
Depends: moulinette,
python-psutil,
python-requests,
glances,
python-pip,
rubygems,
pyminiupnpc,
dnsutils
Description: YunoHost Python scripts
Python functions to manage a YunoHost instance

339 changes: 339 additions & 0 deletions debian/copyright

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bin/* /usr/bin/
data/actionsmap/* /usr/share/moulinette/actionsmap/
data/hooks/* /usr/share/yunohost/hooks/
data/other/* /usr/share/yunohost/yunohost-config/moulinette/
lib/yunohost/* /usr/lib/moulinette/yunohost/
locales/* /usr/lib/moulinette/yunohost/locales/
74 changes: 74 additions & 0 deletions debian/moulinette-yunohost.yunohost-api.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#! /bin/bash
### BEGIN INIT INFO
# Provides: yunohost-api
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop YunoHost API
### END INIT INFO

DAEMON=/usr/bin/yunohost-api
DAEMON_OPTS=""

test -x $DAEMON || exit 0

. /lib/lsb/init-functions

logger "YunoHost API: Start script executed"

case "$1" in
start)
logger "YunoHost API: Starting"
log_daemon_msg "Starting API: YunoHost"
if [[ -f /etc/nginx/conf.d/openresty.conf ]];
then
DAEMON_OPTS="--no-websocket"
fi
start-stop-daemon --start --background --pidfile /var/run/yunohost-api.pid --make-pidfile \
--exec /bin/bash -- -c "$DAEMON $DAEMON_OPTS >> /var/log/yunohost.log 2>&1"
log_end_msg $?
;;
stop)
logger "YunoHost API: Stopping"
log_daemon_msg "Stopping API: YunoHost"
if [ -f /var/run/yunohost-api.pid ]; then
kill `cat /var/run/yunohost-api.pid` > /dev/null 2>&1
rm -f /var/run/yunohost-api.pid
fi
kill `ps aux | grep 'python /usr/bin/yunohost-api' | grep -v grep | awk '{print $2}'` > /dev/null 2>&1
kill `ps aux | grep 'yunohost-api' | grep -v grep | grep -v stop | awk '{print $2}'` > /dev/null 2>&1
log_end_msg 0
;;
restart)
logger "YunoHost API: Restarting"
log_daemon_msg "Restarting API: YunoHost"
if [ -f /var/run/yunohost-api.pid ]; then
kill `cat /var/run/yunohost-api.pid` > /dev/null 2>&1
rm -f /var/run/yunohost-api.pid
fi
kill `ps aux | grep 'python /usr/bin/yunohost-api' | grep -v grep | awk '{print $2}'` > /dev/null 2>&1
kill `ps aux | grep 'yunohost-api' | grep -v grep | grep -v restart | awk '{print $2}'` > /dev/null 2>&1
kill `ps aux | grep 'yunohost.tac' | grep -v grep | awk '{print $2}'` > /dev/null 2>&1
if [[ -f /etc/nginx/conf.d/openresty.conf ]];
then
DAEMON_OPTS="--no-websocket"
fi
start-stop-daemon --start --background --pidfile /var/run/yunohost-api.pid --make-pidfile \
--exec /bin/bash -- -c "$DAEMON $DAEMON_OPTS >> /var/log/yunohost.log 2>&1"
log_end_msg $?
;;
status)
logger "YunoHost API: Running"
log_daemon_msg "YunoHost API: Running"
cat /var/run/yunohost-api.pid > /dev/null 2>&1
log_end_msg $?
;;
*)
logger "YunoHost API: Invalid usage"
echo "Usage: /etc/init.d/yunohost-api {start|stop|restart|status}" >&2
exit 1
;;
esac

exit 0
56 changes: 56 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

TMP=/usr/share/yunohost/yunohost-config/moulinette

if [ ! -d /etc/yunohost ];
then
mkdir -p /etc/yunohost
fi

# Allow users to access /media directory
if [ ! -d /etc/skel/media ];
then
mkdir -p /media
ln -s /media /etc/skel/
fi

#Firewall
grep -q "UPNP:" /etc/yunohost/firewall.yml > /dev/null 2>&1
if [[ $? -eq 0 ]] || [ ! -f /etc/yunohost/firewall.yml ];
then
cp $TMP/firewall.yml /etc/yunohost/
fi

# App fetchlist
if [ -f /etc/cron.d/yunohost-applist-yunohost ];
then
sed -i "s/--no-ldap //g" /etc/cron.d/yunohost-applist-yunohost
fi

# Service list
if [ ! -f /etc/yunohost/services.yml ];
then
cp $TMP/services.yml /etc/yunohost/
fi

# Stop old API
ps aux | grep "yunohost.tac" | grep -qv grep
if [[ $? -eq 0 ]];
then
killall twistd
fi

rm -rf /var/cache/moulinette/*
update-rc.d yunohost-api defaults
service yunohost-api restart

# Reload SSOwat conf if obsolete
if [ -f /etc/yunohost/installed ];
then
yunohost firewall upnp | grep -qi "true"
if [[ $? -eq 0 ]];
then
yunohost firewall upnp enable
fi
yunohost app ssowatconf
fi
11 changes: 11 additions & 0 deletions debian/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

if [ -f /etc/init.d/yunohost-api ]; then
service yunohost-api stop
# nc -zv 127.0.0.1 6787 < /dev/null 2> /dev/null
# if [[ ! $? -eq 0 ]];
# then
# exit 1
# fi
fi
11 changes: 11 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
dh $@

override_dh_installinit:
dh_installinit --name=yunohost-api
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3a76e95

Please sign in to comment.