Lowercase the appname.

This commit is contained in:
Bastian Kleineidam 2014-06-09 14:02:19 +02:00
parent f39a8c0b1a
commit 430caaf334
5 changed files with 23 additions and 36 deletions

2
.gitignore vendored
View File

@ -9,4 +9,4 @@ Changelog.patool*
/doc/README.md /doc/README.md
/testresults.txt /testresults.txt
/tests/__pycache__ /tests/__pycache__
/_Patool_configdata.py /_patool_configdata.py

View File

@ -4,16 +4,15 @@ VERSION:=$(shell $(PYTHON) setup.py --version)
MAINTAINER:=$(shell $(PYTHON) setup.py --maintainer) MAINTAINER:=$(shell $(PYTHON) setup.py --maintainer)
AUTHOR:=$(shell $(PYTHON) setup.py --author) AUTHOR:=$(shell $(PYTHON) setup.py --author)
APPNAME:=$(shell $(PYTHON) setup.py --name) APPNAME:=$(shell $(PYTHON) setup.py --name)
LAPPNAME:=$(shell echo $(APPNAME)|tr "[A-Z]" "[a-z]") ARCHIVE_SOURCE:=$(APPNAME)-$(VERSION).tar.gz
ARCHIVE_SOURCE:=$(LAPPNAME)-$(VERSION).tar.gz ARCHIVE_WIN32:=$(APPNAME)-$(VERSION).exe
ARCHIVE_WIN32:=$(LAPPNAME)-$(VERSION).exe
GITUSER:=wummel GITUSER:=wummel
GITREPO:=$(LAPPNAME) GITREPO:=$(APPNAME)
HOMEPAGE:=$(HOME)/public_html/patool-webpage.git HOMEPAGE:=$(HOME)/public_html/patool-webpage.git
WEBMETA:=doc/web/app.yaml WEBMETA:=doc/web/app.yaml
DEBUILDDIR:=$(HOME)/projects/debian/official DEBUILDDIR:=$(HOME)/projects/debian/official
DEBORIGFILE:=$(DEBUILDDIR)/$(LAPPNAME)_$(VERSION).orig.tar.gz DEBORIGFILE:=$(DEBUILDDIR)/$(APPNAME)_$(VERSION).orig.tar.gz
DEBPACKAGEDIR:=$(DEBUILDDIR)/$(LAPPNAME)-$(VERSION) DEBPACKAGEDIR:=$(DEBUILDDIR)/$(APPNAME)-$(VERSION)
# Pytest options: # Pytest options:
# --resultlog: write test results in file # --resultlog: write test results in file
# -s: do not capture stdout/stderr (some tests fail otherwise) # -s: do not capture stdout/stderr (some tests fail otherwise)
@ -28,7 +27,8 @@ all:
dist: dist:
[ -d dist ] || mkdir dist [ -d dist ] || mkdir dist
git archive --format=tar --prefix=$(LAPPNAME)-$(VERSION)/ HEAD | gzip -9 > dist/$(ARCHIVE_SOURCE) $(PYTHON) setup.py sdist --formats=tar
gzip --best dist/$(APPNAME)-$(VERSION).tar
[ ! -f ../$(ARCHIVE_WIN32) ] || cp ../$(ARCHIVE_WIN32) dist [ ! -f ../$(ARCHIVE_WIN32) ] || cp ../$(ARCHIVE_WIN32) dist
sign: sign:
@ -44,15 +44,16 @@ upload_binary:
cp dist/$(ARCHIVE_WIN32) dist/$(ARCHIVE_WIN32).asc \ cp dist/$(ARCHIVE_WIN32) dist/$(ARCHIVE_WIN32).asc \
$(HOMEPAGE)/dist $(HOMEPAGE)/dist
homepage: update_webmeta:
# update metadata # update metadata
@echo "version: \"$(VERSION)\"" > $(WEBMETA) @echo "version: \"$(VERSION)\"" > $(WEBMETA)
@echo "name: \"$(APPNAME)\"" >> $(WEBMETA) @echo "name: \"$(APPNAME)\"" >> $(WEBMETA)
@echo "lname: \"$(LAPPNAME)\"" >> $(WEBMETA)
@echo "maintainer: \"$(MAINTAINER)\"" >> $(WEBMETA) @echo "maintainer: \"$(MAINTAINER)\"" >> $(WEBMETA)
@echo "author: \"$(AUTHOR)\"" >> $(WEBMETA) @echo "author: \"$(AUTHOR)\"" >> $(WEBMETA)
git add $(WEBMETA) git add $(WEBMETA)
git cm "Updated web meta data." git cm "Updated web meta data."
homepage: update_webmeta
# relase website # relase website
$(MAKE) -C doc/web release $(MAKE) -C doc/web release
@ -71,7 +72,7 @@ register:
@echo "Register at Python Package Index..." @echo "Register at Python Package Index..."
$(PYTHON) setup.py register $(PYTHON) setup.py register
@echo "Submitting to freecode.org..." @echo "Submitting to freecode.org..."
freecode-submit < $(LAPPNAME).freecode freecode-submit < $(APPNAME).freecode
releasecheck: test check releasecheck: test check
@if egrep -i "xx\.|xxxx|\.xx" doc/changelog.txt > /dev/null; then \ @if egrep -i "xx\.|xxxx|\.xx" doc/changelog.txt > /dev/null; then \
@ -81,8 +82,8 @@ releasecheck: test check
echo "Missing WIN32 distribution archive at ../$(ARCHIVE_WIN32)"; \ echo "Missing WIN32 distribution archive at ../$(ARCHIVE_WIN32)"; \
false; \ false; \
fi fi
@if ! grep "Version: $(VERSION)" $(LAPPNAME).freecode > /dev/null; then \ @if ! grep "Version: $(VERSION)" $(APPNAME).freecode > /dev/null; then \
echo "Could not release: edit $(LAPPNAME).freecode version"; false; \ echo "Could not release: edit $(APPNAME).freecode version"; false; \
fi fi
$(PYTHON) setup.py check --restructuredtext $(PYTHON) setup.py check --restructuredtext
@ -119,14 +120,14 @@ localbuild:
test: localbuild test: localbuild
$(PYTHON) -m pytest $(PYTESTOPTS) $(TESTOPTS) $(TESTS) $(PYTHON) -m pytest $(PYTESTOPTS) $(TESTOPTS) $(TESTS)
doc/$(LAPPNAME).txt: doc/$(LAPPNAME).1 doc/$(APPNAME).txt: doc/$(APPNAME).1
# make text file from man page for Windows builds # make text file from man page for Windows builds
cols=`stty size | cut -d" " -f2`; stty cols 72; man -l $< | sed -e 's/.\cH//g' > $@; stty cols $$cols cols=`stty size | cut -d" " -f2`; stty cols 72; man -l $< | sed -e 's/.\cH//g' > $@; stty cols $$cols
deb: deb:
# build a debian package # build a debian package
[ -f $(DEBORIGFILE) ] || cp dist/$(ARCHIVE_SOURCE) $(DEBORIGFILE) [ -f $(DEBORIGFILE) ] || cp dist/$(ARCHIVE_SOURCE) $(DEBORIGFILE)
sed -i -e 's/VERSION_$(LAPPNAME):=.*/VERSION_$(LAPPNAME):=$(VERSION)/' $(DEBUILDDIR)/$(LAPPNAME).mak sed -i -e 's/VERSION_$(APPNAME):=.*/VERSION_$(LAPPNAME):=$(VERSION)/' $(DEBUILDDIR)/$(LAPPNAME).mak
[ -d $(DEBPACKAGEDIR) ] || (cd $(DEBUILDDIR); \ [ -d $(DEBPACKAGEDIR) ] || (cd $(DEBUILDDIR); \
patool extract $(DEBORIGFILE); \ patool extract $(DEBORIGFILE); \
cd $(CURDIR); \ cd $(CURDIR); \
@ -134,7 +135,7 @@ deb:
cp -r debian $(DEBPACKAGEDIR); \ cp -r debian $(DEBPACKAGEDIR); \
rm -f $(DEBPACKAGEDIR)/debian/.gitignore; \ rm -f $(DEBPACKAGEDIR)/debian/.gitignore; \
git checkout master) git checkout master)
$(MAKE) -C $(DEBUILDDIR) $(LAPPNAME)_clean $(LAPPNAME) $(MAKE) -C $(DEBUILDDIR) $(APPNAME)_clean $(APPNAME)
update-copyright: update-copyright:
# update-copyright is a local tool which updates the copyright year for each # update-copyright is a local tool which updates the copyright year for each

View File

@ -1,5 +1,4 @@
version: "1.6" version: "1.6"
name: "Patool" name: "patool"
lname: "patool"
maintainer: "Bastian Kleineidam" maintainer: "Bastian Kleineidam"
author: "Bastian Kleineidam" author: "Bastian Kleineidam"

View File

@ -7,12 +7,12 @@
</header> </header>
<section id="downloads" class="clearfix"> <section id="downloads" class="clearfix">
<a href="http://wummel.github.io/{{site.app.lname}}/dist/{{site.app.lname}}-{{site.app.version}}.tar.gz" <a href="http://wummel.github.io/{{site.app.name}}/dist/{{site.app.name}}-{{site.app.version}}.tar.gz"
title="Download source .tar.gz package" title="Download source .tar.gz package"
id="download-tar-gz" class="button"><span>{{site.app.lname}}-{{site.app.version}}.tar.gz</span></a> id="download-tar-gz" class="button"><span>{{site.app.name}}-{{site.app.version}}.tar.gz</span></a>
<a href="http://wummel.github.io/{{site.app.lname}}/dist/{{site.app.lname}}-{{site.app.version}}.exe" <a href="http://wummel.github.io/{{site.app.name}}/dist/{{site.app.name}}-{{site.app.version}}.exe"
title="Download Windows .exe installer" title="Download Windows .exe installer"
id="download-exe" class="button"><span>{{site.app.lname}}-{{site.app.version}}.exe</span></a> id="download-exe" class="button"><span>{{site.app.name}}-{{site.app.version}}.exe</span></a>
<a href="https://github.com/wummel/patool" id="view-on-github" class="button"><span>View on GitHub</span></a> <a href="https://github.com/wummel/patool" id="view-on-github" class="button"><span>View on GitHub</span></a>
<!-- <p> <!-- <p>
<a href="https://github.com/wummel/patool/blob/master/patool.freecode">Release notes</a> <a href="https://github.com/wummel/patool/blob/master/patool.freecode">Release notes</a>

View File

@ -44,12 +44,11 @@ try:
except ImportError: except ImportError:
from distutils.core import Distribution from distutils.core import Distribution
executables = None executables = None
from distutils.command.register import register
from distutils.command.install_lib import install_lib from distutils.command.install_lib import install_lib
from distutils import util from distutils import util
from distutils.file_util import write_file from distutils.file_util import write_file
AppName = "Patool" AppName = "patool"
AppVersion = "1.6" AppVersion = "1.6"
MyName = "Bastian Kleineidam" MyName = "Bastian Kleineidam"
MyEmail = "bastian.kleineidam@web.de" MyEmail = "bastian.kleineidam@web.de"
@ -272,7 +271,6 @@ class InnoScript:
if not self.dist_dir[-1] in "\\/": if not self.dist_dir[-1] in "\\/":
self.dist_dir += "\\" self.dist_dir += "\\"
self.name = AppName self.name = AppName
self.lname = AppName.lower()
self.version = AppVersion self.version = AppVersion
self.windows_exe_files = [self.chop(p) for p in windows_exe_files] self.windows_exe_files = [self.chop(p) for p in windows_exe_files]
self.console_exe_files = [self.chop(p) for p in console_exe_files] self.console_exe_files = [self.chop(p) for p in console_exe_files]
@ -416,16 +414,6 @@ except ImportError:
pass pass
class MyRegister (register, object):
"""Custom register command."""
def build_post_data(self, action):
"""Force application name to lower case."""
data = super(MyRegister, self).build_post_data(action)
data['name'] = data['name'].lower()
return data
args = dict( args = dict(
name = AppName, name = AppName,
version = AppVersion, version = AppVersion,
@ -474,7 +462,6 @@ installed.
cmdclass = { cmdclass = {
'install_lib': MyInstallLib, 'install_lib': MyInstallLib,
'py2exe': MyPy2exe, 'py2exe': MyPy2exe,
'register': MyRegister,
}, },
options = { options = {
"py2exe": py2exe_options, "py2exe": py2exe_options,