Commit 7aed4264 authored by Philipp Huebner's avatar Philipp Huebner

Merge tag 'upstream/1.0.2'

Upstream version 1.0.2
parents 078fc597 9487e1b8
# Version 1.0.2
* Improved rebar.config.script
* Use correct app name when searching for binary
# Version 1.0.1
* Prepare hex.pm release (Mickaël Rémond)
* Change license to Apache 2.0 to make it more widely usable (Mickaël Rémond)
This diff is collapsed.
Copyright 2002-2017 ProcessOne SARL
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
# epam
epam for ejabberd to help with PAM authentication support
epam helper for Erlang / Elixir PAM authentication support
/*
* epam, Copyright (C) 2002-2015 ProcessOne
* Copyright (C) 2002-2017 ProcessOne, SARL. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* http://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
......
This diff is collapsed.
......@@ -28,20 +28,14 @@ AC_ERLANG_NEED_ERLC
# AC_ERLANG_SUBST_ROOT_DIR
# AC_ERLANG_SUBST_LIB_DIR
AC_CHECK_LIB(pam, pam_start, [PAM_LIB=yes], [], [])
AC_CHECK_LIB(pthread, pthread_create, [PTHREAD_LIB=yes], [], [])
AC_CHECK_HEADER(security/pam_appl.h, [PAM_HEADER=yes], [], [])
AC_SEARCH_LIBS([pam_start], [pam], [], [
AC_MSG_ERROR([PAM library was not found])])
if test "x$PAM_LIB" = "x"; then
AC_MSG_ERROR([PAM library was not found])
fi
if test "x$PTHREAD_LIB" = "x"; then
AC_MSG_ERROR([pthread library was not found])
fi
AC_SEARCH_LIBS([pthread_create], [pthread], [], [
AC_MSG_ERROR([pthread library was not found])])
if test "x$PAM_HEADER" = "x"; then
AC_MSG_ERROR([PAM header file "security/pam_appl.h" was not found])
fi
AC_CHECK_HEADERS([security/pam_appl.h], [], [
AC_MSG_ERROR([PAM header file "security/pam_appl.h" was not found])])
AC_CONFIG_FILES([vars.config])
AC_OUTPUT
{erl_opts, [debug_info, {i, "include"}]}.
%%%----------------------------------------------------------------------
%%% File : rebar.config
%%% Author : Mickael Remond <mremond@process-one.net>
%%% Purpose : Rebar build script. Compliant with rebar and rebar3.
%%% Created : 15 Dec 2015 by Mickael Remond <mremond@process-one.net>
%%%
%%% Copyright (C) 2002-2017 ProcessOne, SARL. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% http://www.apache.org/licenses/LICENSE-2.0
%%%
%%% Unless required by applicable law or agreed to in writing, software
%%% distributed under the License is distributed on an "AS IS" BASIS,
%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%%% See the License for the specific language governing permissions and
%%% limitations under the License.
%%%
%%%----------------------------------------------------------------------
{port_env, [{"EXE_LDFLAGS", "$ERL_LDFLAGS -lpthread -lpam"}]}.
{erl_opts, [debug_info, {src_dirs, ["src"]}]}.
{port_env, [{"CFLAGS", "$CFLAGS"},
{"LDFLAGS", "$LDFLAGS"}]}.
% {port_env, [{"EXE_LDFLAGS", "$ERL_LDFLAGS -lpthread -lpam"}]}.
{port_specs, [{"priv/bin/epam", ["c_src/epam.c"]}]}.
{cover_enabled, true}.
{cover_export_enabled, true}.
{xref_checks, [undefined_function_calls, undefined_functions, deprecated_function_calls, deprecated_functions]}.
{profiles, [{test, [{erl_opts, [{src_dirs, ["src", "test"]}]}]}]}.
{plugins, []}.
%% Local Variables:
%% mode: erlang
%% End:
......
%%%----------------------------------------------------------------------
%%% File : rebar.config.script
%%% Author : Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%% Purpose : Rebar build script. Compliant with rebar and rebar3.
%%% Created : 8 May 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%%
%%% Copyright (C) 2002-2017 ProcessOne, SARL. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% http://www.apache.org/licenses/LICENSE-2.0
%%%
%%% Unless required by applicable law or agreed to in writing, software
%%% distributed under the License is distributed on an "AS IS" BASIS,
%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%%% See the License for the specific language governing permissions and
%%% limitations under the License.
%%%
%%%----------------------------------------------------------------------
Cfg = case file:consult(filename:join([filename:dirname(SCRIPT),"vars.config"])) of
{ok, Terms} ->
Terms;
_Err ->
[]
end ++ [{cflags, "-g -O2 -Wall"}, {ldflags, "-lpthread -lpam"}],
{cflags, CfgCFlags} = lists:keyfind(cflags, 1, Cfg),
{ldflags, CfgLDFlags} = lists:keyfind(ldflags, 1, Cfg),
IsRebar3 = case application:get_key(rebar, vsn) of
{ok, VSN} ->
[VSN1 | _] = string:tokens(VSN, "-"),
[Maj, Min, Patch] = string:tokens(VSN1, "."),
(list_to_integer(Maj) >= 3);
undefined ->
lists:keymember(mix, 1, application:loaded_applications())
end,
JobId = case os:getenv("TRAVIS_JOB_ID") of false -> ""; V -> V end,
ModCfg0 = fun(F, Cfg, [Key|Tail], Op, Default) ->
{OldVal,PartCfg} = case lists:keytake(Key, 1, Cfg) of
{value, {_, V1}, V2} -> {V1, V2};
false -> {if Tail == [] -> Default; true -> [] end, Cfg}
end,
case Tail of
[] ->
[{Key, Op(OldVal)} | PartCfg];
_ ->
[{Key, F(F, OldVal, Tail, Op, Default)} | PartCfg]
end
end,
ModCfg = fun(Cfg, Keys, Op, Default) -> ModCfg0(ModCfg0, Cfg, Keys, Op,
Default) end,
ModCfgS = fun(Cfg, Keys, Val) -> ModCfg0(ModCfg0, Cfg, Keys, fun(_V) ->
Val end, "") end,
FilterConfig = fun(F, Cfg, [{Path, true, ModFun, Default} | Tail]) ->
F(F, ModCfg0(ModCfg0, Cfg, Path, ModFun, Default), Tail);
(F, Cfg, [_ | Tail]) ->
F(F, Cfg, Tail);
(F, Cfg, []) ->
Cfg
end,
AppendStr = fun(Append) ->
fun("") ->
Append;
(Val) ->
Val ++ " " ++ Append
end
end,
AppendList = fun(Append) ->
fun(Val) ->
Val ++ Append
end
end,
Rebar3DepsFilter = fun(DepsList) ->
lists:map(fun({DepName,_, {git,_, {tag,Version}}}) ->
{DepName, Version};
(Dep) ->
Dep
end, DepsList)
end,
GlobalDepsFilter = fun(Deps) ->
DepNames = lists:map(fun({DepName, _, _}) -> DepName;
({DepName, _}) -> DepName
end, Deps),
lists:filtermap(fun(Dep) ->
case code:lib_dir(Dep) of
{error, _} ->
{true,"Unable to locate dep '"++atom_to_list(Dep)++"' in system deps."};
_ ->
false
end
end, DepNames)
end,
Rules = [
{[port_env, "CFLAGS"], true,
AppendStr(CfgCFlags), "$CFLAGS"},
{[port_env, "LDFLAGS"], true,
AppendStr(CfgLDFlags), "$LDFLAGS"},
{[deps], IsRebar3,
Rebar3DepsFilter, []},
{[plugins], IsRebar3,
AppendList([rebar3_hex, pc]), []},
{[provider_hooks], IsRebar3,
AppendList([{pre, [
{compile, {pc, compile}},
{clean, {pc, clean}}
]}]), []},
{[deps], os:getenv("TRAVIS") == "true",
AppendList([{coveralls, ".*", {git, "https://github.com/markusn/coveralls-erl.git", "master"}}]), []},
{[post_hooks], os:getenv("TRAVIS") == "true",
AppendList([{eunit, "echo '\n%%! -pa .eunit/ deps/coveralls/ebin\nmain(_)->{ok,F}=file:open(\"erlang.json\",[write]),io:fwrite(F,\"~s\",[coveralls:convert_file(\".eunit/cover.coverdata\", \""++JobId++"\", \"travis-ci\",\"\")]).' > getcover.erl"},
{eunit, "escript ./getcover.erl"}]), []},
{[deps], os:getenv("USE_GLOBAL_DEPS") /= false,
GlobalDepsFilter, []}
],
Config = FilterConfig(FilterConfig, CONFIG, Rules),
%io:format("Rules:~n~p~n~nCONFIG:~n~p~n~nConfig:~n~p~n", [Rules, CONFIG, Config]),
Config.
%% Local Variables:
%% mode: erlang
%% End:
%% vim: set filetype=erlang tabstop=8:
%%%----------------------------------------------------------------------
%%% File : esip.app.src
%%% Author : Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%% Purpose : Application package description
%%% Created : 4 Apr 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%%
%%%
%%% Copyright (C) 2002-2017 ProcessOne, SARL. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% http://www.apache.org/licenses/LICENSE-2.0
%%%
%%% Unless required by applicable law or agreed to in writing, software
%%% distributed under the License is distributed on an "AS IS" BASIS,
%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%%% See the License for the specific language governing permissions and
%%% limitations under the License.
%%%
%%%----------------------------------------------------------------------
{application, epam,
[{description, "epam helper for PAM authentication support"},
{vsn, "1.0.2"},
{modules, []},
{registered, []},
{applications, [kernel, stdlib]},
{env, []},
{mod, {epam_app,[]}},
%% hex.pm packaging:
{files, ["src/", "c_src/epam.c", "rebar.config", "rebar.config.script", "README.md", "LICENSE.txt"]},
{licenses, ["Apache 2.0"]},
{maintainers, ["ProcessOne"]},
{links, [{"Github", "https://github.com/processone/epam"}]}
]}.
%% Local Variables:
%% mode: erlang
%% End:
%% vim: set filetype=erlang tabstop=8:
......@@ -5,22 +5,19 @@
%%% Created : 5 Jul 2007 by Evgeniy Khramtsov <xram@jabber.ru>
%%%
%%%
%%% epam, Copyright (C) 2002-2015 ProcessOne
%%% Copyright (C) 2002-2017 ProcessOne, SARL. All Rights Reserved.
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
%%% published by the Free Software Foundation; either version 2 of the
%%% License, or (at your option) any later version.
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% This program is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%%% General Public License for more details.
%%% http://www.apache.org/licenses/LICENSE-2.0
%%%
%%% You should have received a copy of the GNU General Public License
%%% along with this program; if not, write to the Free Software
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
%%% 02111-1307 USA
%%% Unless required by applicable law or agreed to in writing, software
%%% distributed under the License is distributed on an "AS IS" BASIS,
%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%%% See the License for the specific language governing permissions and
%%% limitations under the License.
%%%
%%%-------------------------------------------------------------------
......@@ -142,7 +139,7 @@ code_change(_OldVsn, State, _Extra) -> {ok, State}.
get_bin_path() ->
case os:getenv("EJABBERD_BIN_PATH") of
false ->
case code:priv_dir(p1_pam) of
case code:priv_dir(epam) of
{error, _} ->
filename:join(["priv", "bin"]);
Path ->
......
......@@ -5,22 +5,19 @@
%%% Created : 4 Apr 2013 by Evgeniy Khramtsov <xram@jabber.ru>
%%%
%%%
%%% epam, Copyright (C) 2002-2015 ProcessOne
%%% Copyright (C) 2002-2017 ProcessOne, SARL. All Rights Reserved.
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
%%% published by the Free Software Foundation; either version 2 of the
%%% License, or (at your option) any later version.
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% This program is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%%% General Public License for more details.
%%% http://www.apache.org/licenses/LICENSE-2.0
%%%
%%% You should have received a copy of the GNU General Public License
%%% along with this program; if not, write to the Free Software
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
%%% 02111-1307 USA
%%% Unless required by applicable law or agreed to in writing, software
%%% distributed under the License is distributed on an "AS IS" BASIS,
%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%%% See the License for the specific language governing permissions and
%%% limitations under the License.
%%%
%%%-------------------------------------------------------------------
......
......@@ -5,22 +5,19 @@
%%% Created : 4 Apr 2013 by Evgeniy Khramtsov <xram@jabber.ru>
%%%
%%%
%%% epam, Copyright (C) 2002-2015 ProcessOne
%%% Copyright (C) 2002-2017 ProcessOne, SARL. All Rights Reserved.
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
%%% published by the Free Software Foundation; either version 2 of the
%%% License, or (at your option) any later version.
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% This program is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%%% General Public License for more details.
%%% http://www.apache.org/licenses/LICENSE-2.0
%%%
%%% You should have received a copy of the GNU General Public License
%%% along with this program; if not, write to the Free Software
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
%%% 02111-1307 USA
%%% Unless required by applicable law or agreed to in writing, software
%%% distributed under the License is distributed on an "AS IS" BASIS,
%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%%% See the License for the specific language governing permissions and
%%% limitations under the License.
%%%
%%%-------------------------------------------------------------------
......
%%%-------------------------------------------------------------------
%%% @author Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%% @copyright (C) 2013, Evgeniy Khramtsov
%%% @doc
%%%
%%% @end
%%% Created : 4 Apr 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%%-------------------------------------------------------------------
{application, p1_pam,
[{description, "PAM wrapper"},
{vsn, "1.0.0"},
{modules, []},
{registered, []},
{applications, [kernel, stdlib]},
{mod, {epam_app,[]}}]}.
%% Local Variables:
%% mode: erlang
%% End:
%% vim: set filetype=erlang tabstop=8:
{cflags, "@CFLAGS@"}.
{ldflags, "@LDFLAGS@ @LIBS@"}.
%% Local Variables:
%% mode: erlang
%% End:
%% vim: set filetype=erlang tabstop=8:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment