Changeset - 0430829c02a4
[Not reviewed]
0 0 1
Lance Edgar - 5 years ago 2019-09-13 13:24:18
lance@edbob.org
Add `freetds.install_from_source()`
1 file changed with 52 insertions and 0 deletions:
0 comments (0 inline, 0 general) First comment
rattail_fabric2/freetds.py
Show inline comments
 
new file 100644
 
# -*- coding: utf-8; -*-
 
################################################################################
 
#
 
#  Rattail -- Retail Software Framework
 
#  Copyright © 2010-2019 Lance Edgar
 
#
 
#  This file is part of Rattail.
 
#
 
#  Rattail 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.
 
#
 
#  Rattail 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
 
#  Rattail.  If not, see <http://www.gnu.org/licenses/>.
 
#
 
################################################################################
 
"""
 
Fabric Library for FreeTDS
 
"""
 

	
 
from rattail_fabric2 import apt, exists, mkdir
 

	
 

	
 
def install_from_source(c, user='rattail'):
 
    """
 
    Install the FreeTDS library from source.
 

	
 
    Per instructions found here:
 
    https://github.com/FreeTDS/freetds/blob/master/INSTALL.GIT
 
    """
 
    apt.install(
 
        c,
 
        'automake',
 
        'autoconf',
 
        'gettext',
 
        'pkg-config',
 
    )
 

	
 
    if not exists(c, '/usr/local/src/freetds'):
 
        mkdir(c, '/usr/local/src/freetds', owner=user, use_sudo=True)
 
        c.sudo('git clone https://github.com/FreeTDS/freetds.git /usr/local/src/freetds', user=user)
 

	
 
    if not exists(c, '/usr/local/lib/libtdsodbc.so'):
 
        c.sudo("bash -c 'cd /usr/local/src/freetds; ./autogen.sh'", user=user)
 
        c.sudo("bash -c 'cd /usr/local/src/freetds; make'", user=user)
 
        c.sudo("bash -c 'cd /usr/local/src/freetds; make install'") # as root
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now