2010-11-04 02:18:18 +03:00
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
|
|
# Version: MPL 1.1
|
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
# http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
# for the specific language governing rights and limitations under the
|
|
|
|
# License.
|
|
|
|
#
|
|
|
|
# The Original Code is Raindrop.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is
|
|
|
|
# Mozilla Messaging, Inc..
|
|
|
|
# Portions created by the Initial Developer are Copyright (C) 2009
|
|
|
|
# the Initial Developer. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
|
|
|
#
|
|
|
|
|
2010-09-01 11:41:39 +04:00
|
|
|
try:
|
|
|
|
from setuptools import setup, find_packages
|
|
|
|
except ImportError:
|
|
|
|
from ez_setup import use_setuptools
|
|
|
|
use_setuptools()
|
|
|
|
from setuptools import setup, find_packages
|
|
|
|
|
2011-04-13 03:15:01 +04:00
|
|
|
VERSION='0.3.7'
|
2011-02-17 00:40:19 +03:00
|
|
|
|
2010-09-01 11:41:39 +04:00
|
|
|
setup(
|
|
|
|
name='linkdrop',
|
2011-02-17 00:40:19 +03:00
|
|
|
version=VERSION,
|
2011-03-18 20:33:03 +03:00
|
|
|
description='F1 is a browser extension that allows you to share links in a fast and fun way.',
|
|
|
|
author='Mozilla Messaging',
|
|
|
|
author_email='linkdrop@googlegroups.com',
|
|
|
|
url='http://f1.mozillamessaging.com/',
|
2010-09-01 11:41:39 +04:00
|
|
|
install_requires=[
|
|
|
|
"Pylons>=1.0",
|
2010-09-02 02:13:03 +04:00
|
|
|
"docutils",
|
2010-09-02 06:20:55 +04:00
|
|
|
"nose",
|
2011-03-25 19:58:27 +03:00
|
|
|
"coverage",
|
2011-03-31 06:06:48 +04:00
|
|
|
"mock",
|
2010-09-02 06:20:55 +04:00
|
|
|
"httplib2",
|
2010-09-04 00:16:04 +04:00
|
|
|
"oauth2",
|
2010-09-04 00:23:02 +04:00
|
|
|
"python-dateutil",
|
|
|
|
"python-openid",
|
2010-09-25 00:53:19 +04:00
|
|
|
"python-memcached",
|
2011-03-24 15:46:07 +03:00
|
|
|
"linkoauth",
|
2010-09-01 11:41:39 +04:00
|
|
|
],
|
|
|
|
setup_requires=["PasteScript>=1.6.3"],
|
|
|
|
packages=find_packages(exclude=['ez_setup']),
|
|
|
|
include_package_data=True,
|
|
|
|
test_suite='nose.collector',
|
|
|
|
package_data={'linkdrop': ['i18n/*/LC_MESSAGES/*.mo']},
|
2010-09-13 23:58:27 +04:00
|
|
|
message_extractors={'linkdrop': [
|
|
|
|
('**.py', 'python', None),
|
|
|
|
('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
|
|
|
|
('public/**', 'ignore', None)]},
|
2010-09-01 11:41:39 +04:00
|
|
|
zip_safe=False,
|
|
|
|
paster_plugins=['PasteScript', 'Pylons'],
|
|
|
|
entry_points="""
|
|
|
|
[paste.app_factory]
|
|
|
|
main = linkdrop.config.middleware:make_app
|
2011-01-06 03:32:17 +03:00
|
|
|
static = linkdrop.static:make_static
|
2010-09-01 11:41:39 +04:00
|
|
|
|
2010-09-02 01:33:03 +04:00
|
|
|
[paste.filter_app_factory]
|
2010-09-10 06:24:28 +04:00
|
|
|
csrf = linkdrop.csrf:make_csrf_filter_app
|
2010-09-02 01:33:03 +04:00
|
|
|
dbgp = linkdrop.debug:make_dbgp_middleware
|
|
|
|
profiler = linkdrop.debug:make_profile_middleware
|
|
|
|
|
2010-09-01 11:41:39 +04:00
|
|
|
[paste.app_install]
|
|
|
|
main = pylons.util:PylonsInstaller
|
|
|
|
""",
|
|
|
|
)
|
2011-02-17 00:40:19 +03:00
|
|
|
|
2011-02-17 04:14:59 +03:00
|
|
|
import os, stat
|
2011-02-17 00:40:19 +03:00
|
|
|
basedir = os.path.join(os.getcwd(), "web")
|
2011-02-17 21:32:48 +03:00
|
|
|
realdir = VERSION
|
2011-02-17 00:40:19 +03:00
|
|
|
linkdir = os.path.join(basedir, "current")
|
2011-02-17 21:32:48 +03:00
|
|
|
|
|
|
|
# Sanity check, nuke what isn't a symlink
|
2011-02-17 04:14:59 +03:00
|
|
|
try:
|
|
|
|
s = os.lstat(linkdir)
|
2011-02-17 21:32:48 +03:00
|
|
|
if not stat.S_ISLNK(s.st_mode):
|
|
|
|
if stat.S_ISDIR:
|
|
|
|
os.rmdir(linkdir)
|
|
|
|
else:
|
|
|
|
os.unlink(linkdir)
|
2011-02-17 04:14:59 +03:00
|
|
|
except OSError, e:
|
|
|
|
if e.errno != 2: # file does not exist
|
|
|
|
raise
|
2011-02-17 21:32:48 +03:00
|
|
|
|
|
|
|
# Check what the symlink might already point to
|
|
|
|
# and update if needed
|
2011-04-01 05:29:20 +04:00
|
|
|
if hasattr(os, "readlink"):
|
|
|
|
try:
|
|
|
|
lver = os.readlink(linkdir)
|
|
|
|
except OSError, e:
|
|
|
|
lver = None
|
|
|
|
if e.errno != 2: # file does not exist
|
|
|
|
raise
|
2011-02-17 21:32:48 +03:00
|
|
|
|
2011-04-01 05:29:20 +04:00
|
|
|
if lver != VERSION:
|
|
|
|
if lver:
|
|
|
|
os.unlink(linkdir)
|
|
|
|
os.symlink(realdir, linkdir)
|