Blame README.md

Packit eed199
# About
Packit eed199
Packit eed199
The libmaxminddb library provides a C library for reading MaxMind DB files,
Packit eed199
including the GeoIP2 databases from MaxMind. This is a custom binary format
Packit eed199
designed to facilitate fast lookups of IP addresses while allowing for great
Packit eed199
flexibility in the type of data associated with an address.
Packit eed199
Packit eed199
The MaxMind DB format is an open format. The spec is available at
Packit eed199
http://maxmind.github.io/MaxMind-DB/. This spec is licensed under the Creative
Packit eed199
Commons Attribution-ShareAlike 3.0 Unported License.
Packit eed199
Packit eed199
See http://dev.maxmind.com/ for more details about MaxMind's GeoIP2 products.
Packit eed199
Packit eed199
# License
Packit eed199
Packit eed199
This library is licensed under the Apache License, Version 2.
Packit eed199
Packit eed199
# Installation
Packit eed199
Packit eed199
## From a Tarball
Packit eed199
Packit eed199
This code is known to work with GCC 4.4+ and clang 3.2+. It should also work
Packit eed199
on other compilers that supports C99, POSIX 2011.11, and the `-fms-extensions
Packit eed199
flag` (or equivalent). The latter is needed to allow an anonymous union in a
Packit eed199
structure.
Packit eed199
Packit eed199
To install this code, run the following commands:
Packit eed199
Packit eed199
    $ ./configure
Packit eed199
    $ make
Packit eed199
    $ make check
Packit eed199
    $ sudo make install
Packit eed199
    $ sudo ldconfig
Packit eed199
Packit eed199
You can skip the `make check` step but it's always good to know that tests are
Packit eed199
passing on your platform.
Packit eed199
Packit eed199
The `configure` script takes the standard options to set where files are
Packit eed199
installed such as `--prefix`, etc. See `./configure --help` for details.
Packit eed199
Packit eed199
If after installing, you receive an error that `libmaxminddb.so.0` is missing
Packit eed199
you may need to add the `lib` directory in your `prefix` to your library path.
Packit eed199
On most Linux distributions when using the default prefix (`/usr/local`), you
Packit eed199
can do this by running the following commands:
Packit eed199
Packit eed199
    $ sudo sh -c "echo /usr/local/lib  >> /etc/ld.so.conf.d/local.conf"
Packit eed199
    $ ldconfig
Packit eed199
Packit eed199
## From the Git Repository
Packit eed199
Packit eed199
To install from Git, you will need automake, autoconf, and libtool installed
Packit eed199
in addition to make and a compiler.
Packit eed199
Packit eed199
Our public git repository is hosted on GitHub at
Packit eed199
https://github.com/maxmind/libmaxminddb
Packit eed199
Packit eed199
You can clone this repository and build it by running:
Packit eed199
Packit eed199
    $ git clone --recursive https://github.com/maxmind/libmaxminddb
Packit eed199
Packit eed199
After cloning, run `./bootstrap` from the `libmaxminddb` directory and then
Packit eed199
follow the instructions for installing from a tarball as described above.
Packit eed199
Packit eed199
## On Windows via Visual Studio 2013+
Packit eed199
Packit eed199
We provide a Visual Studio solution in `projects\VS12`. This can be used to
Packit eed199
build both the the library and the tests. Please see the `README.md` file in
Packit eed199
the same directory for more information.
Packit eed199
Packit eed199
## On Ubuntu via PPA
Packit eed199
Packit eed199
MaxMind provides a PPA for recent version of Ubuntu. To add the PPA to your
Packit eed199
APT sources, run:
Packit eed199
Packit eed199
    $ sudo add-apt-repository ppa:maxmind/ppa
Packit eed199
Packit eed199
Then install the packages by running:
Packit eed199
Packit eed199
    $ sudo aptitude update
Packit eed199
    $ sudo aptitude install libmaxminddb0 libmaxminddb-dev mmdb-bin
Packit eed199
Packit eed199
## On OS X via Homebrew
Packit eed199
Packit eed199
If you are on OS X and you have homebrew (see http://brew.sh/) you can install
Packit eed199
libmaxminddb via brew.
Packit eed199
Packit eed199
    $ brew install libmaxminddb
Packit eed199
Packit eed199
# Bug Reports
Packit eed199
Packit eed199
Please report bugs by filing an issue with our GitHub issue tracker at
Packit eed199
https://github.com/maxmind/libmaxminddb/issues
Packit eed199
Packit eed199
# Dev Tools
Packit eed199
Packit eed199
We have a few development tools under the `dev-bin` directory to make
Packit eed199
development easier. These are written in Perl or shell. They are:
Packit eed199
Packit eed199
* `regen-prototypes.pl` - This regenerates the prototypes in the header and
Packit eed199
  source files. This helps keep headers and code in sync.
Packit eed199
* `uncrustify-all.sh` - This runs `uncrustify` on all the code. It runs
Packit eed199
  `regen-prototypes.pl` first. Please run this before submitting patches.
Packit eed199
* `valgrind-all.pl` - This runs Valgrind on the tests and `mmdblookup` to
Packit eed199
  check for memory leaks.
Packit eed199
Packit eed199
# Creating a Release Tarball
Packit eed199
Packit eed199
Use `make safedist` to check the resulting tarball.
Packit eed199
Packit eed199
# Copyright and License
Packit eed199
Packit eed199
Licensed under the Apache License, Version 2.0 (the "License");
Packit eed199
you may not use this file except in compliance with the License.
Packit eed199
You may obtain a copy of the License at
Packit eed199
Packit eed199
    http://www.apache.org/licenses/LICENSE-2.0
Packit eed199
Packit eed199
Unless required by applicable law or agreed to in writing, software
Packit eed199
distributed under the License is distributed on an "AS IS" BASIS,
Packit eed199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit eed199
See the License for the specific language governing permissions and
Packit eed199
limitations under the License.