miller/doc/content-for-build.html
2016-06-11 00:27:15 -04:00

244 lines
10 KiB
HTML

POKI_PUT_TOC_HERE
<h1>Miller license</h1>
<p/>Two-clause BSD license <a href="https://github.com/johnkerl/miller/blob/master/LICENSE.txt">
https://github.com/johnkerl/miller/blob/master/LICENSE.txt</a>.
<h1>Prebuilt executables</h1>
<p/> Please see <a href="https://github.com/johnkerl/miller/releases">
https://github.com/johnkerl/miller/releases</a> where there are builds for OSX
Yosemite, Linux i686 (statically linked), and Linux x86-64 (dynamically
linked).
<p/> Homebrew installation support for OSX is available via
POKI_CARDIFY(brew update && brew install miller)HERE
<p/> You may already have <tt>mlr</tt> available in your platform&rsquo;s
package manager on NetBSD, Debian Linux, Ubuntu Xenial and upward, Arch Linux, or perhaps other distributions.
For example, on Debian/Ubuntu, you can try
POKI_CARDIFY(sudo apt-get install miller)HERE
<h1>Building from source</h1>
<h2>From release tarball using autoconfig</h2>
<p/>Miller allows you the option of using GNU autoconfigure to build portably.
<p/>Grateful acknowledgement: Miller&rsquo;s GNU autoconfig work was done by
the generous and expert efforts of <a href="https://github.com/0-wiz-0/">Thomas
Klausner</a>.
<ul>
<li/> Install the <tt>flex</tt> package using your system&rsquo;s package
manager (<tt>apt-get</tt>, <tt>yum install</tt>, etc.).
<li/> Obtain <tt>mlr-i.j.k.tar.gz</tt> from <a
href="https://github.com/johnkerl/miller/tags">https://github.com/johnkerl/miller/tags</a>,
replacing <tt>i.j.k</tt> with the desired release, e.g. <tt>2.2.1</tt>.
<li/> <tt>tar zxvf mlr-i.j.k.tar.gz</tt>
<li/> <tt>cd mlr-i.j.k</tt>
<li> Various configuration options of your choice, e.g.
<ul>
<li/> <tt>./configure</tt>
<li/> <tt>./configure --prefix=/usr/local</tt>
<li/> <tt>./configure --prefix=$HOME/pkgs</tt>
<li/> <tt>./configure CC=clang</tt>
<li/> <tt>./configure --disable-shared</tt> (to make a statically linked executable)
<li/> <tt>./configure 'CFLAGS=-Wall -std=gnu99 -O3'</tt>
<li/> etc.
</ul>
<li/> <tt>make</tt> creates the <tt>c/mlr</tt> executable
<li/> <tt>make check</tt>
<li/> <tt>make install</tt> copies the <tt>c/mlr</tt> executable to your prefix&rsquo;s <tt>bin</tt> subdirectory.
</ul>
<h2>From git clone using autoconfig</h2>
<ul>
<li/> Install the following packages using your system&rsquo;s package manager
(<tt>apt-get</tt>, <tt>yum install</tt>, etc.):
<tt>automake autoconf libtool flex</tt>
<li/> <tt>git clone https://github.com/johnkerl/miller</tt>
<li/> <tt>cd miller</tt>
<li/> <tt>autoreconf -fiv</tt>
<li/> Then continue from <tt>./configure</tt> as above.
</ul>
<h2>Creating a release tarball</h2>
<ul>
<li/> Proceed from git-clone as above.
<li/> Then edit the package version at the top of <tt>configure.ac</tt> as well as <tt>c/mlrvers.h</tt>.
<li/> Then <tt>make distcheck</tt>.
</ul>
<h2>Without using autoconfig</h2>
<p/> GNU autoconfig is familiar to many users, and indeed plenty of folks won&rsquo;t bother to use an open-source
software package which doesn&rsquo;t have autoconfig support. And this is for good reason: GNU autoconfig allows
us to build software on a wide diversity of platforms. For this reason I&rsquo;m happy that Miller supports
autoconfig.
<p/>But, many others (myself included!) find autoconfig confusing: if it works
without errors, great, but if not, the <tt>./configure &amp;&amp; make</tt>
output can be exceedingly difficult to decipher. And this also can be a
turn-off for using open-source software: if you can&rsquo;t figure out the
build errors, you may just keep walking. For this reason I&rsquo;m happy that
Miller allows you to build without autoconfig. (Of course, if you have any
build errors, feel free to contact me at
<a href="mailto:kerl.john.r+miller@gmail.com">kerl.john.r+miller@gmail.com</a>,
&mdash; or, better, open an issue with &ldquo;New Issue&rdquo; at
<a href="https://github.com/johnkerl/miller/issues">
https://github.com/johnkerl/miller/issues</a>.)
<p/>Steps:
<ul>
<li/> Obtain a release tarball or git clone.
<li/> <tt>cd</tt> into the <tt>c</tt> subdirectory.
<li/> Edit the <tt>INSTALLDIR</tt> in <tt>Makefile.no-autoconfig</tt>.
<li/> To change the C compiler, edit the <tt>CC=</tt> lines in
<tt>Makefile.no-autoconfig</tt> and <tt>dsls/Makefile.no-autoconfig</tt>.
<li/> <tt>make -f Makefile.no-autoconfig</tt> creates the <tt>mlr</tt>
executable and runs unit/regression tests (i.e. the equivalent of both
<tt>make</tt> and <tt>make check</tt> using autoconfig).
<li/> <tt>make install</tt> copies the <tt>mlr</tt> executable to your install directory.
</ul>
<p/>The <tt>Makefile.no-autoconfig</tt> is simple: little more than <tt>gcc
*.c</tt>. Customzing is less automatic than autoconfig, but more transparent.
I expect this makefile to work with few modifications on a large fraction of
modern Linux/BSD-like systems: I&rsquo;m aware of successful use with
<tt>gcc</tt> and <tt>clang</tt>, on Ubuntu 12.04 LTS, SELinux, Darwin (MacOS
Yosemite), and FreeBSD.
<h1>In case of problems</h1>
<p/> If you have any build errors, feel free to contact me at <a
href="mailto:kerl.john.r+miller@gmail.com">kerl.john.r+miller@gmail.com</a>,
&mdash; or, better, open an issue with &ldquo;New Issue&rdquo; at
<a href="https://github.com/johnkerl/miller/issues">
https://github.com/johnkerl/miller/issues</a>.
<h1>Dependencies</h1>
<h2>Required external dependencies</h2>
<p/> These are necessary to produce the <tt>mlr</tt>
executable.
<ul>
<li/> <tt>gcc</tt>, <tt>clang</tt>, etc. (or presumably other compilers; please
open an issue or send me a pull request if you have information for me about
other 21st-century compilers)
<li/> The standard C library
<li/> <tt>flex</tt>
<li/> <tt>automake</tt>, <tt>autoconf</tt>, and <tt>libtool</tt>, if you build with autoconfig
</ul>
<h2>Optional external dependencies</h2>
This documentation pageset is built using <boldmaroon>Poki</boldmaroon>:
<a href="http://johnkerl.org/poki/doc">docs here</a>,
<a href="https://github.com/johnkerl/poki">source code here</a>.
Note that <a href="http://johnkerl.org/miller/doc/index.html">http://johnkerl.org/miller/doc/index.html</a>
is nothing more than Miller&rsquo;s <tt>doc</tt> directory served up by a web server.
You&rsquo;ll need <tt>poki</tt> if you modify documents, or if you modify the code in a way that affects the documents
(there are auto-run snippets inserted into the doc).
The best way to discover this is to run <tt>make install</tt> as above, then run <tt>poki</tt> in Miller&rsquo;s
<tt>doc</tt> subdirectory, then run <tt>git diff</tt> to see if docs were affected
by the code mod. (If so, commit and push them.)
<h2>Internal dependencies</h2>
These are included within the <a href="https://github.com/johnkerl/miller">Miller source tree</a> and do not
need to be separately installed (and in fact any separate installation will not be picked up in the Miller build):
<ul>
<li/><a href="http://en.wikipedia.org/wiki/Mersenne_Twister">Mersenne Twister</a> for pseudorandom-number
generation: <a href="https://github.com/johnkerl/miller/blob/master/c/lib/mtrand.c">C implementation by Nishimura and Matsumoto</a> with license terms respected.
<li/> <a href="http://www.jera.com/techinfo/jtns/jtn002.html">MinUnit</a> for unit-testing,
with as-is-no-warranty license <a href="http://www.jera.com/techinfo/jtns/jtn002.html#License">http://www.jera.com/techinfo/jtns/jtn002.html#License</a>,
<a href="https://github.com/johnkerl/miller/blob/master/c/lib/minunit.h">
https://github.com/johnkerl/miller/blob/master/c/lib/minunit.h</a>.
<li/> The <a href="http://www.hwaci.com/sw/lemon/">Lemon parser-generator</a>, the author of which
<a href="https://github.com/johnkerl/miller/blob/master/c/dsls/lemon.c">explicitly disclaims
copyright</a>.
<li/> The <a href="https://github.com/udp/json-parser">udp JSON parser</a>, with BSD2 license.
</ul>
<h1>Creating a new release: for developers</h1>
<p/>At present I&rsquo;m the primary developer so this is just my checklist for making new releases.
<p/>In this example I am using version 3.4.0; of course that will change for subsequent revisions.
<ul>
<li>Update version found in <tt>mlr --version</tt> and <tt>man mlr</tt>:
<ul>
<li/> Edit <tt>configure.ac</tt>, <tt>c/mlrvers.h</tt>, and <tt>mlr.spec</tt>
from <tt>3.3.2-dev</tt> to <tt>3.4.0</tt>.
<li/> <tt>make -C c -f Makefile.no-autoconfig installhome &amp;&amp;
make -C doc -f Makefile.no-autoconfig all installhome</tt>
<li/> Commit and push.
<li/> ISP upload so <a href="http://johnkerl.org/miller/doc/index.html">http://johnkerl.org/miller/doc/index.html</a>
will have updated head-docs.
</ul>
<li>Create the release tarball and SRPM:
<ul>
<li/> On buildbox: <tt>autoreconf -fiv &amp;&amp; ./configure &amp;&amp; make distcheck</tt>
<li/> On buildbox: make SRPM as in <a href="https://github.com/johnkerl/miller/blob/master/README-RPM.md">
https://github.com/johnkerl/miller/blob/master/README-RPM.md</a>
<li/> Pull back release tarball <tt>mlr-3.4.0.tar.gz</tt> and SRPM <tt>mlr-3.4.0-1.el6.src.rpm</tt> from buildbox,
and <tt>mlr.arch</tt> binaries from whatever buildboxes.
</ul>
<li/>Create the Github release tag:
<ul>
<li/> Write the release notes
<li/> Attach the release tarball, SRPM, and binaries
<li/> Publish the release
</ul>
<li/>Create the release-specific docs:
<ul>
<li/> Pull the Github-generated source <tt>.tgz</tt> from Github to ISP
miller-releases directory and unpack and <tt>cd</tt> into it.
<li/> <tt>cd</tt> into <tt>doc</tt> subdir. Edit <tt>template.html</tt>&rsquo;s <tt>titleinbody</tt> tag from
<tt>Miller</tt> to <tt>Miller 3.4.0</tt> and poki-build.
<li/> ISP upload
<li/> Back in the Github repo, edit <tt>doc/content-for-release-docs.html</tt> to include new release, poki-build,
push/commit, and ISP upload.
</ul>
<li/>Notify:
<ul>
<li/> Submit <tt>brew</tt> pull request; notify any other distros which don&rsquo;t appear to have autoupdated
since the previous release.
<pre>
git remote add upstream https://github.com/Homebrew/homebrew-core # one-time setup only
git fetch upstream
git rebase upstream/master
git checkout -b miller-3.4.0
shasum -a 256 /path/to/mlr-3.4.0.tar.gz
edit Formula/miller.rb
git add Formula/miller.rb
git commit -m 'miller 3.4.0'
git push -u origin miller-3.4.0
(submit the pull request)
</pre>
<li/> Social-media updates.
</ul>
<li/>Afterwork:
<ul>
<li> Edit <tt>configure.ac</tt> and <tt>c/mlrvers.h</tt> to change version from <tt>3.4.0</tt> to
<tt>3.4.0-dev</tt>.
<li/> <tt>make -C c -f Makefile.no-autoconfig installhome &amp;&amp;
make -C doc -f Makefile.no-autoconfig all installhome</tt>
<li> Commit and push.
</ul>
</ul>