* solved problems install-problems: use at least scons 0.96.90
* minor tweaks to buildsystem: - added scons_alock.py to hold some routines we use - adjusting the permissions of created files --HG-- extra : convert_revision : svn%3Aeebe1cee-a9af-4fe4-bd26-ad572b19c5ab/trunk%4030
This commit is contained in:
parent
4d645e3464
commit
24ad48e50c
4 changed files with 76 additions and 18 deletions
|
@ -1,5 +1,10 @@
|
||||||
Version 1.0
|
Version 1.0
|
||||||
|
|
||||||
|
2005-05-25:
|
||||||
|
|
||||||
|
* solved problems install-problems: use at least scons 0.96.90
|
||||||
|
* minor tweaks to buildsystem
|
||||||
|
|
||||||
2005-05-24:
|
2005-05-24:
|
||||||
|
|
||||||
* updated documentation
|
* updated documentation
|
||||||
|
|
27
SConstruct
27
SConstruct
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
from scons_alock import *
|
||||||
|
|
||||||
alock_name = 'alock'
|
alock_name = 'alock'
|
||||||
alock_version = '1.0'
|
alock_version = '1.0'
|
||||||
|
@ -30,7 +31,7 @@ alock_doc_files = [
|
||||||
'alock.1' ]
|
'alock.1' ]
|
||||||
|
|
||||||
Default(alock_target)
|
Default(alock_target)
|
||||||
SConsignFile()
|
SConsignFile('SConsign')
|
||||||
|
|
||||||
alock_options = Options(alock_optfile)
|
alock_options = Options(alock_optfile)
|
||||||
alock_options.AddOptions(
|
alock_options.AddOptions(
|
||||||
|
@ -55,7 +56,8 @@ alock_options.AddOptions(
|
||||||
|
|
||||||
alock_env = Environment(options = alock_options,
|
alock_env = Environment(options = alock_options,
|
||||||
TARFLAGS = '-c -z',
|
TARFLAGS = '-c -z',
|
||||||
TARSUFFIX = '.tgz')
|
TARSUFFIX = '.tgz'
|
||||||
|
)
|
||||||
alock_options.Update(alock_env)
|
alock_options.Update(alock_env)
|
||||||
Help(alock_options.GenerateHelpText(alock_env))
|
Help(alock_options.GenerateHelpText(alock_env))
|
||||||
|
|
||||||
|
@ -67,7 +69,7 @@ alock_instdir_bin = os.path.join(alock_instdir,'bin')
|
||||||
alock_instdir_data = os.path.join(alock_instdir,'share')
|
alock_instdir_data = os.path.join(alock_instdir,'share')
|
||||||
alock_instdir_meta = os.path.join(alock_instdir_data, alock_name + '-' + alock_version)
|
alock_instdir_meta = os.path.join(alock_instdir_data, alock_name + '-' + alock_version)
|
||||||
alock_instdir_meta_contrib = os.path.join(alock_instdir_meta, 'contrib')
|
alock_instdir_meta_contrib = os.path.join(alock_instdir_meta, 'contrib')
|
||||||
alock_instdir_man = os.path.join(alock_instdir_data, os.path.join('man', 'man1'))
|
alock_instdir_man = os.path.join(alock_instdir, os.path.join('man', 'man1'))
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
#
|
#
|
||||||
|
@ -164,8 +166,6 @@ if alock_env['xrender']:
|
||||||
conf.Finish()
|
conf.Finish()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -187,21 +187,14 @@ alock_options.Save('scons.opts', alock_env)
|
||||||
# building
|
# building
|
||||||
|
|
||||||
alock_program = SConscript( 'src/SConscript', exports = ['alock_env'])
|
alock_program = SConscript( 'src/SConscript', exports = ['alock_env'])
|
||||||
|
|
||||||
|
|
||||||
def createManPage(target, source, env):
|
|
||||||
os.system('asciidoc -d manpage -b docbook -o alock.xml ' + str(source[0]))
|
|
||||||
os.system('xmlto man alock.xml')
|
|
||||||
os.remove('alock.xml')
|
|
||||||
return None
|
|
||||||
|
|
||||||
def createHtml(target, source, env):
|
|
||||||
os.system('asciidoc -d manpage -b xhtml -o ' + str(target[0]) + ' ' +
|
|
||||||
str(source[0]))
|
|
||||||
|
|
||||||
alock_env.Command('alock.1', 'alock.txt', createManPage)
|
alock_env.Command('alock.1', 'alock.txt', createManPage)
|
||||||
alock_env.Command('alock.html', 'alock.txt', createHtml)
|
alock_env.Command('alock.html', 'alock.txt', createHtml)
|
||||||
|
|
||||||
|
alock_env.AddPostAction(alock_target, Chmod(alock_target, 0755))
|
||||||
|
alock_env.AddPostAction('alock.txt', Chmod('alock.txt', 0644))
|
||||||
|
alock_env.AddPostAction('alock.1', Chmod('alock.1', 0644))
|
||||||
|
alock_env.AddPostAction('alock.html', Chmod('alock.html', 0644))
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
#
|
#
|
||||||
# installing
|
# installing
|
||||||
|
|
61
scons_alock.py
Normal file
61
scons_alock.py
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
def createManPage(target, source, env):
|
||||||
|
"""Creates a manpage via asciidoc and xmlto."""
|
||||||
|
os.system('asciidoc -d manpage -b docbook -o alock.xml ' + str(source[0]))
|
||||||
|
os.system('xmlto man alock.xml')
|
||||||
|
os.remove('alock.xml')
|
||||||
|
return None
|
||||||
|
|
||||||
|
def createHtml(target, source, env):
|
||||||
|
"""Creates a html-site via asciidoc."""
|
||||||
|
os.system('asciidoc -d manpage -b xhtml -o ' + str(target[0]) + ' ' +
|
||||||
|
str(source[0]))
|
||||||
|
|
||||||
|
def prefixCombiner(prefix, itemlist, glue=''):
|
||||||
|
"""Returns a list of items where each element is prepend by given
|
||||||
|
prefix."""
|
||||||
|
result = []
|
||||||
|
for item in itemlist:
|
||||||
|
result.append(prefix + glue + item)
|
||||||
|
return result
|
||||||
|
|
||||||
|
# http://scons.tigris.org/servlets/ReadMsg?listName=users&msgNo=2739
|
||||||
|
# http://scons.tigris.org/servlets/ReadMsg?list=users&msgNo=2783
|
||||||
|
def alock_installFunc(dest, source, env):
|
||||||
|
"""Install a source file into a destination by copying it (and its
|
||||||
|
permission/mode bits)."""
|
||||||
|
|
||||||
|
owner = env.get('INSTALL_OWNER', None)
|
||||||
|
if owner:
|
||||||
|
try:
|
||||||
|
uid = pwd.getpwnam(owner)[2]
|
||||||
|
except TypeError:
|
||||||
|
uid = owner
|
||||||
|
else:
|
||||||
|
uid = -1
|
||||||
|
|
||||||
|
group = env.get('INSTALL_GROUP', None)
|
||||||
|
if group:
|
||||||
|
try:
|
||||||
|
gid = grp.getgrnam(group)[2]
|
||||||
|
except TypeError:
|
||||||
|
gid = group
|
||||||
|
else:
|
||||||
|
gid = -1
|
||||||
|
|
||||||
|
mode = env.get('INSTALL_MODE', None)
|
||||||
|
if not mode:
|
||||||
|
st = os.stat(source)
|
||||||
|
mode = (stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
|
||||||
|
if isinstance(mode, str):
|
||||||
|
mode = int(mode, 8)
|
||||||
|
|
||||||
|
shutil.copy2(source, dest)
|
||||||
|
|
||||||
|
if owner or group:
|
||||||
|
os.chown(dest, uid, gid)
|
||||||
|
|
||||||
|
os.chmod(dest, mode)
|
||||||
|
return 0
|
|
@ -33,7 +33,6 @@ if build['xrender']:
|
||||||
alock_sources += auth_sources + bg_sources + cursor_sources
|
alock_sources += auth_sources + bg_sources + cursor_sources
|
||||||
|
|
||||||
alock = build.Program('alock', alock_sources)
|
alock = build.Program('alock', alock_sources)
|
||||||
build.AddPostAction(alock, Chmod(alock, 0755))
|
|
||||||
|
|
||||||
if build['amd5']:
|
if build['amd5']:
|
||||||
md5 = alock_env.Copy()
|
md5 = alock_env.Copy()
|
||||||
|
|
Reference in a new issue