Commits

Shlomi Fish committed d67b2f3

Convert the installation instructions to CMake.

  • Participants
  • Parent commits 3483843

Comments (0)

Files changed (2)

installer/INSTALL

 
     # perl -MCPAN -e "install Task::Latemp"
 
-Afterwards, install "scons" (http://www.scons.org/) and type
-"scons -Q install" to install.
+Afterwards, install "cmake" ( http://www.cmake.org/ ) and type:
+
+    mkdir build
+    cd build
+    cmake ..
+    make
+    make install
 
 By default it will be installed under "/usr/local". If you'd like to install
-under a different prefix, specify it using the PREFIX parameter:
+under a different prefix, specify it using the CMAKE_INSTALL_PREFIX parameter:
 
-    scons -Q PREFIX="$HOME/apps/latemp" install
+    cmake -DCMAKE_INSTALL_PREFIX="$HOME/apps/latemp" ..
 
 You'll also need to install Website Meta Language ( http://thewml.org/ ).
 Check your distribution for packages, or install it from source.

installer/SConstruct

-import re
-import os
-
-v_file = open('ver.txt', 'rb')
-version = v_file.readline().rstrip()
-v_file.close()
-
-def config_script_scanner_function(node, env, path):
-    return ['ver.txt']
-
-def config_script_bld_action(target, source, env):
-    def quote(matchobj):
-        return "\\"+matchobj.group(0)
-    source_fn = str(source[0])
-    target_fn = str(target[0])
-    prefix = env['PREFIX']
-    prefix_quoted = re.sub("[\\\\\"$@]", quote, prefix, 0)
-    f = open(source_fn, 'rb')
-    source_text = f.read()
-    f.close()
-    target_text = source_text.replace('<<<PREFIX>>>', prefix_quoted).replace('<<<VERSION>>>', version)
-    f = open(target_fn, 'wb')
-    f.write(target_text)
-    f.close()
-    os.chmod(target_fn, 0755)
-
-
-package_files = []
-
-config_script_scnr = Scanner(function = config_script_scanner_function)
-config_script_bld = Builder(action = config_script_bld_action, source_scanner = config_script_scnr)
-scp_bld = Builder(action = 'scp $SOURCE shlomif@shell.berlios.de:/home/groups/web-cpan/htdocs/latemp/download/arcs/')
-rsync_bld = Builder(action = 'rsync -vv --progress --rsh=ssh $SOURCE shlomif@shell.berlios.de:/home/groups/web-cpan/htdocs/latemp/docs/')
-
-env = Environment(tools = ["default", "disttar"], toolpath=".")
-env.Append(BUILDERS = {'ConfigScript': config_script_bld, 'Upload':scp_bld, 'Rsync':rsync_bld})
-
-config_file = 'latemp.conf'
-vars = Variables(config_file)
-vars.Add(PathVariable('PREFIX',
-    'Directory to install under (Default: /usr/local)',
-    '/usr/local'))
-vars.Add('DESTDIR',
-        'Prefix to append to the installation directory (without affecting the paths in the files) - Default: empty',
-    '')
-
-vars.Update(env)
-vars.Save(config_file, env)
-
-idir_prefix = '$DESTDIR$PREFIX'
-Export('env idir_prefix')
-
-latemp_wml_files = []
-
-doc_files = []
-
-themes = [
-    { 'id':"better-scm" },
-    { 'id':"perl-begin-1" },
-    { 'id':"sinorca-2.0" },
-    { 'id':"css-zen-garden" },
-    ]
-
-for file in [ "render.pl", "latemp-ref.pod", "latemp-ref.html" ]:
-    doc_files.append(env.File(file, 'docs'))
-    package_files.append('docs/' + file)
-
-env.Alias('build', env.Command('docs/latemp-ref.html', 'docs/latemp-ref.pod', "cd docs && perl render.pl"))
-env.Alias('doc_upload', env.Rsync("popd9j3490m2r8vnkwnc8", 'docs/latemp-ref.html'))
-
-for file in ['html-header.wml','html-head-tag.wml','h-w-nav-menu.wml', \
-        'latemp-driver.wml', 'latemp-main.wml', 'latemp-prelude.wml',
-        'news-management.wml', 'template-params.wml', 'texts.wml',
-        'utils.wml']:
-    latemp_wml_files.append(env.File(file, 'wml/latemp'))
-    package_files.append('wml/latemp/' + file)
-
-for t in themes:
-    id = t['id']
-    t['scons_file'] = env.File('template.wml', 'wml/latemp/themes/' + id + '/')
-    package_files.append('wml/latemp/themes/' + id + '/' + 'template.wml')
-
-latemp_scripts = []
-for name in ['latemp-config', 'latemp-setup']:
-    source_script = (name + '.pl')
-    script = env.ConfigScript(target = name, source = source_script )
-    env.Alias('build', script)
-    package_files.append(source_script)
-    latemp_scripts.append(script)
-
-def add_install(install_path, the_file):
-    env.Alias('install', env.Install(install_path, the_file))
-
-wml_install_path = idir_prefix + '/lib/wml/include/'
-latemp_wml_install_path = wml_install_path + 'latemp/'
-for file in latemp_wml_files:
-    add_install(latemp_wml_install_path, file)
-
-for t in themes:
-    add_install(latemp_wml_install_path + 'themes/' + t['id'] + '/', t['scons_file'])
-
-package_files = package_files + [
-        'Changes',
-        'COPYING',
-        'disttar.py',
-        'INSTALL',
-        'README',
-        'SConstruct',
-        'TODO',
-        'ver.txt',
-        ]
-
-dist_node = env.DistTar("latemp-" + version + ".tar.gz", package_files)
-env.Alias('dist', dist_node)
-
-env.Alias('dist_upload', env.Upload("h67jk343jvnsidnvnoisd", "latemp-" + version + ".tar.gz"))
-
-for script in latemp_scripts:
-    add_install(idir_prefix + '/bin', script)
-
-# Set the default target to build.
-env.Default('build');
-