update Makefile and setup.py
This commit is contained in:
parent
d3ee2acaab
commit
f379a0fc0a
2 changed files with 51 additions and 41 deletions
27
Makefile
27
Makefile
|
@ -15,8 +15,7 @@ ifneq ($(DESTDIR),)
|
||||||
PYTHON_OPTS += --root $(DESTDIR)
|
PYTHON_OPTS += --root $(DESTDIR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LAST_TAG := $(shell git describe --tags --abbrev=0)
|
VERSION := 1.0rc
|
||||||
VERSION := $(shell echo $(LAST_TAG) | awk -F'/' '{print $$2}' || true)
|
|
||||||
VERSION_FILE := version.in
|
VERSION_FILE := version.in
|
||||||
|
|
||||||
# Build translation files
|
# Build translation files
|
||||||
|
@ -39,11 +38,12 @@ define install_translation
|
||||||
fi
|
fi
|
||||||
endef
|
endef
|
||||||
|
|
||||||
all:
|
all: build-lang
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -r build
|
$(RM) -r build
|
||||||
$(RM) -r tiramisu.egg-info/
|
$(RM) -r $(PACKAGE).egg-info/
|
||||||
|
$(RM) -r $(VERSION_FILE)
|
||||||
$(RM) -r $(TRADUC_DIR)/*/*.mo
|
$(RM) -r $(TRADUC_DIR)/*/*.mo
|
||||||
|
|
||||||
#test: clean
|
#test: clean
|
||||||
|
@ -51,12 +51,12 @@ clean:
|
||||||
|
|
||||||
# Build or update Portable Object Base Translation for gettext
|
# Build or update Portable Object Base Translation for gettext
|
||||||
build-pot:
|
build-pot:
|
||||||
pygettext.py -p translations/ -o tiramisu.pot `find tiramisu/ -name "*.py"`
|
pygettext.py -p translations/ -o $(PACKAGE).pot `find $(PACKAGE)/ -name "*.py"`
|
||||||
|
|
||||||
build-lang:
|
build-lang:
|
||||||
$(call build_translation, $(TRADUC_DIR))
|
$(call build_translation, $(TRADUC_DIR))
|
||||||
|
|
||||||
install-lang: build-lang
|
install-lang:
|
||||||
$(INSTALL_DIR) $(TRADUC_DEST)
|
$(INSTALL_DIR) $(TRADUC_DEST)
|
||||||
$(call install_translation, $(TRADUC_DIR))
|
$(call install_translation, $(TRADUC_DIR))
|
||||||
|
|
||||||
|
@ -65,16 +65,9 @@ install: version.in install-lang
|
||||||
|
|
||||||
# List in .PHONY to force generation at each call
|
# List in .PHONY to force generation at each call
|
||||||
version.in:
|
version.in:
|
||||||
@if test -n $(VERSION) ; then \
|
echo -n $(VERSION) > $(VERSION_FILE)
|
||||||
echo -n $(VERSION) > $(VERSION_FILE) ; \
|
|
||||||
fi
|
|
||||||
@if test ! -s $(VERSION_FILE); then \
|
|
||||||
echo -n '0.0-dev' > $(VERSION_FILE); \
|
|
||||||
fi
|
|
||||||
|
|
||||||
dist: version.in
|
dist:
|
||||||
git archive --format=tar --prefix $(PACKAGE)-$(VERSION)/ -o $(PACKAGE)-$(VERSION).tar $(LAST_TAG) \
|
git archive --format=tar --prefix $(PACKAGE)-$(VERSION)/ HEAD | gzip -9 > $(PACKAGE)-$(VERSION).tar.gz
|
||||||
&& tar --xform "s,\(.*\),$(PACKAGE)-$(VERSION)/\1," -f $(PACKAGE)-$(VERSION).tar -r version.in \
|
|
||||||
&& gzip -9 $(PACKAGE)-$(VERSION).tar
|
|
||||||
|
|
||||||
.PHONY: all clean test install version.in dist build-pot
|
.PHONY: all clean build-pot build-lang install-lang install version.in dist
|
||||||
|
|
65
setup.py
65
setup.py
|
@ -1,38 +1,55 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
|
from os.path import isfile
|
||||||
|
|
||||||
|
|
||||||
|
version_file = 'version.in'
|
||||||
|
|
||||||
import os
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
def fetch_version():
|
def fetch_version():
|
||||||
"""Get version from version.in or latest git tag"""
|
"""Get version from version.in"""
|
||||||
version_file='version.in'
|
|
||||||
version = "1.0"
|
|
||||||
git_last_tag_cmd = ['git', 'describe', '--tags', '--abbrev=0']
|
|
||||||
|
|
||||||
try:
|
if not isfile(version_file):
|
||||||
if os.path.isfile(version_file):
|
raise Exception('Please use "make && make" install instead of '
|
||||||
version=file(version_file).readline().strip()
|
'setup.py directly')
|
||||||
elif os.path.isdir('.git'):
|
return file(version_file).readline().strip()
|
||||||
popen = subprocess.Popen(git_last_tag_cmd, stdout=subprocess.PIPE)
|
|
||||||
out, ret = popen.communicate()
|
|
||||||
for line in out.split('\n'):
|
|
||||||
if line:
|
|
||||||
version = line.lstrip('release/')
|
|
||||||
break
|
|
||||||
except OSError:
|
|
||||||
pass # Failing is fine, we just can't print the version then
|
|
||||||
|
|
||||||
return version
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
author='cadoles team',
|
author="Tiramisu's team",
|
||||||
author_email='contact@cadoles.com',
|
author_email='contact@cadoles.com',
|
||||||
name='tiramisu',
|
name='tiramisu',
|
||||||
version=fetch_version(),
|
version=fetch_version(),
|
||||||
description='configuration management tool',
|
description='an options controller tool',
|
||||||
url='http://labs.libre-entreprise.org/projects/tiramisu',
|
url='http://tiramisu.labs.libre-entreprise.org/',
|
||||||
packages=['tiramisu']
|
packages=['tiramisu'],
|
||||||
|
classifiers=[
|
||||||
|
"Programming Language :: Python",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Development Status :: 4 - Beta",
|
||||||
|
"Environment :: Other Environment",
|
||||||
|
"Intended Audience :: Developers",
|
||||||
|
# "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
|
||||||
|
"License :: OSI Approved :: GNU General Public License (GPL)",
|
||||||
|
"Operating System :: OS Independent",
|
||||||
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||||
|
"Topic :: Text Processing :: Linguistic"
|
||||||
|
],
|
||||||
|
long_description="""\
|
||||||
|
An options controller tool
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
Due to more and more available options required to set up an operating system,
|
||||||
|
compiler options or whatever, it became quite annoying to hand the necessary
|
||||||
|
options to where they are actually used and even more annoying to add new
|
||||||
|
options. To circumvent these problems the configuration control was
|
||||||
|
introduced...
|
||||||
|
|
||||||
|
Tiramisu is an options handler and an options controller, wich aims at
|
||||||
|
producing flexible and fast options access.
|
||||||
|
|
||||||
|
|
||||||
|
This version requires Python 2.6 or later.
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue