4 Maybe you have noticed my blog entry on gtkNode [1], and you
5 should have noticed the patch that I have already submitted [2].
8 Here I send you a profound modification of gtkNode, concerning
9 the configuration and build process:
11 - it makes use of GNU's Autoconf and Automake, and especially
12 makes use of the Autoconf macros for Erlang that will be soon
13 added to Autoconf [3]: simply execute the classical
14 "configure; make; make install";
16 - the configure script is well documented (thanks to my
17 Erlang-specific macros!): ./configure --help;
19 - my Makefile.am files support out-of-tree building (which is a
20 recommended way of building Automake-based applications...),
21 i.e. one can do for instance:
23 > > mkdir -p /tmp/gtknode-src
24 > > cd /tmp/gtknode-src
25 > > tar xvzf gtknode-0.1.tar.gz
26 > > mkdir -p /tmp/gtknode-build
27 > > ../gtknode-src/gtknode-0.1/configure
29 I.e., all generated files will be generated in the build tree,
30 not in the original tree. It makes it easier to clean up.
32 - my Makefile.am files support installation (make install) and
33 archive building (make dist); notably, the attached
34 gtknode-0.1.tar.gz was produced by executing
35 "configure ; make dist";
37 - they also support the DESTDIR variable as a prefix for testing
38 installation. E.g. one can execute:
41 > > make install DESTDIR=/tmp/testinstall
42 and all files are installed under /tmp/testinstall...
44 - I have moved files and directories around to better respect
45 OTP's design principles [4], and Jungerl's directives [5]: all C
46 code goes into 'c_src' and only Erlang code stays in 'src', etc.
48 - I have renamed 'gtkNode' into 'gtknode' in Erlang code, to make
49 it more similar to the other Erlang/OTP libraries (e.g.,
50 'Jinterface' is named 'jinterface' in the code);
52 - I have much simplified the code generator; notably, 1) I have
53 simplified generator.erl to not determine file names itself, but
54 to let it to the configuration/build environment, and 2)
55 generated file names do no more contain the GTK version number
56 (although I can easily revert that precise change if you
59 - examples have been moved into the 'doc' directory (although I
60 am not sure about this, and I still don't know to which
61 directory to install them on a 'make install');
63 - I have slightly modified gtknode.erl to make use of
64 code:priv_dir/1 instead of manual directory building;
66 - I have maybe forgotten something in this list... and I have not
67 yet updated the ChangeLog.
69 I have also attached the erlang.m4 file that contains the
70 Autoconf macros that you would need to build that version if you
71 modify anything. To install those macros, see [3].
74 My motivation for that refactoring was to be able to easily build
75 a (non-official for now) Debian package of gtkNode. Using GNU's
76 Autotools it is now trivial. And I hope that it would make it
77 easy to build gtkNode on Windows.
78 I am waiting for your comments on that work, and your
79 aknowldegment before I create and publish a Debian package.
81 I know this is a big refactoring, but I am willing to help you
82 integrate most of my modification if there is any problem.
84 There are still interesting perspectives regarding packaging,
85 such as making gtkNode a real Erlang/OTP application (i.e. write
93 http://www.csg.is.titech.ac.jp/~lenglet/archives/2006/01/index.html#e2006-01-26T18_11_33.txt
95 http://sourceforge.net/tracker/index.php?func=detail&aid=1415302&group_id=73688&atid=538572
97 http://www.csg.is.titech.ac.jp/~lenglet/archives/2006/01/index.html#e2006-01-27T22_53_14.txt
99 http://erlang.se/doc/doc-5.4.12/doc/design_principles/applications.html#7.4
101 http://cvs.sourceforge.net/viewcvs.py/jungerl/jungerl/README?rev=1.7&view=auto
105 > > p.s. what are you using this for? gtkNode, kerberos-slaves...
108 I have published nothing about that yet, but I can tell you a
109 bit... I am developing a H.323 VoIP system in Erlang and based
110 on real-time Ethernet networks, as a demonstration of a method I
111 am defining for the design of open distributed management
112 systems. (H.323 gatekeepers and gateways form in fact a big
113 distributed management system...)
115 I use of Kerberos/remctl to start slaves for monitoring. I am
116 using IDX Tsunami's ts_os_mon module, and traditionally they use
117 ssh. But ssh is not practical when monitoring more than a couple
118 of systems (have to distribute public keys, etc.)
120 As for gtkNode, I shall be able to make demos in the future, and
121 a management console in GTK+ has more appeal than a TK-one.
123 > > alas, i'm not very proficient open-source guy... your blog
124 > > was very nice though.
126 I mentioned my blog only because this article was the occasion I
127 chose to register it on www.planeterlang.org... ;-)
129 > > but you need to be root to install this macro package? so
130 > > no normal person could do it? (including me, unless i crack
131 > > root on my work machine).
133 For now, yes. But I have submitted the macros for inclusion into
134 Autoconf, and they accepted. We are making the copyright
135 transfer paperwork, so it could still take one week or two.
137 You also have the possibility to simply put the macros directly
138 into the aclocal.m4 by hand:
139 > > cat erlang.m4 >> aclocal.m4
140 That is all! (and I should have done that myself before sending
141 the archive to you...)
142 aclocal.m4 is simply a local copy of all the M4 macros used by
143 the configure.ac file, that can be distributed with the project.
144 aclocal.m4 is created by aclocal by (badly) recursively
145 analyzing configure.ac.
146 But it does not include macros that are part of Autoconf itself
147 since Autoconf has its own system-wide macro cache.
149 Anyway, in the meanwhile I have made a Debian package to make
150 installation of erlang.m4 trivial. (I am working on setting up a
151 personal archive for APT, and I am waiting for the copyright
152 transfer to be OK before publishing that package).
154 >> > > environment, and 2) generated file names do no more contain
155 >> > > the GTK version number (although I can easily revert that
156 >> > > precise change if you prefer);
158 > > well, there is a reason for this (although a pretty bad
159 > > one); at work i build the linux and the solaris versions on
160 > > the same file system. of course, the have different GTK
161 > > versions... i guess the out-of-tree build is The Right Thing
164 Ok, so I guess that naming the binary executable "gtkNode-linux",
165 etc. was for the same reason.
166 From a Debian packaging point of view, having binaries with
167 arch-dependent names was a bad thing also.
169 >> > > - examples have been moved into the 'doc' directory
170 >> > > (although I am not sure about this, and I still don't know
171 >> > > to which directory to install them on a 'make install');
173 > > i think priv/examples is canonical.
175 Ok, I will change this.
176 And I will also make it configurable through ./configure options,
177 because on Debian they should go
178 into /usr/share/doc/gtknode/examples.
180 > > btw, have you seen erlmerge?
181 > > http://www.trapexit.org/docs/howto/erlmerge.html seens like a
184 I don't like the idea of mixing configuration and installation
185 concerns. For configuration nothing beats Autoconf, and for
186 installation nothing beats native packaging systems such as
187 Debian's or RPM, etc.
188 Just compare erlmerge with Debian packaging: erlmerge does not
189 have meta-packages nor tasks, does not have "Suggests" or
190 "Recommends" dependencies (only "Depends" ones), does not have
191 disjunctions of dependencies (e.g. "mnesia | odbc"),
192 dependencies are only to specific versions of apps (e.g. it is
193 not possible to depend on "stdlib (>= 1.12.7)"), etc.
195 And having programs making their own package management in
196 parallel to the native system's system ends up with a mess for
197 managing upgrades, with multiple versions of apps installed in
198 parallel by every application or user with its own package
199 system... Wait... but that's Windows?! ;-)
200 Plugin-based apps such as Eclipse, and Jakarta Maven (the
201 equivalent of erlmerge for Java) or Pear (idem for PHP) have the
204 Also I don't see how to use erlmerge to manage the configuration
205 and building of multi-language projects such as gtkNode, which
206 need to build and install arch-specific binaries?!
208 The ideal solution would be to enhance Automake to handle Erlang
209 files: .erl, .rel, .app, etc. But Automake seems much more
210 difficult to modify than Autoconf (which is all M4-based).
211 Just for one reason: Automake is essentially one big Perl script.