Commit d56e41f0 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

scripts to install from source/make bundle

parent 71c67ef2
......@@ -9,11 +9,7 @@ This is a syncing client for object storage.
Installation
------------
Simply unpack the tar. You will need the following python packages, that can
be installed with `pip install <package-name>':
kamaki>=0.13.3, ws4py, watchdog, psutil
Then run `launch'.
To install from source, run `configure.sh` and follow instructions.
Copyright and license
......
......@@ -16,6 +16,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
PATH = os.path.dirname(os.path.realpath(__file__))
LIBPATH = os.path.join(PATH, "lib")
sys.path.append(LIBPATH)
from agkyra import config
AGKYRA_DIR = config.AGKYRA_DIR
......@@ -29,6 +35,12 @@ HANDLER.setFormatter(FORMATTER)
LOGGER.addHandler(HANDLER)
LOGGER.setLevel(logging.DEBUG)
# # run GUI
from agkyra import gui
gui.run()
def main():
from agkyra.cli import AgkyraCLI
from sys import argv
AgkyraCLI().onecmd(' '.join(argv[1:] or ['help', ]))
if __name__ == "__main__":
main()
......@@ -16,6 +16,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
PATH = os.path.dirname(os.path.realpath(__file__))
LIBPATH = os.path.join(PATH, "lib")
sys.path.append(LIBPATH)
from agkyra import config
AGKYRA_DIR = config.AGKYRA_DIR
......@@ -29,7 +35,11 @@ HANDLER.setFormatter(FORMATTER)
LOGGER.addHandler(HANDLER)
LOGGER.setLevel(logging.INFO)
# run cli
from agkyra.cli import AgkyraCLI
from sys import argv
AgkyraCLI().onecmd(' '.join(argv[1:] or ['help', ]))
def main():
from agkyra import gui
gui.run()
if __name__ == "__main__":
main()
#!/bin/bash
# Copyright (C) 2015 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
CURPWD=$(pwd)
cd "$(dirname "$0")"
ROOTPATH=$(pwd)
./get_nwjs.sh $1
if [ $? -ne 0 ]; then
exit 1
fi
echo "Now run 'python setup.py install'."
#!/bin/bash
# Copyright (C) 2015 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
VERSION="v0.12.2"
CURPWD=$(pwd)
cd "$(dirname "$0")"
ROOTDIR=$(pwd)
declare -A nwjsfile
nwjsfile[win64]="nwjs-${VERSION}-win-x64.zip"
nwjsfile[osx64]="nwjs-${VERSION}-osx-x64.zip"
nwjsfile[linux64]="nwjs-${VERSION}-linux-x64.tar.gz"
nwjsfile[win32]="nwjs-${VERSION}-win-ia32.zip"
nwjsfile[osx32]="nwjs-${VERSION}-osx-ia32.zip"
nwjsfile[linux32]="nwjs-${VERSION}-linux-ia32.tar.gz"
if [[ -z $1 ]]; then
echo "Select one of:" ${!nwjsfile[@]}
exit 1
fi
os=$1
file=${nwjsfile[$os]}
url="http://dl.nwjs.io/${VERSION}/"$file
echo "Will first download nwjs."
AGKPATH=agkyra
NWJSPATH=$AGKPATH/nwjs
if [ -d $NWJSPATH ]; then
echo "Warning: cleaning up $NWJSPATH."
rm -r $NWJSPATH
fi
mkdir $NWJSPATH
wget $url
if [[ "$os" =~ ^(linux64|linux32)$ ]]; then
tar xzf $file --strip-components 1 -C $NWJSPATH
else
unzip -d tmpnwjs $file && mv tmpnwjs/*/* $NWJSPATH && rm -r tmpnwjs
fi
rm $file
......@@ -16,48 +16,35 @@
CURPWD=$(pwd)
cd "$(dirname "$0")"
ROOTPATH=$(pwd)
declare -A nwjsfile
nwjsfile[win64]="nwjs-v0.12.1-win-x64.zip"
nwjsfile[osx64]="nwjs-v0.12.1-osx-x64.zip"
nwjsfile[linux64]="nwjs-v0.12.1-linux-x64.tar.gz"
nwjsfile[win32]="nwjs-v0.12.1-win-ia32.zip"
nwjsfile[osx32]="nwjs-v0.12.1-osx-ia32.zip"
nwjsfile[linux32]="nwjs-v0.12.1-linux-ia32.tar.gz"
if [[ -z $1 ]]; then
echo "Select one of:" ${!nwjsfile[@]}
exit
os=$1
./get_nwjs.sh $os
if [ $? -ne 0 ]; then
exit 1
fi
ID=agkyra-$(date +%s)
TMPDIR=/tmp/$ID
TMPAGKYRA=$TMPDIR/agkyra
mkdir -p $TMPAGKYRA
WHEELHOUSE=$TMPAGKYRA/wheelhouse
cp launch $TMPAGKYRA
cp README.md $TMPAGKYRA
cp COPYING $TMPAGKYRA
git ls-files agkyra | xargs cp --parents -t $TMPAGKYRA
cd $TMPAGKYRA/agkyra/gui
zip -r ../gui.nw .
cd .. && rm -r gui
os=$1
file=${nwjsfile[$os]}
url="http://dl.nwjs.io/v0.12.1/"$file
cd $TMPAGKYRA/agkyra
wget $url
if [[ "$os" =~ ^(linux64|linux32)$ ]]; then
mkdir nwjs
tar xzf $file --strip-components 1 -C nwjs
else
unzip -d nwjs "$file" && f=(nwjs/*) && mv nwjs/*/* nwjs && rmdir "${f[@]}"
cd $ROOTPATH/src
pip wheel . -w $WHEELHOUSE
if [ $? -ne 0 ]; then
exit 1
fi
rm $file
cd $WHEELHOUSE
for i in *; do unzip $i -d $TMPAGKYRA/lib; done
cd $TMPAGKYRA
rm -r $WHEELHOUSE
cp $ROOTPATH/COPYING $TMPAGKYRA
cp $ROOTPATH/README.md $TMPAGKYRA
cp $ROOTPATH/agkyra/scripts/gui.py $TMPAGKYRA/agkyra
cp $ROOTPATH/agkyra/scripts/cli.py $TMPAGKYRA/agkyra-cli
cd $TMPDIR
ARCHIVENAME=$CURPWD/agkyra-snapshot-${os}
......
# Copyright (C) 2015 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import os
import sys
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools import setup, find_packages
from agkyra import __version__
# Package info
PACKAGE_NAME = "agkyra"
VERSION = __version__
SHORT_DESCRIPTION = 'Agkyra File Syncer'
PACKAGES_ROOT = '.'
PACKAGES = find_packages(PACKAGES_ROOT)
# Package meta
CLASSIFIERS = []
# Package requirements
INSTALL_REQUIRES = [
'kamaki>=0.13.3',
'watchdog',
'psutil',
'ws4py',
]
EXTRAS_REQUIRES = {
}
TESTS_REQUIRES = [
'mock',
]
# Provided as an attribute, so you can append to these instead
# of replicating them:
standard_exclude = ["*.py", "*.pyc", "*$py.class", "*~", ".*", "*.bak"]
standard_exclude_directories = [
".*", "CVS", "_darcs", "./build", "./dist", "EGG-INFO", "*.egg-info",
]
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# Note: you may want to copy this into your setup.py file verbatim, as
# you can't import this from another package, when you don't know if
# that package is installed yet.
def find_package_data(
where=".",
package="",
exclude=standard_exclude,
exclude_directories=standard_exclude_directories,
only_in_packages=True,
show_ignored=False):
"""
Return a dictionary suitable for use in ``package_data``
in a distutils ``setup.py`` file.
The dictionary looks like::
{"package": [files]}
Where ``files`` is a list of all the files in that package that
don"t match anything in ``exclude``.
If ``only_in_packages`` is true, then top-level directories that
are not packages won"t be included (but directories under packages
will).
Directories matching any pattern in ``exclude_directories`` will
be ignored; by default directories with leading ``.``, ``CVS``,
and ``_darcs`` will be ignored.
If ``show_ignored`` is true, then all the files that aren"t
included in package data are shown on stderr (for debugging
purposes).
Note patterns use wildcards, or can be exact paths (including
leading ``./``), and all searching is case-insensitive.
"""
out = {}
stack = [(convert_path(where), "", package, only_in_packages)]
while stack:
where, prefix, package, only_in_packages = stack.pop(0)
for name in os.listdir(where):
fn = os.path.join(where, name)
if os.path.isdir(fn):
bad_name = False
for pattern in exclude_directories:
if (fnmatchcase(name, pattern)
or fn.lower() == pattern.lower()):
bad_name = True
if show_ignored:
print >> sys.stderr, (
"Directory %s ignored by pattern %s"
% (fn, pattern))
break
if bad_name:
continue
if (os.path.isfile(os.path.join(fn, "__init__.py"))
and not prefix):
if not package:
new_package = name
else:
new_package = package + "." + name
stack.append((fn, "", new_package, False))
else:
stack.append((fn, prefix + name + "/", package, only_in_packages))
elif package or not only_in_packages:
# is a file
bad_name = False
for pattern in exclude:
if (fnmatchcase(name, pattern)
or fn.lower() == pattern.lower()):
bad_name = True
if show_ignored:
print >> sys.stderr, (
"File %s ignored by pattern %s"
% (fn, pattern))
break
if bad_name:
continue
out.setdefault(package, []).append(prefix+name)
return out
setup(
name=PACKAGE_NAME,
version=VERSION,
license='GNU GPLv3',
url='http://www.synnefo.org/',
description=SHORT_DESCRIPTION,
classifiers=CLASSIFIERS,
author='Synnefo development team',
author_email='synnefo-devel@googlegroups.com',
maintainer='Synnefo development team',
maintainer_email='synnefo-devel@googlegroups.com',
packages=PACKAGES,
package_dir={'': PACKAGES_ROOT},
include_package_data=True,
package_data=find_package_data('.'),
zip_safe=False,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRES,
tests_require=TESTS_REQUIRES,
dependency_links=['http://www.synnefo.org/packages/pypi'],
entry_points={
'console_scripts': [
'agkyra = agkyra.scripts.gui:main',
'agkyra-cli = agkyra.scripts.cli:main',
],
},
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment