Index: /SConstruct
===================================================================
--- /SConstruct	(revision 188)
+++ /SConstruct	(revision 189)
@@ -1,12 +1,31 @@
+
 build_cmds='''
 rm -rf .release;
-mkdir -p `dirname .release/$SOURCE`;
-svn export svn+ssh://sentinelchicken.org/home/projects/subversion/reglookup/$SOURCE .release/$SOURCE;
+svn export svn+ssh://sentinelchicken.org/home/projects/subversion/reglookup/$SOURCE .release/%s;
 #XXX: Can this be less of a hack?
-cd .release/$SOURCE && scons doc && cd ..;
-cd .release && tar cf $SOURCE.tar $SOURCE && gzip -9 $SOURCE.tar;
-mv .release/$SOURCE.tar.gz ..
+cd .release/%s && scons doc
+cd .release && tar cf %s.tar %s && gzip -9 %s.tar;
+mv .release/%s.tar.gz . && rm -rf .release
 '''
-release_builder = Builder(action=build_cmds)
+
+buildable_files=('reglookup-trunk.tar.gz',)
+
+def generate_cmds(source, target, env, for_signature):
+    ret_val = ''
+    for t in target:
+        if str(t) in buildable_files:
+            t_base = str(t).split('.')[0]
+            ret_val += build_cmds % (t_base,t_base,t_base,
+                                     t_base,t_base,t_base)
+        else:
+            return '#ERROR: cannot build "%s".  Acceptable targets: %s' % (t, repr(buildable_files))
+
+    return ret_val
+
+
+release_builder = Builder(generator = generate_cmds,
+                          suffix = '.tar.gz',
+                          src_suffix = '',
+                          prefix='reglookup-')
 
 env = Environment()
@@ -14,8 +33,6 @@
 
 
-env.Release('trunk')
-
-
-
+env.Release(Dir('trunk'))
+#env.Release('reglookup-0.13.0.tar.gz', Dir('releases/0.13.0'))
 
 Default(None)
Index: /doc/TODO
===================================================================
--- /doc/TODO	(revision 188)
+++ /doc/TODO	(revision 189)
@@ -27,4 +27,5 @@
    everything.  I'd like to switch to a suite of shell scripts driven by
    minimal make rules.  If you got any ideas on this, shoot them my way.
+   scons?
 
  - Unicode support still needs improvement.  While parsing strings seems
@@ -39,7 +40,4 @@
    lower-level functions of regfi.c.
 
- - The smb_deps.h and smb_deps.c content is almost eliminated.  Just need
-   to integrate parts that are being kept into regfi or other modules.
-
  - Consider switching from libiconv to Joachim Metz's libuna for
    increased portability and easier builds.
Index: /trunk/SConstruct
===================================================================
--- /trunk/SConstruct	(revision 188)
+++ /trunk/SConstruct	(revision 189)
@@ -2,5 +2,5 @@
 cflags = '-std=gnu99 -pedantic -Wall -ggdb'
 
-if True:
+if False:
     libiconv_path='/usr/local/src/libiconv-1.13-mingw32-dev'
     env = Environment(CC='i586-mingw32msvc-cc',
@@ -29,7 +29,9 @@
 libregfi = env.SharedLibrary(lib_src, LIBS=['m','pthread'])
 
+
 # Executables
 reglookup = env.Program('src/reglookup.c')
 reglookup_recover = env.Program('src/reglookup-recover.c')
+
 
 # Documentation
@@ -39,6 +41,5 @@
                       + man_fixup + '| gzip -9 > $TARGET',
                       suffix = '.gz',
-                      src_suffix = '.docbook',
-                      prefix='man/man1/') # XXX: only works for .1.docbook files...
+                      src_suffix = '.docbook')
 env['BUILDERS']['ManPage'] = man_builder
 
@@ -46,4 +47,15 @@
 man_reglookup_recover = env.ManPage('doc/reglookup-recover.1.docbook')
 man_reglookup_timeline = env.ManPage('doc/reglookup-timeline.1.docbook')
+
+
+# Installation
+prefix='/usr/local/'
+
+# XXX: need to install reglookup-timeline
+env.Install(prefix+'bin', [reglookup, reglookup_recover, 'bin/reglookup-timeline'])
+env.Install(prefix+'lib', [libregfi, libregfi_static])
+env.Install(prefix+'man/man1', [man_reglookup, man_reglookup_recover,
+                                man_reglookup_timeline])
+
 
 # User Friendly Targets
@@ -53,4 +65,5 @@
 env.Alias('bin', [reglookup_recover, reglookup])
 env.Alias('doc', [man_reglookup,man_reglookup_recover,man_reglookup_timeline])
+env.Alias('install', [prefix+'bin', prefix+'lib', prefix+'man'])
 
 Default('bin', libregfi)
