* Makefile.am: Add a rule to create a valid Portfile.
* distrib/macports/Portfile.in: New.
---
ChangeLog | 8 ++++++++
Makefile.am | 28 ++++++++++++++++++++++++++++
distrib/macports/Portfile.in | 39 +++++++++++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+), 0 deletions(-)
create mode 100644 distrib/macports/Portfile.in
diff --git a/ChangeLog b/ChangeLog
index f20fcec..9e0ea05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-09-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Generate a valid Portfile for MacPorts support.
+
+ * Makefile.am: Add a rule to create a valid Portfile.
+
+ * distrib/macports/Portfile.in: New.
+
2011-09-08 Guillaume Lazzara <z(a)lrde.epita.fr>
* lrde-scmstats.sh: Do not change permissions.
diff --git a/Makefile.am b/Makefile.am
index f89da9f..636f10b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -87,6 +87,34 @@ LRDE_NODIST_FILES = \
$(distdir)/milena/tests/registration/registration.cc \
$(distdir)/milena/tests/value/stack.cc
+PORTFILE=distrib/macports/Portfile
+
+TARBALL_GZ=$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz
+do_subst = sed -e 's|@packagename[@]|$(PACKAGE_TARNAME)|g' \
+ -e 's|@version[@]|$(PACKAGE_VERSION)|g' \
+ -e "s|@package_md5[@]|`md5sum $(TARBALL_GZ) | cut -d ' ' -f
1`|g" \
+ -e "s|@package_sha1[@]|`openssl sha1 $(TARBALL_GZ) | cut -d ' ' -f
2`|g" \
+ -e "s|@package_rmd160[@]|`openssl rmd160 $(TARBALL_GZ) | cut -d ' '
-f 2`|g"
+
+$(PORTFILE): dist $(top_srcdir)/distrib/macports/Portfile.in Makefile
+ rm -f $@ $@.tmp
+ rm -Rf distrib
+ srcdir=''; \
+ test -f ./$@.in || srcdir=$(srcdir)/; \
+ $(mkdir_p) distrib/macports
+ md5=`md5sum $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz`
+ sha1=`openssl sha1 $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz`
+ rmd160=`openssl rmd160 $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz`;
+ $(do_subst) $(srcdir)/$@.in >$@.tmp
+ chmod +x $@.tmp
+ chmod a-w $@.tmp
+ mv $@.tmp $@
+
+CLEANFILES = $(PORTFILE)
+
+
+port: $(PORTFILE)
+
## FIXME: Running `build-aux/build_unit_test.sh' just to update
## `milena/tests/unit_test/unit-tests.mk' is overkill:
##
diff --git a/distrib/macports/Portfile.in b/distrib/macports/Portfile.in
new file mode 100644
index 0000000..129a5e8
--- /dev/null
+++ b/distrib/macports/Portfile.in
@@ -0,0 +1,39 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4
-*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:s
+# $Id$
+
+PortSystem 1.0
+
+name @packagename@
+version @version@
+categories devel framework graphics science
+platforms darwin
+license GPL-2
+maintainers Olena Team
+description Software platform for efficient and generic image processing
+long_description It is composed of a Generic and efficient C++ image \
+ processing library, a framework for Document Image \
+ Analysis and Python bindings.
+homepage
http://olena.lrde.epita.fr
+master_sites
http://www.lrde.epita.fr/dload/olena/
+
+checksums md5 @package_md5@ \
+ sha1 @package_sha1@ \
+ rmd160 @package_rmd160@
+
+depends_lib port:GraphicsMagick \
+ port:tiff
+
+supported_archs i386 x86_64
+
+variant scribo description {Add a DIA framework} {
+ depends_lib-append port:tesseract \
+ port:qt4-mac \
+ port:fop
+ configure.args-append --enable-scribo
+}
+
+variant swilena description {Add Python bindings} {
+ configure.args-append --enable-swilena
+}
+
+default_variants +scribo
\ No newline at end of file
--
1.7.2.5