Skip to content

Commit

Permalink
autotools and erlmongo.spec for rpm thanks to sipXecs
Browse files Browse the repository at this point in the history
  • Loading branch information
SergejJurecko committed Jan 30, 2011
1 parent 072766e commit c055556
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Makefile

This file was deleted.

33 changes: 33 additions & 0 deletions Makefile.am
@@ -0,0 +1,33 @@
EXTRA_DIST = \
erlmongo.spec \
README.rdoc \
LICENSE.txt \
$(source_files) \
ebin/erlmongo.app

erlmongohdrdir = $(ERLANG_INSTALL_LIB_DIR_erlmongo)/include
dist_erlmongohdr_DATA = \
src/erlmongo.hrl

erlmongobindir = $(ERLANG_INSTALL_LIB_DIR_erlmongo)/ebin

source_files = \
src/erlmongo_app.erl \
src/mongoapi.erl \
src/mongodb.erl \
src/mongodb_supervisor.erl

beam_files = $(foreach B,$(notdir $(source_files:.erl=.beam)),ebin/$(B))

erlmongobin_DATA = \
$(beam_files) \
ebin/erlmongo.app

CLEANFILES = $(beam_files)

all: $(beam_files);

ebin/%.beam : src/%.erl
test -d ebin || mkdir ebin
$(ERLC) $(ERLC_FLAGS) -o ebin $<

8 changes: 8 additions & 0 deletions README.rdoc
Expand Up @@ -163,6 +163,14 @@ GridFS
* gfsFlush * gfsFlush
* gfsClose * gfsClose


== Building
erl -make

or with autotools
./configure
make
make install

== Author == Author
Sergej Jurečko Sergej Jurečko


12 changes: 12 additions & 0 deletions configure.ac
@@ -0,0 +1,12 @@
AC_PREREQ(2.57)
AC_INIT(erlmongo, 0.0.9, sergej.jurecko@wpn.tv)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR([src/erlmongo.hrl])
AM_INIT_AUTOMAKE(foreign tar-ustar)
AC_ERLANG_PATH_ERL
AC_ERLANG_PATH_ERLC
AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT
56 changes: 56 additions & 0 deletions erlmongo.spec
@@ -0,0 +1,56 @@
Name: erlmongo
Version: 0.0.9
Release: 1%{?dist}
Summary: Erlang driver for mongodb.

Group: Database/Driver
License: APL
URL: https://github.com/wpntv/erlmongo
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: erlang
Requires: erlang

%define erlmongolibdir %{_libdir}/erlang/lib/%{name}-%{version}

%description
Erlmongo is a pretty complete Erlang driver for mongodb.

It supports records and proplists as datatypes. Strings can be lists or binaries, but strings received from mongodb (as a result of find) will be binaries.

Because of the way records work in Erlang, you need to call mongoapi:recinfo/2 before using any record, or define each record in erlmongo.hrl.


%prep
%setup -q


%build
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc

%{erlmongolibdir}/ebin/erlmongo.app
%{erlmongolibdir}/ebin/erlmongo_app.beam
%{erlmongolibdir}/ebin/mongodb.beam
%{erlmongolibdir}/ebin/mongodb_supervisor.beam
%{erlmongolibdir}/ebin/mongoapi.beam
%{erlmongolibdir}/include/erlmongo.hrl

%changelog
* Thu Jan 27 2011 Douglas Hubler <douglas@hubler.us>
- Initial release

0 comments on commit c055556

Please sign in to comment.