Build fixes.

This commit is contained in:
Bastian Kleineidam 2012-12-21 22:23:24 +01:00
parent 331cf8344d
commit 70e9abfe82
2 changed files with 24 additions and 6 deletions

View File

@ -23,7 +23,7 @@ endif
# 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)
PYTESTOPTS:=--resultlog=testresults.txt -s PYTESTOPTS:=--resultlog=testresults.txt -s --durations=0
# which test modules to run # which test modules to run
TESTS ?= tests/ TESTS ?= tests/
# set test options # set test options
@ -130,15 +130,14 @@ doc/$(LAPPNAME).txt: doc/$(LAPPNAME).1
deb: deb:
# build a debian package # build a debian package
[ -f $(DEBORIGFILE) ] || cp dist/$(ARCHIVE_SOURCE) $(DEBORIGFILE) $(DEBUILDDIR)/$(LAPPNAME)_$(VERSION).orig.tar.gz [ -f $(DEBORIGFILE) ] || cp dist/$(ARCHIVE_SOURCE) $(DEBORIGFILE) $(DEBUILDDIR)/$(LAPPNAME)_$(VERSION).orig.tar.gz
sed -i 's/VERSION:=.*/VERSION:=$(VERSION)/' $(DEBUILDDIR)/$(LAPPNAME).mak sed -i -e 's/VERSION_$(LAPPNAME):=.*/VERSION_$(LAPPNAME):=$(VERSION)/' $(DEBUILDDIR)/$(LAPPNAME).mak
[ -d $(DEBPACKAGEDIR) ] || (cd $(DEBUILDDIR); \ [ -d $(DEBPACKAGEDIR) ] || (cd $(DEBUILDDIR); \
patool extract $(DEBORIGFILE); \ patool extract $(DEBORIGFILE); \
cd $(CURDIR); \ cd $(CURDIR); \
git checkout debian; \ git checkout debian; \
cp -r debian $(DEBPACKAGEDIR); \ cp -r debian $(DEBPACKAGEDIR); \
git checkout master) git checkout master)
rm -f $(DEBUILDDIR)/$(LAPPNAME) $(MAKE) -C $(DEBUILDDIR) $(LAPPNAME)_clean $(LAPPNAME)
$(MAKE) -C $(DEBUILDDIR) $(LAPPNAME)
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

@ -205,13 +205,32 @@ class InnoScript:
def sign (self): def sign (self):
"""Sign InnoSetup installer with local self-signed certificate.""" """Sign InnoSetup installer with local self-signed certificate."""
print("*** signing the inno setup installer ***")
pfxfile = r'C:\patool.pfx' pfxfile = r'C:\patool.pfx'
if os.path.isfile(pfxfile): if os.path.isfile(pfxfile):
cmd = ['signtool.exe', 'sign', '/f', pfxfile, self.distfile] path = get_windows_sdk_path()
subprocess.check_call(cmd) signtool = os.path.join(path, "bin", "signtool.exe")
if os.path.isfile(signtool):
cmd = [signtool, 'sign', '/f', pfxfile, self.distfile]
subprocess.check_call(cmd)
else:
print("No signed installer: signtool.exe not found.")
else: else:
print("No signed installer: certificate %s not found." % pfxfile) print("No signed installer: certificate %s not found." % pfxfile)
def get_windows_sdk_path():
"""Return path of Microsoft Windows SDK installation, or None if
not found."""
try:
import _winreg as winreg
except ImportError:
import winreg
sub_key = r"Software\Microsoft\Microsoft SDKs\Windows"
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, sub_key) as key:
name = "CurrentInstallFolder"
return winreg.QueryValueEx(key, name)[0]
return None
try: try:
from py2exe.build_exe import py2exe as py2exe_build from py2exe.build_exe import py2exe as py2exe_build