Safely install config files and generate keypair on install.
authorScott Cantor <cantor.2@osu.edu>
Thu, 5 Nov 2009 01:17:28 +0000 (01:17 +0000)
committerScott Cantor <cantor.2@osu.edu>
Thu, 5 Nov 2009 01:17:28 +0000 (01:17 +0000)
Portfile.in

index 2408f92..3adab00 100644 (file)
@@ -60,6 +60,18 @@ post-destroot {
        eval file delete [glob ${destroot}${prefix}/lib/${name}/*.la]
 }
 
+post-activate {
+    # Make sure initial conf files are present and set up correctly
+    set confDir ${prefix}/etc/${name}
+    foreach f [glob -tails -directory ${confDir} *.dist] {
+        regexp {(.+)\.dist} $f ign destname
+        if {![file exists ${confDir}/${destname}]} {
+            file copy ${confDir}/${f} ${confDir}/${destname}
+        }
+    }
+    system "cd ${prefix}/etc/${name} && ./keygen.sh -b"
+}
+
 startupitem.create      yes
 startupitem.name        shibd
 startupitem.executable  ${prefix}/sbin/shibd -F -f -p ${prefix}/var/run/${name}/shibd.pid