# HG changeset patch # User Michael Schloh von Bennewitz # Date 1372780725 -7200 # Node ID 0a61f30eebd416e3b926c5c8a71aaa5938f6ac8f # Parent 8a3648cce554f9e53f797c8c95e474d53cfe74e8 Import package vendor original specs for necessary manipulations. diff -r 8a3648cce554 -r 0a61f30eebd4 erlang/erlang.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/erlang/erlang.patch Tue Jul 02 17:58:45 2013 +0200 @@ -0,0 +1,174 @@ +Index: erts/emulator/Makefile.in +--- erts/emulator/Makefile.in.orig 2010-12-07 16:07:22.000000000 +0100 ++++ erts/emulator/Makefile.in 2010-12-09 17:06:47.000000000 +0100 +@@ -617,7 +617,7 @@ + + + $(OBJDIR)/%.o: beam/%.c +- $(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@ ++ $(CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@ + + $(OBJDIR)/%.o: $(TARGET)/%.c + $(CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@ +Index: erts/emulator/hipe/hipe_x86.c +--- erts/emulator/hipe/hipe_x86.c.orig 2010-12-07 16:07:22.000000000 +0100 ++++ erts/emulator/hipe/hipe_x86.c 2010-12-09 17:23:16.000000000 +0100 +@@ -130,7 +130,7 @@ + abort(); + map_start = mmap(map_hint, map_bytes, + PROT_EXEC|PROT_READ|PROT_WRITE, +- MAP_PRIVATE|MAP_ANONYMOUS ++ MAP_PRIVATE|MAP_ANON + #ifdef __x86_64__ + |MAP_32BIT + #endif +Index: lib/erl_interface/src/connect/ei_resolve.c +--- lib/erl_interface/src/connect/ei_resolve.c.orig 2010-12-07 16:07:22.000000000 +0100 ++++ lib/erl_interface/src/connect/ei_resolve.c 2010-12-09 17:23:16.000000000 +0100 +@@ -54,6 +54,10 @@ + #include "ei_resolve.h" + #include "ei_locking.h" + ++#if defined(HAVE_GETHOSTBYNAME_R) && defined(__FreeBSD__) ++#undef HAVE_GETHOSTBYNAME_R ++#endif ++ + #ifdef HAVE_GETHOSTBYNAME_R + + void ei_init_resolve(void) +Index: lib/gs/src/tool_utils.erl +--- lib/gs/src/tool_utils.erl.orig 2010-12-07 16:07:22.000000000 +0100 ++++ lib/gs/src/tool_utils.erl 2010-12-09 17:23:16.000000000 +0100 +@@ -40,6 +40,9 @@ + }). + + ++%% Browser executable list (openURL command line protocol required) ++-define(BROWSERS, ["netscape", "mozilla", "MozillaFirebird", "opera", "firefox", "seamonkey"]). ++ + %%---------------------------------------------------------------------- + %% open_help(Parent, File) + %% Parent = gsobj() (GS root object or parent window) +@@ -80,7 +83,7 @@ + {unix,Type} -> + case Type of + darwin -> "open " ++ File; +- _Else -> "netscape -remote \"openURL(file:" ++ File ++ ")\"" ++ _Else -> unix_url_command("file:" ++ File) + end; + {win32,_AnyType} -> + "start " ++ filename:nativename(File); +@@ -95,7 +98,7 @@ + {unix,Type} -> + case Type of + darwin -> "open " ++ File; +- _Else -> "netscape -remote \"openURL(file:" ++ File ++ ")\"" ++ _Else -> unix_url_command("file:" ++ File) + end; + {win32,_AnyType} -> + "netscape.exe -h " ++ regexp:gsub(File,"\\\\","/"); +@@ -429,3 +432,53 @@ + [Last]; + insert_newlines(Other) -> + Other. ++ ++%% find_browser(BrowserList) => string() | false ++%% BrowserList - [string()] ++%% Given a list of basenames, find the first available executable. ++ ++find_browser([]) -> ++ false; ++ ++find_browser([H | T]) -> ++ case os:find_executable(H) of ++ false -> ++ find_browser(T); ++ Browser -> ++ Browser ++ end. ++ ++%% unix_url_command(URL) => string() ++%% URL - string() ++%% Open an URL, using a browser which supports the openURL command ++%% line protocol. If no browser is found, the empty string will be ++%% returned. ++ ++unix_url_command(URL) -> ++ Template = "BROWSER -remote \"openURL(" ++ URL ++ ")\" || BROWSER " ++ URL ++ "&", ++ ++ case os:getenv("BROWSER") of ++ false -> ++ %% look for a compatible browser ++ case find_browser(?BROWSERS) of ++ false -> ++ ""; ++ Browser -> ++ case regexp:gsub(Template, "BROWSER", Browser) of ++ {ok, Command, 0} -> ++ %% Template does not contain "BROWSER" placeholder ++ ""; ++ {ok, Command, _} -> ++ Command ++ end ++ end; ++ ++ Value -> ++ case regexp:gsub(Template, "BROWSER", Value) of ++ {ok, Command2, 0} -> ++ %% no placeholder ++ ""; ++ {ok, Command2, _} -> ++ Command2 ++ end ++ end. +Index: lib/hipe/regalloc/Makefile +--- lib/hipe/regalloc/Makefile.orig 2010-12-07 16:07:22.000000000 +0100 ++++ lib/hipe/regalloc/Makefile 2010-12-09 17:23:16.000000000 +0100 +@@ -46,7 +46,6 @@ + hipe_node_sets hipe_spillcost hipe_reg_worklists \ + hipe_adj_list \ + hipe_temp_map \ +- hipe_optimistic_regalloc \ + hipe_coalescing_regalloc \ + hipe_graph_coloring_regalloc \ + hipe_regalloc_loop \ +Index: lib/stdlib/src/calendar.erl +--- lib/stdlib/src/calendar.erl.orig 2010-12-07 16:07:22.000000000 +0100 ++++ lib/stdlib/src/calendar.erl 2010-12-09 17:23:16.000000000 +0100 +@@ -216,11 +216,19 @@ + + -spec local_time_to_universal_time_dst(t_datetime1970()) -> [t_datetime1970()]. + local_time_to_universal_time_dst(DateTime) -> +- UtDst = erlang:localtime_to_universaltime(DateTime, true), +- Ut = erlang:localtime_to_universaltime(DateTime, false), + %% Reverse check the universal times +- LtDst = erlang:universaltime_to_localtime(UtDst), +- Lt = erlang:universaltime_to_localtime(Ut), ++ {UtDst, LtDst} = ++ try ++ UtDst0 = erlang:localtime_to_universaltime(DateTime, true), ++ {UtDst0, erlang:universaltime_to_localtime(UtDst0)} ++ catch error:badarg -> {error, error} ++ end, ++ {Ut, Lt} = ++ try ++ Ut0 = erlang:localtime_to_universaltime(DateTime, false), ++ {Ut0, erlang:universaltime_to_localtime(Ut0)} ++ catch error:badarg -> {error, error} ++ end, + %% Return the valid universal times + case {LtDst,Lt} of + {DateTime,DateTime} when UtDst =/= Ut -> +Index: lib/tools/emacs/test.erl +Index: lib/wx/configure +--- lib/wx/configure.orig 2010-12-07 16:07:22.000000000 +0100 ++++ lib/wx/configure 2010-12-09 17:23:16.000000000 +0100 +@@ -3910,7 +3910,7 @@ + ;; + *) + DEBUG_CFLAGS="-g -Wall -fPIC -DDEBUG $CFLAGS" +- CFLAGS="-g -Wall -O2 -fPIC -fomit-frame-pointer -fno-strict-aliasing $CFLAGS" ++ CFLAGS="-Wall -fPIC -fomit-frame-pointer -fno-strict-aliasing $CFLAGS %%CFLAGS%%" + ;; + esac + diff -r 8a3648cce554 -r 0a61f30eebd4 erlang/erlang.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/erlang/erlang.spec Tue Jul 02 17:58:45 2013 +0200 @@ -0,0 +1,103 @@ +## +## erlang.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2012 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package version +%define V_opkg R15B03.1 +%define V_real R15B03-1 +%define V_subdir R15B03 + +# package information +Name: erlang +Summary: Erlang Programming Language +URL: http://www.erlang.org/ +Vendor: Ericsson Computer Science Laboratory +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: EVAL +Group: Language +License: Erlang Public License +Version: %{V_opkg} +Release: 20121208 + +# list of sources +Source0: http://www.erlang.org/download/otp_src_%{V_real}.tar.gz +Source1: http://www.erlang.org/download/otp_doc_man_%{V_real}.tar.gz +Patch0: erlang.patch + +# build information +BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, m4 +PreReq: OpenPKG, openpkg >= 20100101 +BuildPreReq: openssl +PreReq: openssl + +%description + Erlang is a general-purpose programming language and runtime + environment. Erlang has built-in support for concurrency, + distribution and fault tolerance. Erlang is used in several large + telecommunication systems from Ericsson. + +%track + prog erlang = { + version = %{V_real} + url = http://www.erlang.org/download/ + regex = otp_src_(__VER__)\.tar\.gz + } + +%prep + %setup -q -n otp_src_%{V_subdir} + %patch -p0 + +%build + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + JAVAC="false" \ + ./configure \ + --prefix=%{l_prefix} \ + --with-ssl=%{l_prefix} + %{l_make} %{l_mflags} + +%install + %{l_make} %{l_mflags} install INSTALL_PREFIX=$RPM_BUILD_ROOT + ( cd $RPM_BUILD_ROOT%{l_prefix}/bin + for file in erl erlc epmd run_erl to_erl dialyzer escript typer; do + rm -f $file + ln -s ../lib/erlang/bin/$file $file + done + cd $RPM_BUILD_ROOT%{l_prefix}/lib/erlang/bin + rm -f epmd + ln -s ../erts-*/bin/epmd epmd + cd $RPM_BUILD_ROOT%{l_prefix}/lib/erlang/bin + %{l_shtool} subst \ + -e "s;$RPM_BUILD_ROOT;;" \ + erl start + cd $RPM_BUILD_ROOT%{l_prefix} + %{l_gzip} -c -d %{SOURCE1} | %{l_tar} xf - 'man/man1' + ) || exit $? + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} + +%files -f files + +%clean +