can change package name

This commit is contained in:
Emmanuel Garette 2016-04-07 15:53:48 +02:00
parent 9f36e679a1
commit ebf84b5a69
2 changed files with 18 additions and 5 deletions

View file

@ -1,6 +1,9 @@
#!/usr/bin/make #!/usr/bin/make
PACKAGE := tiramisu PACKAGE := tiramisu
ifeq ($(PACKAGE_DST),)
PACKAGE_DST := $(PACKAGE)
endif
INSTALL := install INSTALL := install
INSTALL_DATA := install -m 644 INSTALL_DATA := install -m 644
@ -43,7 +46,7 @@ define install_translation
for file in `find ${1} -name "*.mo"`; do \ for file in `find ${1} -name "*.mo"`; do \
$(INSTALL_DIR) $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2` || true; \ $(INSTALL_DIR) $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2` || true; \
$(INSTALL_DIR) $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2`/LC_MESSAGES || true; \ $(INSTALL_DIR) $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2`/LC_MESSAGES || true; \
$(INSTALL_DATA) $$file $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2`/LC_MESSAGES || true; \ $(INSTALL_DATA) $$file $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2`/LC_MESSAGES/$(PACKAGE_DST).mo || true; \
done; \ done; \
fi fi
endef endef

View file

@ -3,6 +3,10 @@
from distutils.core import setup from distutils.core import setup
from os.path import dirname, abspath, join, normpath, isdir from os.path import dirname, abspath, join, normpath, isdir
from os import listdir from os import listdir
import os
package_name = os.environ.get('PACKAGE_DST', 'tiramisu')
def fetch_version(): def fetch_version():
@ -18,18 +22,23 @@ def return_files(component):
paths = filter(isdir, [join(path, content) paths = filter(isdir, [join(path, content)
for content in dir_content]) for content in dir_content])
lst = ['.'.join(path.split('/')[-3:]) for path in paths] lst = ['.'.join(path.split('/')[-3:]) for path in paths]
lst = [package_name + '.' + '.'.join(path.split('/')[-2:]) for path in paths]
return lst return lst
packages = ['tiramisu', 'tiramisu.storage', 'tiramisu.option'] packages = [package_name, package_name + '.storage', package_name + '.option']
packages.extend(return_files('storage')) packages.extend(return_files('storage'))
packages.extend(return_files('option')) packages.extend(return_files('option'))
print packages
if package_name != 'tiramisu':
package_dir = {package_name: 'tiramisu'}
else:
package_dir = {}
setup( setup(
author="Tiramisu's team", author="Tiramisu's team",
author_email='contact@cadoles.com', author_email='contact@cadoles.com',
name='tiramisu', name=package_name,
version=fetch_version(), version=fetch_version(),
description='an options controller tool', description='an options controller tool',
url='http://tiramisu.labs.libre-entreprise.org/', url='http://tiramisu.labs.libre-entreprise.org/',
@ -61,5 +70,6 @@ producing flexible and fast options access.
This version requires Python 2.6 or later. This version requires Python 2.6 or later.
""", """,
packages=packages packages=packages,
package_dir=package_dir
) )