Commit 4ee7708b authored by mathieui's avatar mathieui

Small workaround for the default config location

parent 26419964
include src/default_config.cfg
include data/default_config.cfg
include data/poezio.1
recursive-include data/ *
from distutils.core import setup, Extension
import os, sys
module_poopt = Extension('poezio.poopt',
sources = ['src/pooptmodule.c'])
current_dir = os.path.dirname(__file__)
# Create a link to the config file (for packaging purposes)
if not os.path.exists(os.path.join(current_dir, 'src', 'default_config.cfg')):
os.link(os.path.join(current_dir, 'data', 'default_config.cfg'),
os.path.join(current_dir, 'src', 'default_config.cfg'))
setup(name="poezio",
version="0.8-dev",
description="A console XMPP client",
long_description=
"""
Poezio is a free chat client aiming to reproduce the ease of use of most
Poezio is a Free chat client aiming to reproduce the ease of use of most
IRC clients (e.g. weechat, irssi) while using the XMPP network.
""",
ext_modules = [module_poopt],
......@@ -30,11 +39,16 @@ setup(name="poezio",
'Topic :: Communications :: Chat',
'Programming Language :: Python :: 3',
],
keywords = ['xmpp', 'chat', 'im', 'console'],
keywords = ['jabber', 'xmpp', 'client', 'chat', 'im', 'console'],
packages = ['poezio', 'poezio_plugins'],
package_dir = {'poezio': 'src', 'poezio_plugins': 'plugins'},
package_data = {'poezio': ['default_config.cfg']},
scripts = ['scripts/poezio'],
data_files = [('/etc/poezio/', ['data/default_config.cfg']),
('share/poezio/themes/', ['data/themes/dark.py']),
data_files = [('share/poezio/themes/', ['data/themes/dark.py']),
('share/man/man1/', ['data/poezio.1'])],
)
# Remove the link afterwards
if os.path.exists(os.path.join(current_dir, 'src', 'default_config.cfg')):
os.unlink(os.path.join(current_dir, 'src', 'default_config.cfg'))
......@@ -252,7 +252,7 @@ options = parse_args(CONFIG_PATH)
# Copy a default file if none exists
if not path.isfile(options.filename):
default = path.join(path.dirname(__file__), '../data/default_config.cfg')
other = '/etc/poezio/default_config.cfg'
other = path.join(path.dirname(__file__), 'default_config.cfg')
if path.isfile(default):
copy2(default, options.filename)
elif path.isfile(other):
......
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