• Stars
    star
    172
  • Rank 214,362 (Top 5 %)
  • Language
    Erlang
  • License
    Other
  • Created over 13 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Erlang package manager (A Giant Nebula of Erlang Repositories)

Agner

Agner is a rebar-friendly Erlang package index inspired by Clojars and Homebrew.

Essentially, Agner is an index of Erlang packages with some extra capabilities such as versioning, downloads, installation and so on.

Agner is a shorthand for A Giant Nebula of Erlang Repositories. It also pays homage to the Danish statistician Agner Krarup Erlang.

Installation

It is just a matter of a simple oneliner to get Agner installed:

 curl https://raw.github.com/agner/agner/master/scripts/oneliner | sh

If you want to install latest release instead of HEAD, use this one:

 curl https://raw.github.com/agner/agner/master/scripts/oneliner.release | sh

Motivation

By now, there is a large set of Erlang tools and libraries available, all of them highly useful. The problem, however, is to provide an index of these packages, so other people

  • Know of their existence
  • Can easily use a package in their own projects
  • Can search for a particular package

Agner aims to provide such an index, by focusing on a number of points:

  • The index is loose in the sense that anyone can overlay the index and add their own packages to the repository
  • The tool is as simple as possible, utilizing git as a backend (for the time being) to maintain the indices
  • Recognize the ideas of simplicity Joe Armstrong had in mind on the erlang-questions@ mailing list on the 22th of July 2010

Use

This section introduces the terminology of Agner:

  • index/indices: Where Agner finds its index of available of available packages. Usually this is a github user with one or more Agner-packages among the users git repositories. You can enable multiple indices at the same time if you want.
  • package: A separate library or program indentified by the index. It is an .agner repository underneath the index github user, so one example would be agner/gproc.agner specifying a package for the gproc library undernath the agner-user. A package may be overridden by an index; a very important feature that allows installing packages not hosted in a central index.
  • project: A software project, program or library, containing the actual source code for the program or library. In the running example, this is esl/gproc on github.
  • release: A release of a package signifying a point in time where the package was deemed to be in a certain (stable) state. Is usually used when a new version of the software is released to the general public so you can refer to package X version Y
  • flavour: A moving target of a package with some specified behaviour. It is used for tracking the development of a package over time. Common flavours include the @master flavour, used to track the development branch of a package and the @release flavour, used to track the latest release of the package.

Command invocation

agner help [COMMAND]

Print a command overview on the command line. If the optional COMMAND is given, show help for the given command.

Listing, searching:

agner list [-d/--descriptions] [-p/--properties PROPERTY1[,PROPERTY2]...]
           [-s/--search SEARCH_TERM]

Will list all Agner packages. It is used for quick overviews of the packages that are available in the enabled indices for installation or use in a program. This command, like most commands, accepts command line flags:

  • -d or --descriptions: With this option enabled, Agner will also print out the descriptions of the packages, for easy grepping to find relevant packages. It accepts the following flags:

  • -p or --properties: A comma, separated list of properties to be included in the listing (when present).

  • -s or --search: The packages name, description and keyword are searched, matched against SEARCH_TERM. Only matching items are shown.

Since searching for packages is so common, a convenience command has been defined:

agner search SEARCH_TERM [-d/--description] [-p/--properties PROPERTY1,PROPERTY2]

This is an alias for agner list -s

Printing package specifications (spec's)

agner spec PACKAGE [-v/--version VERSION] [-b/--browser]
                   [-h/--homepage] [-p/--property PROPERTY]
                   [-s/--spec-file SPECFILE]

Will print a specification of a given package on stdout. The specification is the information Agner uses to determine the location of the package as well as the relevant meta-data for the package. Flags:

  • -v or --version: If this version constraint option is given, Agner will print out the specification for that given VERSION (for example agner spec gproc -v @release). The version can be either a release or a flavour. By default, the @master flavour is chosen.

  • -b or --browser: Open a browser with the specification file in its respective .agner repository at github.

  • -h or --homepage: Open a browser with the package's homepage.

  • -p or --property: Agner will only render a particular PROPERTY value instead of a full specification (example: agner spec -p rebar_compatible yaws).

  • -s or --spec-file: A flag primarily intended for package maintainers. This way they can specify their local agner.config files to test their package.

Fetching, building and installing

agner fetch PACKAGE [DESTDIR] [-v/--version VERSION] [-b/--build]
                              [-a/--add-path] [-i/--install]
                              [-s/--spec-file SPECFILE] [--package-path PACKAGEPATH]
                              [-q/--quiet]

Fetch a given PACKAGE to either the current directory or, optionally, to the DESTDIR directory. Flags:

  • -v or --version: The version constraint is as is the case for agner spec. You can choose to constrain a fetch to a given VERSION, either a relase or a flavour.

  • -b or --build: Agner will try to build fetched package. Only rebar-compatible packages or packages with build_command can be built. If you also specify -a (or --add-path) Agner will add path to a newly built package to your $HOME/.erlang

  • -i or --install: If the package has the install_command property defined, Agner will also install this package. Please note that in most cases you should also specify -b (or --build) in order for installation to make sense.

  • -s or --spec-file: A flag primarily intended for package maintainers. This way they can specify their local agner.config files to test their package. Can be used in conjunction with --package-path to point to a checkout copy of an .agner repo (will be used to set $AGNER_PACKAGE_REPO variable for shell commands, defaults to .)

  • -q or --quiet: A flag that will suppress output of build_command & install_command (if present)

For convenience, the following shortcuts are defined:

agner build PACKAGE [DESTDIR] [-v/--version VERSION] [-s/--spec-file SPECFILE] [-a/--add-path] [-i/--install] [--no-fetch]

Alias for agner fetch --build PACKAGE.

agner install PACKAGE [-v/--version VERSION] [-s/--spec-file SPECFILE] [--no-fetch]

Alias for agner fetch --build --install PACKAGE /tmp/<uniq_filename>. A typical example would be agner install rebar or agner install rebar -v @agner to get rebar binary in your PATH. It is assumed that install_command property will make use of AGNER_INSTALL_PREFIX OS environment variable.

--no-fetch option could be useful when you don't want to update already fetched repository, but just build or install it.

Uninstalling

agner uninstall PACKAGE [-v/--version VERSION] [-s/--spec-file SPECFILE]

Uninstall given package (and a particular VERSION of it, if specified

  • see agner spec). Will use local SPECFILE if the -s (or --spec-file) option is passed.

Query

agner versions PACKAGE [--no-flavours] [--no-releases]

List the versions of the given PACKAGE. Specifying --no-flavours will omit flavour versions; and specifying --no-releases will omit release versions respectively.

agner prefix PACKAGE [-v/--version VERSION]

Prints prefix where PACKAGE is installed. If package is not installed, prints nothing.

agner config [VARIABLE]

Shows main environmental variables. If VARIABLE is omitted, then lists key=value for each variable. If not omitted, prints just its value. Currently supported variables are: prefix and bin.

Packaging

agner create PACKAGE [--github-account ACCOUNT]

Contributor's tool that clones .agner repo template and sets its origin to ACCOUNT (by default, equals agner, so if you don't have a permission to create repos in agner, set --github-account to your personal or organization account.

agner verify [SPECFILE]

Verify SPECFILE as a specification file for correctness; intended to be used to package maintainers to simplify their workflow. If SPECFILE is not given, it defaults to agner.config. Currently checks whether

  1. specification is a valid file that can be parsed, 2) the URL can be fetched. In the future it will also offer a deeper analysis of specification correctness.

Packaging

Package organization

When Agner is invoked, it will scan its indices for package lists. The default index is "agner", which is located at https://github.com/agner/. The index is scanned by looking for Agner repositories which are normal (github) repositories suffixed with .agner. An example is the repository https://github.com/agner/getopt.agner which contains the package details of the getopt package.

It is important to nail down that there are three balls in the air:

  • The index user, who has a list of
  • .agner repositories, which points to
  • Erlang software projects

By making a split between the repository containing the project and the repository containing the package, we make it easy to identify .agner repositories, and we enable a simple way to make the project live in another source control system, for instance Mercurial (hg). It is also way easier to keep the (small) .agner repositories in an index and in the long run, it provisions for local caching.

Further indices can be added to Agner through the environment (TODO: flesh out how that is done). Indices are searched in the order of specification, allowing for overriding of a given index. This allows you to create local indices or special indices for your own use, or try something out on top of other indices.

The multiple indices approach solves authorization questions "the git way": you put trust in the indices you add to Agner, so if you don't trust an index, you can simply refrain from adding it. The main "agner" index is intended to be the official source, but we recognize that individuals might have reasons to overlay another index on top. By having a loose index-construction, we hope to alleviate some of the problems with access rights.

Package names

Packages are named in one of two ways. Either as the a direct name, mochiweb, or as a form with a prefix of the package index, account/package. For example yrashk/misultin). We use package names to identify a given package in Agner - but versions of the package is naturally not part of its name. This allows for packages to exist in multiple versions at the same time.

Versions

Agner has two kinds of versions:

  • Release versions, normally something like 1.2.0, represented using tags in .agner repos.
  • Flavour versions, normally something like @release, represented using branches in .agner repos. Note the prefix of "@" which is present on flavours only.

The intention is that a release version marks a given point in time where a given version of the code base was released to the general public. When Erlang/OTP is released as OTP-R14B01 for instance, it signifies a release in Agner-terminology. On the other hand, a flavour signifies a moving target. Continuing the OTP-R14B01 example from before, it would be natural to have a @dev flavour which tracks the Erlang/OTP branch called dev. The other important flavour is @release which will track the latest release.

Also, the command line utility and Agner-enabled rebar will recognize atleast:VERSION format (for example, atleast:1.5.0) and will use the latest version after VERSION (so, if some package already has a version of 1.6, atleast:1.5.0 will select 1.6. This is mostly for scenarios when @release flavour is absent or broken.

How to create relases and flavours

As hinted, a release version is a tag in a .agner repository. So to create a release, you alter the .agner repository to match your liking and then you tag it (with a standard git tag command invocation). Agner will now pick up the change.

Likewise, for a flavour version, you branch the .agner repository and alter the branch so it does what your flavour intended to do. Flavours can be made for anything you would like to track over time. By default, the advice is to create two flavours, @master and @release. These tracks, respectively, the current development of a project and the latest stable release of that project.

Keeping everything up-to-date is outsourced to git and you can use usual git-commands to manipulate the .agner repository.

The contents of an .agner package

The .agner package repository contains a file of Erlang-terms, called agner.config. This file looks like this:

{name, "etorrent"}.
{authors, ["Jesper Louis Andersen <[email protected]>"]}.
{description, "Etorrent is a bittorrent client implementation in Erlang focusing on fault-tolerance"}.
{homepage, "http://github.com/jlouis/etorrent"}.
{rebar_compatible, true}.
{license, "BSD2", "COPYING"}.
{erlang_versions, [otp_r14b, otp_r14b01, otp_r13b04]}.
{url, {git, "https://github.com/jlouis/etorrent.git", {branch, "master"}}}.

Or in a more generic way:

{name, ProjectName}.
{authors, [Author]}.
{description, ProjectDescription}.
{homepage, ProjectHomepage}.
{rebar_compatible, IsRebarCompatible}.
{license, LicenseType [, LicenseFile]}.
{erlang_versions, [OTPAtom]}.
{url, UrlSpec}.

The meaning of the individual fields are as in the following:

  • ProjectName :: string() - is the project name. This is usually named the same as the .agner package to minimize confusion.

  • [Author] :: [string()] - Can really be any string, but it is usually the names of the project authors in a list including their email-addresses for easy contact.

  • ProjectDescription :: string() - A description of the project. Used for searching through projects.

  • ProjectHomepage :: string() - The URL of the homepage of the project.

  • IsRebarCompatible :: boolean() - Set to true if this project uses rebar or is compilable by rebar even if it wasn't originally designed for that.

  • LicenseType :: string(), LicenseFile :: string() - Two strings. The first one specifies the general license type of the project and the second string explains where the license is to be found from the top level directory (usually file-names like COPYING or LICENSE are used for this). Please note that LicenseFile is optional.

  • [OTPAtom] :: [otp_rXXb | otp_rXXbYY] - A list of what OTP versions the project can be used with. the XX is a major release number in Erlang/OTP (12,13,14,...) and YY is a minor release number (01, 02, ...).

  • UrlSpec :: {git, URL, GitSpec} - Specifies where to fetch the project. GitSpec has type sha1() | {tag, string()} | {branch, string()} and points to either string-based sha1 representation, a git tag or a git branch respectively. Notice that you can't specify more than one target in this file. To handle multiple versions, you use releases and flavours by altering the .agner repository wherein this configuration file lies.

  • UrlSpec :: {hg, URL, HgRev} - Specifies where to fetch the project. HgSpec has type string() and points to either string-based revision representation

The very latest specification typespecs are available in agner_spec.hrl

It is highly recommended that .agner repo maintainers use agner verify command before committing and pushing their updated specifications.

Rebar

Agner-compatible rebar can be installed by agner install rebar.

Using it with rebar is fairly simple, it makes use of rebar's plugin system. Just include our plugin in your rebar.config and reference default deps directory:

{plugins, [agner_rebar_plugin]}.
{lib_dirs, ["deps"]}.

then, in your .app or .app.src file, add something like this as one of your application keys:

 ...
 {agner, [
       {requires, ["typespecs","getopt","gproc","plists","gen_fsm2","jsx","rebar"]}
      ]}
 ...

An example can be found in agner itself

Also, you can also specify your own indices in rebar.config

{agner_indices, [{github, "yourgithubusername"},{github,"agner"}].

Contributing

If you want to contrinute to Agner, please read the document at CONTRIBUTING.

More Repositories

1

jiffy.agner

JSON NIFs for Erlang
3
star
2

proper.agner

PropEr: a QuickCheck-inspired property-based testing tool for Erlang
Shell
3
star
3

gen_smtp.agner

A generic SMTP server and client in Erlang that can be extended via callback modules
3
star
4

lhttpc.agner

lhttpc is a lightweight HTTP/1.1 client implemented in Erlang
2
star
5

elixir.agner

Elixir is a functional meta-programming aware language built on top of the Erlang VM. It is a dynamic language with flexible syntax with macros support that leverages Erlang's abilities to build concurrent, distributed, fault-tolerant applications with hot code upgrades
2
star
6

markdown.agner

An implementation of markdown written in Erlang
Shell
1
star
7

erlsha2.agner

SHA-224, SHA-256, SHA-384, SHA-512 implemented in Erlang NIFs
1
star
8

estring.agner

string manipulation library for erlang
1
star
9

procket.agner

Erlang interface to low level socket operations
1
star
10

erlcloud.agner

Cloud Computing library for erlang (Amazon EC2, S3, SQS, SimpleDB, Mechanical Turk)
1
star
11

riak_core.agner

Distributed systems infrastructure used by Riak
1
star
12

cecho.agner

An ncurses library for Erlang
1
star
13

mochijson.agner

The json encoding modules from mochiweb
Shell
1
star
14

eamf.agner

eAMF provides Action Message Format (AMF) support for Erlang
Shell
1
star
15

lager.agner

Logging Framework for Erlang/OTP
1
star
16

trie.agner

Erlang Trie Implementation
1
star
17

agner.github.com

JavaScript
1
star
18

eredis.agner

Wooga redis client package
1
star
19

protobuffs.agner

An implementation of Google's Protocol Buffers for Erlang
1
star
20

bcrypt.agner

Erlang wrapper for OpenBSD's Blowfish password hashing code
Shell
1
star
21

efps.agner

Erlang/OTP Flash Policy Server
1
star
22

meck.agner

A mocking library for Erlang
1
star
23

detergent.agner

1
star
24

erlbrake.agner

Erlbrake agner package
1
star
25

socketio.agner

Socket.IO server in Erlang
1
star
26

seresye.agner

1
star
27

ex_cssmin.agner

CSS Minifier for Erlang
Shell
1
star
28

riak_pipe.agner

Riak Pipelines
1
star
29

epubnub.agner

Erlang bindings for PubNub.com service
1
star
30

lfe.agner

Lisp Flavoured Erlang (LFE)
Shell
1
star
31

ossp_uuid.agner

NIF-based ossp-uuid binding
1
star
32

epgsql.agner

Erlang PostgreSQL client library
1
star
33

encurses.agner

A NIF-based ncurses library for Erlang
1
star
34

folsom.agner

Expose Erlang Events and Metrics
1
star
35

erlando.agner

Cuts and monads for Erlang
1
star
36

fresh.agner

1
star
37

beamjs.agner

Erlang-based JavaScript platform
1
star
38

agner.agner

A Giant Nebula of Erlang Repositories
Shell
1
star
39

erlcron.agner

Erlang cronish system
Shell
1
star
40

bitcask.agner

because you need another a key/value storage engine
1
star
41

ex_php.agner

A simple PHP serialization library
Shell
1
star
42

couchbeam.agner

Erlang Couchdb kit
1
star
43

epitest.agner

Erlang Parallel Integration Testing toolkit
1
star
44

getopt.agner

Erlang module to parse command line arguments using the GNU getopt syntax
1
star
45

pcache.agner

An Erlang cache where every stored item is its own process.
Shell
1
star
46

riak_search.agner

Full-text search engine based on Riak
1
star
47

conc.agner

Concurrent Lists in Erlang
Shell
1
star
48

sqlite3.agner

Sqlite gen_server port for Erlang. Creates, reads and writes to sqlite database.
Shell
1
star
49

ewgi.agner

Erlang web gateway interface: a standard interface between Erlang web servers and applications
Shell
1
star
50

cbuf.agner

Erlang Circular Buffer/List/LIFO Queue using ETS
Shell
1
star
51

exmpp.agner

Erlang XMPP library
Shell
1
star
52

ezmq.agner.limbo

NIF-based zeromq binding for Erlang
1
star
53

eper.agner

Erlang performance and debugging tools
Shell
1
star
54

sendfile.agner

Erlang sendfile() linked-in driver
Shell
1
star
55

typespecs.agner

Common Erlang Type Specifications
1
star
56

scalaris.agner

Scalaris is a scalable, transactional, distributed key-value store
1
star
57

rabbitmq_client.agner

RabbitMQ Erlang AMQP client
1
star
58

convey.agner.limbo

a high performance, highly concurrent tcp server implementation
1
star
59

nicedecimal.agner

nicedecimal package
1
star
60

dnssd.agner

Erlang interface to Apple's Bonjour DNS Service Discovery implementation
Shell
1
star
61

serial.agner

Erlang serial-port support
1
star
62

erlastic_search.agner

An Erlang app for communicating with Elastic Search's rest interface.
1
star
63

ktuo.agner

json encoder/decoder for Erlang
Shell
1
star
64

erlzmq.agner

Erlang bindings for ZeroMQ messaging
Shell
1
star
65

poolboy.agner

A hunky Erlang worker pool factory
Shell
1
star
66

riak_kv.agner

Riak Key/Value Store
1
star
67

syslog.agner

Erlang port driver for interacting with syslog via syslog(3)
Shell
1
star
68

itweet.agner

Twitter Stream API on ibrowse
Shell
1
star
69

zippers.agner

Zippers is a library containing basic zipper functional data structures
1
star
70

sgte.agner

A simple Erlang Template Engine
Shell
1
star
71

etorrent.agner

Etorrent is a bittorrent client implementation in Erlang focusing on fault-tolerance
1
star
72

erlang_js.agner

A linked-in driver for Erlang to Mozilla's Spidermonkey Javascript runtime
1
star
73

ex_uri.agner

An URI-handling library application for Erlang
1
star
74

erlson.agner

Erlson package
1
star
75

abnfc.agner

An ABNF parser generator for Erlang
1
star
76

jsonerl.agner

yet another but slightly different erlang <-> json encoder/decoder
Shell
1
star
77

erlmongo.agner

Record based Erlang driver for MongoDB with gridfs support
1
star
78

ddb.agner

Amazon DynamoDB API for Erlang
1
star
79

gtknode.agner

Erlang GTK binding
Shell
1
star
80

amf.agner

Erlang Action Message Format Library (erlang-amf)
1
star
81

neotoma.agner

Erlang library and packrat parser-generator for parsing expression grammars
1
star
82

webmachine.agner

A REST-based system for building web applications.
1
star
83

gen_nb_server.agner

OTP behavior for writing non-blocking servers
1
star
84

riak_zab.agner

Pure Erlang implementation of Zab, the Zookeeper Atomic Broadcast protocol
1
star
85

chicagoboss.agner

Rails-like web MVC, now featuring Comet
1
star
86

riak_err.agner

Enhanced SASL Error Logger for Riak
1
star
87

dynamic_compile.agner

compile and load erlang modules from string input
Shell
1
star
88

cowboy.agner

Small, fast, modular HTTP server
1
star
89

jobs.agner

Job scheduler for load regulation
1
star
90

gen_event_forwarder.agner

gen_event forwarder
1
star
91

riak_sysmon.agner

Simple OTP app for managing Erlang VM system_monitor event messages
1
star
92

gproc.agner

Extended process registry for Erlang
1
star
93

statebox.agner

Erlang state "monad" with merge/conflict-resolution capabilities. Useful for Riak.
1
star
94

mysql.agner

Erlang MySQL Driver
1
star
95

iconv.agner

iconv driver for erlang
1
star
96

plists.agner

An Erlang module for doing list operations in parallel
1
star
97

edown.agner

EDoc extension for generating Github-flavored Markdown
Shell
1
star
98

agner_ndxsrv

INFRA: A hosted server to allow users publish at the index frictionlessly
1
star
99

plain_fsm.agner

A behaviour/support library for writing plain Erlang FSMs
1
star
100

reloader.agner

Erlang module for automatically reloading modified modules during development
Shell
1
star