Another RPM & patches.

Geoff Wong <>
Wed Feb 2 15:14:16 CET 2000


I noticed an RPM spec that was posted on here previously 
(by Mustafa via Per).  It had the problem it bristled the existing
installed system and tended to end up with a lot of miscellaneous stuff in it.

I've built another RPM spec using the patches on the Erlang
site and and some of my own patches so as not to bristle the existing system
(I hope).

Also included is a patch for detecting OpenSSL in the existing
system (rather than SSleay within the source tree). And it installs
the erl_interface and lib/ic libs and .h files in the location they
were in the previous open source release (I think).

Anyway - I should be able to put the RPM up on the eddieware.org site 
in the next day or so for those who don't like to wait hours for
the build :-)

The other thing to note is in /lib/snmp library is the default use
of "nawk" in building. Probably should be autoconf'ed to use awk/gawk
instead of nawk when nawk is not available. (make the script
v2tov1.in or something and have autoconf handle it, or the Makefile
could run sed on it; not too worried about snmp at this stage).

Please send me any feedback/improvements on the RPM!

Geoff


--- otp.rpm.spec (cut here)

Summary: The Erlang/OTP system.
Name: erlang_otp
#
########################################
# Uncomment "%define" and "Requires"
# for your intended RedHat version
#
##### RedHat 5.2 #####
#%define rhrel 5.2
#Requires: redhat-release < 6.0
#
##### RedHat 6.0 #####
%define rhrel 6.1
Requires: redhat-release >= 6.0
########################################
#
Version: R6B
Release: 2
%define SrcRelease 1
Copyright: Ericsson Public License
Group: Networking/Utilities
Source: http://www.erlang.org/download/otp_src_%{version}-%{SrcRelease}.tar.gz
Patch0: http://www.erlang.org/faq/tmp_patch_R6B0.1.1.txt  
Patch1: http://www.erlang.org/faq/tmp_patch_R6B0.2.txt    
Patch2: http://www.erlang.org/faq/tmp_patch_R6B0.3.txt  
Patch3: http://www.erlang.org/faq/tmp_patch_R6B0.4.txt  
Patch4: http://www.erlang.org/faq/tmp_patch_R6B0.5.txt  
Patch5: http://www.erlang.org/faq/tmp_patch_R6B0.6.txt
Patch6: http://www.erlang.org/faq/tmp_patch_R6B0.7.txt
Patch7: http://www.erlang.org/faq/tmp_patch_R6B0.8.txt
Patch8: tmp_patch_R6B0.9.txt
Patch9: tmp_patch_R6B0.10.txt
Patch10: tmp_patch_R6B0.11.txt
Patch11: tmp_patch_R6B0.12.txt
Patch12: tmp_patch_R6B0.13.txt
Patch13: tmp_patch_R6B0.14.txt
Patch14: tmp_patch_R6B0.15.txt
Provides: Open Source Erlang/OTP
BuildRoot: /tmp/erlangbuild
URL: http://www.erlang.org/
Packager: 


%description
The Erlang/OTP system --- Erlang is a programming language which
has many features more commonly associated with an operating system
than with a programming language: concurrent processes, scheduling,
memory management, distribution, networking, etc. The development package
in addition contains the Erlang sources for all base libraries.
Includes the Erlang/OTP graphical libraries.

NOTE: this RPM is intended for RedHat %{rhrel} systems.

%prep

rm -rf "$RPM_BUILD_ROOT"

%setup -n otp_src_%{version}-0

patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.1.1.txt  
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.2.txt    
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.3.txt  
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.4.txt  
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.5.txt  
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.6.txt
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.7.txt
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.8.txt
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.9.txt
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.10.txt
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.11.txt
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.12.txt
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.13.txt
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.14.txt
patch -p0 < $RPM_SOURCE_DIR/tmp_patch_R6B0.15.txt

%build

./configure --prefix=/usr/local 
make

%install

rm -rf $RPM_BUILD_ROOT
make install INSTALL_PREFIX="$RPM_BUILD_ROOT"

%clean

rm -rf "$RPM_BUILD_ROOT"

%files

%defattr(644 root root 755)
%attr( - ,root,root)  /usr/local/bin
%attr( - ,root,root)  /usr/local/lib

%changelog
* Wed Dec  1 1999 Geoff Wong <>
- revamped spec file


----------------- tmp_patch_R6B0.9.txt (cut here)

--- Makefile.in.ORIG	Mon Jan 31 17:41:33 2000
+++ Makefile.in	Wed Feb  2 01:02:44 2000
@@ -61,6 +61,7 @@
 
 # You can *not* change these two, they have to stay this way for now.
 ERLANG_BINDIR     = $(ERLANG_LIBDIR)/bin
+ERLANG_IBINDIR     = $(ERLANG_ILIBDIR)/bin
 ERLANG_ERTSBINDIR = $(ERLANG_LIBDIR)/$(ERTS)/bin
 
 # The directory in which man pages for above executables are put
@@ -105,6 +106,8 @@
 # depending on which system is preferred.)
 LOCAL_PATH     = $(ERL_TOP)/erts/bin/$(TARGET):$(ERL_TOP)/erts/bin
 BOOTSTRAP_PATH = $(ERL_TOP)/bootstrap/bin
+PATH := $(LOCAL_PATH):$(BOOTSTRAP_PATH):$(PATH)
+export PATH
 
 # ----------------------------------------------------------------------
 
@@ -166,15 +169,15 @@
 	  $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release 
 
 install.Install:
-	cd $(ERLANG_LIBDIR) && ./Install -minimal $(ERLANG_LIBDIR)
+	cd $(ERLANG_LIBDIR) && ./Install -prefix $(INSTALL_PREFIX) -minimal $(ERLANG_ILIBDIR)
 
 #
 # Erlang base public files
 #
 install.bin:
 	rm -f $(BINDIR)/erl $(BINDIR)/erlc
-	${LN_S} $(ERLANG_BINDIR)/erl      $(BINDIR)/erl
-	${LN_S} $(ERLANG_BINDIR)/erlc     $(BINDIR)/erlc
+	${LN_S} $(ERLANG_IBINDIR)/erl      $(BINDIR)/erl
+	${LN_S} $(ERLANG_IBINDIR)/erlc     $(BINDIR)/erlc
 
 #
 # Directories needed before we can install

----------------- tmp_patch_R6B0.10.txt (cut here)

--- erts/autoconf/configure.in.ORIG	Wed Feb  2 15:35:56 2000
+++ erts/autoconf/configure.in	Wed Feb  2 17:29:05 2000
@@ -493,15 +493,35 @@
 AC_SUBST(ded_soname)
 
 dnl
-dnl crypto also needs ssleay
+dnl crypto also needs openSSL/ssleay
 dnl
-AC_SUBST(SSLEAY_ROOT)
-SSLEAY_ROOT=
-if test -d ${ERL_TOP}/lib/ssl/usr/ssleay; then
-  SSLEAY_ROOT='$(ERL_TOP)/ssl/usr/ssleay/$(TARGET)'
+dnl OpenSSL stuff
+
+AC_CHECK_HEADER(/usr/local/ssl/include/openssl/opensslv.h, ac_cv_openssl=yes, ac_cv_openssl=no)
+if test $ac_cv_openssl = yes ; then
+    SSLEAY_ROOT=/usr/local/ssl/
+    SSL_INCLUDE='-I/usr/local/ssl/include/openssl -I/usr/local/ssl/include'
 else
-  echo "I could not find ssleay" > ${ERL_TOP}/lib/crypto/SKIP
+    AC_CHECK_HEADER(/usr/ssl/include/openssl/opensslv.h, ac_cv_openssl=yes, ac_cv_openssl=no)
+    if test $ac_cv_openssl = yes ; then
+        SSLEAY_ROOT=/usr/ssl/
+        SSL_INCLUDE='-I/usr/ssl/include/openssl -I/usr/ssl/include'
+    dnl how about ssleay
+    else 
+        if test -d ${ERL_TOP}/lib/ssl/usr/ssleay; then
+            SSLEAY_ROOT='$(ERL_TOP)/ssl/usr/ssleay/$(TARGET)'
+            SSL_INCLUDE='-I$(ERL_TOP)/lib/ssl/usr/ssleay/include'
+        else
+            SSLEAY_ROOT=
+            SSL_INCLUDE=
+            AC_MSG_WARN([OpenSSL or SSleay not found, will build without SSL support])
+            echo "I could not find OpenSSL or SSLeay" > $(ERL_TOP)/lib/crypto/SKIP
+        fi
+    fi
 fi
+
+AC_SUBST(SSL_INCLUDE)
+AC_SUBST(SSLEAY_ROOT)
 
 
 #--------------------------------------------------------------------

----------------- tmp_patch_R6B0.11.txt (cut here)

--- erts/start_scripts/Makefile.ORIG	Tue Feb  1 15:13:34 2000
+++ erts/start_scripts/Makefile	Tue Feb  1 15:13:44 2000
@@ -55,7 +55,7 @@
 	start_all_example.rel
 
 SASL_PATH = -pa $(ROOTDIR)/lib/sasl/ebin 
-ELIBROOT = ../..
+ELIBROOT = ../../bootstrap/lib
 ELIBDIR = $(ELIBROOT)/lib
 SCRIPT_PATH = -I$(ELIBDIR)/kernel/ebin -I$(ELIBDIR)/stdlib/ebin -I$(ELIBDIR)/sasl/ebin
 SCRIPT_FLAGS = 

----------------- tmp_patch_R6B0.12.txt (cut here)


--- erts/etc/unix/Install.src.ORIG	Tue Feb  1 17:19:37 2000
+++ erts/etc/unix/Install.src	Tue Feb  1 17:19:09 2000
@@ -8,6 +8,9 @@
 	case $1 in
 		-minimal) start_option=minimal ;;
 		-sasl)    start_option=sasl    ;;
+        -prefix)  
+                  INSTALL_PREFIX=$2
+                  shift ;;
 		*)        ERL_ROOT=$1          ;;
 	esac
 	shift
@@ -25,22 +28,22 @@
 	exit 1
 fi
 
-if [ ! -d $ERL_ROOT/erts-%I_VSN%/bin ]
+if [ ! -d $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/bin ]
 then
 	echo "Install: The directory $ERL_ROOT/erts-%I_VSN%/bin does not exist"
 	echo "         Bad location or erts module not un-tared"
 	exit 1
 fi
 
-if [ -d $ERL_ROOT/erts-%I_VSN%/obj ]
+if [ -d $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/obj ]
 then
-	cd $ERL_ROOT/erts-%I_VSN%/obj
+	cd $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/obj
 	sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" Makefile.src > Makefile
 fi
 
-if [ ! -d $ERL_ROOT/bin ]
+if [ ! -d $INSTALL_PREFIX/$ERL_ROOT/bin ]
 then
-        mkdir $ERL_ROOT/bin
+        mkdir $INSTALL_PREFIX/$ERL_ROOT/bin
 fi
 
 #
@@ -57,7 +60,7 @@
 	                TARGET="" ;;
 esac
 
-cd $ERL_ROOT/erts-%I_VSN%/bin
+cd $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/bin
 
 sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" erl.src > erl
 chmod 755 erl
@@ -67,15 +70,15 @@
 # currently only on Solaris/SunOS 5
 #
 if [ "X$TARGET" = "Xsunos5" ]; then
-  (cd $ERL_ROOT/erts-%I_VSN%/bin;
+  (cd $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/bin;
    sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" start.src > start;
    chmod 755 start)
 fi
 
-cd $ERL_ROOT/bin
+cd $INSTALL_PREFIX/$ERL_ROOT/bin
 
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/erl .
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/erlc .
+cp -p $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/bin/erl .
+cp -p $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/bin/erlc .
 
 #
 # Set a soft link to epmd
@@ -90,29 +93,29 @@
 ln -s $ERL_ROOT/erts-%I_VSN%/bin/epmd epmd
 
 if [ "X$TARGET" = "Xsunos5" ]; then
-  cp -p $ERL_ROOT/erts-%I_VSN%/bin/run_erl .
-  cp -p $ERL_ROOT/erts-%I_VSN%/bin/to_erl .
-  cp -p $ERL_ROOT/erts-%I_VSN%/bin/start .
-  sed -e "s;%EMU%;%EMULATOR%%EMULATOR_NUMBER%;" $ERL_ROOT/erts-%I_VSN%/bin/start_erl.src > start_erl
+  cp -p $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/bin/run_erl .
+  cp -p $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/bin/to_erl .
+  cp -p $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/bin/start .
+  sed -e "s;%EMU%;%EMULATOR%%EMULATOR_NUMBER%;" $INSTALL_PREFIX/$ERL_ROOT/erts-%I_VSN%/bin/start_erl.src > start_erl
   chmod 755 start_erl
 fi
 
-if [ -d $ERL_ROOT/lib/sasl* ]
+if [ -d $INSTALL_PREFIX/$ERL_ROOT/lib/sasl* ]
 then
-    (cd $ERL_ROOT/releases
+    (cd $INSTALL_PREFIX/$ERL_ROOT/releases
      echo %I_VSN% %I_SYSTEM_VSN% > start_erl.data)
      echo ""
-    (cd $ERL_ROOT/releases/%I_SYSTEM_VSN%
+    (cd $INSTALL_PREFIX/$ERL_ROOT/releases/%I_SYSTEM_VSN%
      echo ""
      echo "Building SASL boot script ..."
 #     ERCL_EMULATOR="$ERL_ROOT/bin/erl +B -boot ./start" $ERL_ROOT/bin/erlc -s start_sasl.rel
-     $ERL_ROOT/bin/erl -noinput +B -boot ./start -s systools make_script start_sasl -s erlang halt
-     $ERL_ROOT/bin/erl -noinput +B -boot ./start -s release_handler create_RELEASES $ERL_ROOT start_sasl.rel -s erlang halt
+     $INSTALL_PREFIX/$ERL_ROOT/bin/erl -noinput +B -boot ./start -s systools make_script start_sasl -s erlang halt
+     $INSTALL_PREFIX/$ERL_ROOT/bin/erl -noinput +B -boot ./start -s release_handler create_RELEASES $ERL_ROOT start_sasl.rel -s erlang halt
      echo "")
 fi
 
 
-if [ -f $ERL_ROOT/releases/%I_SYSTEM_VSN%/start_sasl.boot ] && \
+if [ -f $INSTALL_PREFIX/$ERL_ROOT/releases/%I_SYSTEM_VSN%/start_sasl.boot ] && \
    [ "$start_option" = "query" ]
 then
     echo "Do you want to use a minimal system startup"
@@ -142,10 +145,10 @@
 #
 # Installation of pxw
 #
-if [ -d $ERL_ROOT/lib/pxw -a -x $ERL_ROOT/lib/pxw/Install ]
+if [ -d $INSTALL_PREFIX/$ERL_ROOT/lib/pxw -a -x $INSTALL_PREFIX/$ERL_ROOT/lib/pxw/Install ]
 then
-	cd $ERL_ROOT/lib/pxw
-	./Install $ERL_ROOT
+	cd $INSTALL_PREFIX/$ERL_ROOT/lib/pxw
+	./Install -prefix $INSTALL_PREFIX $ERL_ROOT
 fi
 
 #
@@ -153,7 +156,7 @@
 # but ignore failures.
 #
 if [ "X$TARGET" != "Xsunos5" ]; then 
-    cd $ERL_ROOT/usr/lib
+    cd $INSTALL_PREFIX/$ERL_ROOT/usr/lib
     for library in lib*.a
     do
 	(ranlib $library) > /dev/null 2>&1
@@ -165,10 +168,10 @@
 # Fixing the man pages
 #
 
-if [ -d $ERL_ROOT/man ]
+if [ -d $INSTALL_PREFIX/$ERL_ROOT/man ]
 then
-    cd $ERL_ROOT
-    ./misc/format_man_pages $ERL_ROOT
+    cd $INSTALL_PREFIX/$ERL_ROOT
+    ./misc/format_man_pages $INSTALL_PREFIX/$ERL_ROOT
 fi
 
 
----------------- tmp_patch_R6B0.13.txt (cut here)


--- lib/crypto/c_src/Makefile.in.ORIG	Wed Feb  2 17:20:33 2000
+++ lib/crypto/c_src/Makefile.in	Wed Feb  2 17:29:55 2000
@@ -49,11 +49,11 @@
 SSLEAY_ROOT = @SSLEAY_ROOT@
 
 SSLEAY_LIBDIR = $(SSLEAY_ROOT)/lib
-SSLEAY_INCDIR = $(SSLEAY_ROOT)/include
+SSLEAY_INCDIR = @SSL_INCLUDE@
 # For erl_driver.h
 SYS_INCDIR = $(ERL_TOP)/erts/emulator/beam
 
-INCLUDES = -I $(SSLEAY_INCDIR) -I $(SYS_INCDIR)
+INCLUDES = $(SSLEAY_INCDIR) -I $(SYS_INCDIR)
 
 ifeq ($(TYPE),debug)
 TYPEMARKER = .debug

----------------- tmp_patch_R6B0.14.txt (cut here)

--- lib/erl_interface/src/Makefile.in.ORIG	Wed Feb  2 23:50:58 2000
+++ lib/erl_interface/src/Makefile.in	Thu Feb  3 01:04:55 2000
@@ -181,9 +181,13 @@
 	$(INSTALL_DIR) $(RELSYSDIR)/lib
 	$(INSTALL_DIR) $(RELSYSDIR)/bin
 	$(INSTALL_DIR) $(RELSYSDIR)/src
+	$(INSTALL_DIR) $(RELEASE_PATH)/usr/lib
+	$(INSTALL_DIR) $(RELEASE_PATH)/usr/include
 
 	$(INSTALL_DATA) $(ERL_HEADERS) $(RELSYSDIR)/include
+	$(INSTALL_DATA) $(ERL_HEADERS) $(RELEASE_PATH)/usr/include
 	$(INSTALL_DATA) $(OBJDIR)/$(ERL_LIB) $(RELSYSDIR)/lib
+	$(INSTALL_DATA) $(OBJDIR)/$(ERL_LIB) $(RELEASE_PATH)/usr/lib
 #	-$(RANLIB) $(RELSYSDIR)/lib/$(ERL_LIB)
 
 	$(INSTALL_DATA) $(OBJDIR)/$(EI_LIB) $(RELSYSDIR)/lib

----------------- tmp_patch_R6B0.15.txt (cut here)


--- lib/ic/c_src/Makefile.in.ORIG	Wed Feb  2 23:59:17 2000
+++ lib/ic/c_src/Makefile.in	Thu Feb  3 00:02:48 2000
@@ -132,7 +132,11 @@
 	$(INSTALL_DIR) $(RELSYSDIR)/c_src
 	$(INSTALL_DIR) $(RELSYSDIR)/include
 	$(INSTALL_DIR) $(RELSYSDIR)/priv/lib
+	$(INSTALL_DIR) $(RELEASE_PATH)/usr/include
+	$(INSTALL_DIR) $(RELEASE_PATH)/usr/lib
 	$(INSTALL_DATA) $(IDL_FILES) $(H_FILES) $(RELSYSDIR)/include
+	$(INSTALL_DATA) $(IDL_FILES) $(H_FILES) $(RELEASE_PATH)/usr/include
 	$(INSTALL_DATA) $(LIBRARY) $(RELSYSDIR)/priv/lib
+	$(INSTALL_DATA) $(LIBRARY) $(RELEASE_PATH)/usr/lib
 
 release_docs_spec:





More information about the erlang-questions mailing list