diff --git a/.gitignore b/.gitignore index e46140096..ae0ab4221 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ supybot.egg-info/ test-conf/ test-data/ test-logs/ +src/version.py INSTALL README.txt conf/ diff --git a/src/locales/__init__.py b/locales/__init__.py similarity index 100% rename from src/locales/__init__.py rename to locales/__init__.py diff --git a/src/locales/de.po b/locales/de.po similarity index 100% rename from src/locales/de.po rename to locales/de.po diff --git a/src/locales/fi.po b/locales/fi.po similarity index 100% rename from src/locales/fi.po rename to locales/fi.po diff --git a/src/locales/fr.po b/locales/fr.po similarity index 100% rename from src/locales/fr.po rename to locales/fr.po diff --git a/src/locales/fr.py b/locales/fr.py similarity index 100% rename from src/locales/fr.py rename to locales/fr.py diff --git a/src/locales/it.po b/locales/it.po similarity index 100% rename from src/locales/it.po rename to locales/it.po diff --git a/src/locales/messages.pot b/locales/messages.pot similarity index 100% rename from src/locales/messages.pot rename to locales/messages.pot diff --git a/setup.py b/setup.py index cb1366b1e..0edaea737 100644 --- a/setup.py +++ b/setup.py @@ -48,10 +48,7 @@ if debug: if path: os.chdir(path) -if os.path.isdir('src'): - VERSION_FILE = os.path.join('src', 'version.py') -else: - VERSION_FILE = os.path.join('supybot', 'version.py') +VERSION_FILE = os.path.join('src', 'version.py') version = None try: if 'SOURCE_DATE_EPOCH' in os.environ: @@ -67,7 +64,7 @@ try: time.strptime(time.asctime(time.gmtime(date)))[:3]) except: if os.path.isfile(VERSION_FILE): - from supybot.version import version + from src.version import version else: version = 'installed on ' + time.strftime("%Y-%m-%dT%H-%M-%S", time.gmtime()) try: @@ -75,7 +72,7 @@ try: except OSError: # Does not exist pass if version: - fd = open(VERSION_FILE, 'a') + fd = open(os.path.join('src', 'version.py'), 'a') fd.write("version = '%s'\n" % version) fd.write('try: # For import from setup.py\n') fd.write(' import supybot.utils.python\n') @@ -102,7 +99,7 @@ import shutil import os -plugins = [s for s in os.listdir(os.path.join('supybot', 'plugins')) if +plugins = [s for s in os.listdir('plugins') if os.path.exists(os.path.join('plugins', s, 'plugin.py'))] def normalizeWhitespace(s): @@ -150,9 +147,19 @@ packages = ['supybot', 'supybot.plugins.Math.local', ] -package_data = {'supybot.locales': [s for s in os.listdir('supybot/locales/')]} +package_dir = {'supybot': 'src', + 'supybot.utils': 'src/utils', + 'supybot.locales': 'locales', + 'supybot.plugins': 'plugins', + 'supybot.drivers': 'src/drivers', + 'supybot.plugins.Dict.local': 'plugins/Dict/local', + 'supybot.plugins.Math.local': 'plugins/Math/local', + } + +package_data = {'supybot.locales': [s for s in os.listdir('locales/')]} for plugin in plugins: + package_dir['supybot.plugins.' + plugin] = 'plugins/' + plugin locales_path = 'plugins/' + plugin + '/locales/' locales_name = 'supybot.plugins.'+plugin if os.path.exists(locales_path): @@ -203,6 +210,8 @@ setup( # Installation data packages=packages, + package_dir=package_dir, + package_data=package_data, scripts=['scripts/supybot',