--- Portfile.org	2009-11-27 18:34:33.000000000 +0100
+++ Portfile	2009-12-11 07:49:02.000000000 +0100
@@ -24,13 +24,31 @@
 
 fetch.type          git
 git.url             http://www.auto.tuwien.ac.at/~mkoegler/git/pthsem.git
+git.branch          434babeea964b320fd8d11a161f76749642527a8
 
 depends_build       port:pkgconfig \
+                    port:autoconf \
+                    port:automake \
                     port:libtool \
                     port:git-core
 
+# generate configure script
+pre-configure {
+                    system "cd ${worksrcpath} && autoheader"
+                    system "cd ${worksrcpath} && aclocal"
+                    system "cd ${worksrcpath} && glibtoolize"
+                    system "cd ${worksrcpath} && autoconf"
+                    system "cd ${worksrcpath} && automake --add-missing"
+}
+
 configure.args      --enable-optimize --mandir=${prefix}/share/man
 
 test.run            yes
 
+# rename man-pages, because of nameclash with pth
+post-destroot {
+                    file rename ${destroot}/${prefix}/share/man/man1/pth-config.1 ${destroot}/${prefix}/share/man/man1/pthsem-config.1
+                    file rename ${destroot}/${prefix}/share/man/man3/pth.3 ${destroot}/${prefix}/share/man/man3/pthsem.3
+}
+
 use_parallel_build  no

