• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved SeaFile server on FreeBSD

fred974

Daemon

Thanks: 34
Messages: 1,451

#1
HI,

I am trying to install net-mgmt/seafile-server
pkg install seafile-server
cd /usr/local/www/haiwen/seafile-server
./setup-seafile-mysql.sh
Code:
Checking python on this machine ...
  Checking python module: setuptools ... Done.
  Checking python module: python-imaging ...
 python-imaging  is not installed, Please install it first.

On Debian/Ubntu: apt-get install python-imaging
On CentOS/RHEL: yum install python-imaging


Error occured during setup.
Please fix possible problems and run the script again.
pkg search python-imaging is not returning anything.

Could anyone please advise
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,998
Messages: 26,762

#2
Python ports typically begin with py-*, but there's no py-imaging either. Not any more at least, graphics/py-imaging was removed about 2 years ago because it was unmaintained upstream. The deprecation message suggests using graphics/py-pillow instead.

I don't know if SeaFile will accept that though but it's worth a try.
 

fred974

Daemon

Thanks: 34
Messages: 1,451

#3
None of the following packages help:
pkg install py27-plone.app.imaging
pkg install py36-pillow

/usr/local/www/haiwen/seafile-server/setup-seafile-mysql.sh
Code:
#!/usr/local/bin/bash

########
### This script is a wrapper for setup-seafile-mysql.py
########

set -e

SCRIPT=$(readlink -f "$0")
INSTALLPATH=$(dirname "${SCRIPT}")

cd "$INSTALLPATH"

python_script=setup-seafile-mysql.py

function err_and_quit () {
    printf "\n\n\033[33mError occured during setup. \nPlease fix possible problems and run the script again.\033[m\n\n"
    exit 1;
}

function check_python_executable() {
    if [[ "$PYTHON" != "" && -x $PYTHON ]]; then
        return 0
    fi

    if which python2.7 2>/dev/null 1>&2; then
        PYTHON=python2.7
    elif which python27 2>/dev/null 1>&2; then
        PYTHON=python27
    else
        echo
        echo "Can't find a python executable of version 2.7 or above in PATH"
        echo "Install python 2.7+ before continue."
        echo "Or if you installed it in a non-standard PATH, set the PYTHON enviroment varirable to it"
        echo
        exit 1
    fi
}

function check_python_module () {
    module=$1
    name=$2
    hint=$3
    printf "  Checking python module: ${name} ... "
    if ! $PYTHON -c "import ${module}" 2>/dev/null 1>&2; then
        echo
        printf "\033[33m ${name} \033[m is not installed, Please install it first.\n"
        if [[ "${hint}" != "" ]]; then
            printf "${hint}"
            echo
        fi
        err_and_quit;
    fi
    echo -e "Done."
}

function check_python () {
    echo "Checking python on this machine ..."
    check_python_executable
    if ! which $PYTHON 2>/dev/null 1>&2; then
        echo "No $PYTHON found on this machine. Please install it first."
        err_and_quit;
    else
        if ($Python --version 2>&1 | grep "3\\.[0-9].\\.[0-9]") 2>/dev/null 1>&2 ; then
            printf "\033[33m Python version 3.x \033[m detected\n"
            echo "Python 3.x is not supported. Please use python 2.x. Now quit."
            err_and_quit;
        fi

        if [[ $PYTHON == "python2.6" ]]; then
            py26="2.6"
        fi
        hint="\nOn Debian/Ubntu: apt-get install python-setuptools\nOn CentOS/RHEL: yum install python${py26}-distribute"
        check_python_module pkg_resources setuptools "${hint}"

        hint="\nOn Debian/Ubntu: apt-get install python-imaging\nOn CentOS/RHEL: yum install python${py26}-imaging"
        check_python_module PIL python-imaging "${hint}"

        hint='\nOn Debian/Ubuntu:\n\nsudo apt-get install python-mysqldb\n\nOn CentOS/RHEL:\n\nsudo yum install MySQL-python'
        check_python_module MySQLdb python-mysqldb "${hint}"
    fi
    echo
}

check_python;

export PYTHON=$PYTHON

exec $PYTHON "$python_script" "$@"
I use tcsh shell but have /shells/bash install.. is that a problem?
I never used python before so not sure what the above scrip does.

Can I set the database and the other bits manually?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,998
Messages: 26,762

#4
If I look at the pkg-message you need to install www/seahub. Then follow the pkg-message instructions from that.
 

fred974

Daemon

Thanks: 34
Messages: 1,451

#8
I looked at nextcloud but found it too much in our case.
We will be using seafile as google drive replacement so will not be using all the features that nextcloud as to offer.
 
Top