macports: add a hook to replace the keytrans shebang line with one that use /usr...
[monkeysphere.git] / packaging / macports / Portfile
index 9680b4e12cb2d1003864cfedcf1fd7a845e60b10..7d87a9389b726205e8e500b768fda73b1af3ed20 100644 (file)
@@ -20,16 +20,56 @@ platforms           darwin
 
 depends_run         bin:ssh:openssh \
                     port:gnupg \
-                    port:perl5.10 \
-                    port:p5-crypt-rsa \
+                    port:perl5 \
+                    port:p5-crypt-openssl-rsa \
+                    port:p5-crypt-openssl-bignum \
                     port:p5-digest-sha1 \
-                    port:procmail
+                    port:procmail \
+                    port:socat
 
 master_sites        http://archive.monkeysphere.info/debian/pool/monkeysphere/m/monkeysphere/
 distname            ${name}_${version}
 extract.suffix      .orig.tar.gz
 worksrcdir          ${name}-${version}
 checksums           md5 8590532f4702fa44027a6a583657c9ef
+
 use_configure       no
+
+post-build {
+    # update paths to SYS*DIRs
+    exec sed -i .tmp -e "s|/etc/monkeysphere|${prefix}/etc/monkeysphere|g" \
+        ${worksrcpath}/src/share/defaultenv \
+        ${worksrcpath}/src/transitions/0.23 \
+        ${worksrcpath}/man/man1/monkeysphere.1 \
+        ${worksrcpath}/man/man8/monkeysphere-authentication.8 \
+        ${worksrcpath}/man/man8/monkeysphere-host.8 \
+        ${worksrcpath}/etc/monkeysphere-authentication.conf
+    exec sed -i .tmp -e "s|/var/lib/monkeysphere|${prefix}/var/db/monkeysphere|g" \
+        ${worksrcpath}/src/transitions/0.23 \
+        ${worksrcpath}/man/man1/monkeysphere.1 \
+        ${worksrcpath}/man/man8/monkeysphere-authentication.8 \
+        ${worksrcpath}/man/man8/monkeysphere-host.8 \
+        ${worksrcpath}/src/monkeysphere-host \
+        ${worksrcpath}/src/monkeysphere-authentication \
+        ${worksrcpath}/doc/getting-started-admin.mdwn
+    exec sed -i .tmp -e "s|/usr/share/monkeysphere|${prefix}/share/monkeysphere|g" \
+        ${worksrcpath}/src/monkeysphere-host \
+        ${worksrcpath}/src/monkeysphere-authentication \
+        ${worksrcpath}/src/monkeysphere
+
+    # fix perl shebang line
+    exec sed -i .tmp -e "s|#!/usr/bin/perl -T|#!/usr/bin/env perl|g" \
+        ${worksrcpath}/src/share/keytrans
+
+    # remove leftover sed cruft
+    exec find ${worksrcpath} -name *.tmp -delete
+}
+
 destroot.destdir    DESTDIR=${destroot}${prefix}
 destroot.args       PREFIX=
+
+# variant to use the port version of bash, which may be much newer
+# than the one provided by the system
+variant port-bash description {use port version of Bash} {
+    depends_run-append port:bash
+}