From e99eba36f001cb80c23bef099623ebcf704ab981 Mon Sep 17 00:00:00 2001
From: Fons Rademakers <Fons.Rademakers@cern.ch>
Date: Mon, 23 Apr 2001 09:10:12 +0000
Subject: [PATCH] updates by Christian Holm for making debian and RedHat
 packages.

git-svn-id: http://root.cern.ch/svn/root/trunk@2050 27541ba8-7e3a-0410-8455-c3a389f83636
---
 Makefile          | 58 ++++++++++++++++++++++++++++-------
 README/INSTALL    | 78 ++++++++++++++++++++++++++++++++++++++++++++++-
 man/root-config.1 | 50 ++++++++++++++++++++++++++++--
 man/root.1        | 12 ++++++--
 man/rootn.exe.1   | 54 ++++++++++++++++++++++++++++++++
 5 files changed, 235 insertions(+), 17 deletions(-)
 create mode 100644 man/rootn.exe.1

diff --git a/Makefile b/Makefile
index 01ea2ddf13a..cf6fe51ae6f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,15 +4,24 @@
 # Author: Fons Rademakers, 29/2/2000
 
 
-##### include path/location macros (result of ./configure) #####
+##### Include path/location macros (result of ./configure) #####
+##### However, if we are building packages or cleaning,    #####
+##### config/Makefile.config isn't made yet - the package  #####
+##### scripts want's to make it them selves - so we don't  #####
 
+ifeq ($(findstring $(MAKECMDGOALS), maintainer-clean debian redhat),)
 include config/Makefile.config
+endif
 
-##### include machine dependent macros #####
+##### Include machine dependent macros                     #####
+##### However, if we are building packages or cleaning, we #####
+##### don't include this file since it may screw up things #####
 
+ifeq ($(findstring $(MAKECMDGOALS), maintainer-clean debian redhat),)
 include config/Makefile.$(ARCH)
+endif
 
-##### allow local macros #####
+##### Allow local macros #####
 
 -include MyConfig.mk
 
@@ -262,16 +271,41 @@ distsrc:
 	@$(MAKEDISTSRC)
 
 debian:
-	@if [ ! -f /usr/bin/debuild -o ! -f /usr/bin/dh_testdir ]; then \
+	@if [ ! -x `which debuild` ] || [ ! -x `which dh_testdir` ]; then \
 	   echo "You must have debuild and debhelper installed to"; \
 	   echo "make the Debian GNU/Linux package"; exit 1; fi
-	@echo "Nothing yet - sorry"
+	@echo "OK, you're on a Debian GNU/Linux system - cool"
+	@vers=`sed 's|\(.*\)/\(.*\)|\1.\2|' < build/version_number` ; \
+	  dirvers=`basename $$PWD | sed 's|root-\(.*\)|\1|'` ; \
+	  if [ "$$vers" != "$$dirvers" ] ; then \
+	    echo "Must have ROOT source tree in root-$$vers" ; \
+	    echo "Please rename this directory to `basename $$PWD` to"; \
+	    echo "root-$$vers and try again"; exit 1 ; fi
+	build/package/lib/makedebclean.sh
+	build/package/lib/makedebdir.sh
+	debuild -rfakeroot -us -uc -i"G__|^debian|\.d$$"
+	@echo "Debian GNU/Linux packages done. They are put in '../'"
 
 redhat:
-	@if [ ! -f /bin/rpm ]; then \
+	@if [ ! -x `which rpm` ]; then \
 	   echo "You must have rpm installed to make the Redhat package"; \
 	   exit 1; fi
-	@echo "Nothing yet - sorry"
+	@echo "OK, you have RPM on your system - good"
+	build/package/lib/makerpmclean.sh
+	build/package/lib/makerpmspec.sh
+	@echo "To build the packages, make a gzipped tar ball of the sources"
+	@vers=`sed 's|\(.*\)/\(.*\)|\1.\2|' < build/version_number` ; \
+	  echo "called root-v$$vers.source.tar.gz and put it in you RPM "
+	@echo "source directory (default /usr/src/rpm/SOURCES) and the "
+	@echo "spec-file ../root.spec in your RPM spec directory"
+	@echo "(default /usr/src/RPM/SPECS). If you want to build outside"
+	@echo "the regular tree, please refer to the RPM documentation."
+	@echo "After that, do"
+	@echo "   rpm -ba root.spec "
+	@echo "to actually build the packages. More details are given in"
+	@echo "README/INSTALL"
+#	rpm -bb --rcfile rpm/rpmrc --buildroot `pwd`/rpm/tmp rpm/root.spec
+#	@echo "Redhat Linux packages done. They are put in '../<arch>'"
 
 clean::
 	@rm -f __compiledata __makeinfo *~ core
@@ -286,19 +320,21 @@ clean::
 endif
 
 distclean:: clean
-	@mv -f include/config.h include/config.hh
+	-@mv -f include/config.h include/config.hh
 	@rm -f include/*.h $(MAKEINFO) $(CORELIB)
-	@mv -f include/config.hh include/config.h
+	-@mv -f include/config.hh include/config.h
 	@rm -f build/dummy.d bin/*.dll lib/*.def lib/*.exp lib/*.lib .def
 	@rm -f tutorials/*.root tutorials/*.ps tutorials/*.gif so_locations
 	@rm -f tutorials/pca.C tutorials/*.so
 	@rm -f $(CINTDIR)/include/*.dl* $(CINTDIR)/stl/*.dll README/ChangeLog
 	@rm -rf htmldoc
-	@cd test && $(MAKE) distclean
+	-@cd test && $(MAKE) distclean
 
 maintainer-clean:: distclean
+	-build/package/lib/makedebclean.sh
+	-build/package/lib/makerpmclean.sh
 	@rm -rf bin lib include system.rootrc config/Makefile.config \
-	   test/Makefile
+	   test/Makefile etc/system.rootrc
 
 version: $(CINTTMP)
 	@$(MAKEVERSION)
diff --git a/README/INSTALL b/README/INSTALL
index 9f5d31b5d2f..e3cf3ab6010 100644
--- a/README/INSTALL
+++ b/README/INSTALL
@@ -80,7 +80,9 @@ Before proceeding read the complete document.
 Choosing the installation method
 --------------------------------
 
-There are two main methods of installing ROOT from source.
+There are two main methods of installing ROOT from source.  As an
+alternative, you can build either a set of Debian GNU/Linux or Redhat 
+Linux packages. 
 
 1) You want to install in a generic directory, depending on
    environment variables ROOTSYS, LD_LIBRARY_PATH, and PATH.
@@ -142,6 +144,80 @@ There are two main methods of installing ROOT from source.
         rehash
         root
 
+Redhat packages:
+----------------
+Get the sources for a specific release from CVS or from a tar-ball, as
+outlined above and cd into the source directory. Then just do 
+
+	make redhat 
+
+This will create a RPM spec file in "../". To build the packages do: 
+
+1) 
+        cd ../ 
+	tar -czvf root_v<version>.source.tar.gz root 
+	
+  where <version>=<major>.<minor>.<revision> is the version number of
+  ROOT (see the file build/version_number). 
+
+2) 
+  A) If you have system privileges, you can now do 
+
+	cp root_v<version>.source.tar.gz /usr/src/redhat/SOURCES/
+
+     or where ever RPM looks for source archives. 
+
+  B) However, if you don't have system privileges, you should set up a 
+     build area by having the file ~/.rpmrc with a contents like 
+
+        %macros /usr/lib/rpm/macros:<your home dir>/.rpmmac 
+
+     and a file <your home dir>/.rpmmac with a contents like 
+
+        %_topdir: <some where you can write>/redhat 
+
+     Then you should make the appropiate directories: 
+
+        mkdir <some where you can write>/redhat 
+        mkdir <some where you can write>/redhat/SOURCES
+        mkdir <some where you can write>/redhat/BUILD
+        mkdir <some where you can write>/redhat/RPMS
+        mkdir <some where you can write>/redhat/SRPMS
+        mkdir <some where you can write>/redhat/SPECS
+
+     and finally copy the source tar-ball
+
+       cp root_v<version>.source.tar.gz \
+	  <some where you can write>/redhat/SOURCES
+
+3) Wether you have system privileges or not, you can now build the RPM 
+   packages by issuing
+
+       rpm -ba root.spec 
+
+Per default the binaries will be build in /tmp/rootrpm, but one may
+change that at build time by passing the option --buildroot too rpm. 
+
+Please refer to man-page rpm(1) and http://www.rpm.org for more
+infomation on RPM. 
+
+Please note, that it is assumed you have OpenGL (Mesa), SHIFT, MySQL,
+CERNLIB, and true type fonts installed. If that is not the case,
+please see if there are pre-build rpms at http://root.cern.ch, or if
+you feel lucky, read build/package/common/README thourougly! 
+
+Debian GNU/Linux packages:
+--------------------------
+Get the sources for a specific release from CVS or from a tar-ball, as
+outlined above and cd into the source directory. Then just do 
+
+	make debian
+
+The packages will be build in "../". Please note, that it is assumed you
+have OpenGL (Mesa), SHIFT, MySQL, CERNLIB, and true type fonts
+install. If that is not the case, please see if there are pre-build
+debs at http://root.cern.ch, or if you feel lucky, read
+build/package/common/README thourougly!  
 
 Installation Location
 =====================
diff --git a/man/root-config.1 b/man/root-config.1
index d3332f55ba0..5219cfae823 100644
--- a/man/root-config.1
+++ b/man/root-config.1
@@ -1,11 +1,14 @@
 .\"
-.\" $Id$
+.\" $Id: root-config.1,v 1.1 2000/12/08 17:41:01 rdm Exp $
 .\"
 .TH ROOT-CONFIG 1 "Version 3" "ROOT"
 .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
 .\" other parms are allowed: see man(7), man(1)
 .SH NAME
 root-config \- ROOT utility for your Makefiles
+.SH SYNOPSIS
+.B root-config
+.I "[options]"
 .SH "DESCRIPTION"
 Put lines like 
 .RS 
@@ -62,7 +65,45 @@ AM_PROG_LIBTOOL
 .fi
 .RE
 along with any other macros you may need. 
- 
+
+.SH OPTIONS 
+.TP 
+.B --help
+Gives a short list of options avaliable, and exit
+.TP
+.B --version 
+Report the version number of installed \fBROOT\fR, and exit. 
+.TP
+.BI --prefix =<prefix>
+If no arguments is given, reports where \fBROOT\fR is installed. With
+an argument of =\fI<prefix>\fR, set the base of the subsequent options
+to \fI<prefix>\fR. If \fB--exec-prefix\fR is passedwith an argument,
+that argument overrides the argument given to \fB--prefix\fR for the
+library path. 
+.TP
+.BI --exec-prefix =<prefix>
+If no argument is given, report where the libraries are installed. If
+an argument is given, use that as the installation base directory for
+the libraries. This option does not affect the include path. 
+.TP
+.B --libs
+Output a line suitable for linking a program agains the \fBROOT\fR
+libraries. No graphics libraries are output. 
+.TP
+.B --glibs
+As above, but also output for the graphics libraries. 
+.TP
+.B --cflags
+Output a line suitable for compiling a source file againd the
+\fBROOT\fR header (class declararion) files. 
+.TP
+.B --new 
+Output a line suitable for linking against the \fBROOT\fR library
+.TP
+.B --nonew 
+Compatiblity option. Does nothing. 
+\fBlibNew\fR. This option \fImust\fR be given before options
+\fB--libs\fR and \fB--glibs\fR. 
 .SH "SEE ALSO"
 \fIroot\fR(1), \fIroot-cint\fR(1)
 .PP
@@ -108,5 +149,8 @@ This manual page was written by Christian Holm Christensen
 <cholm@nbi.dk>, for the Debian GNU/Linux system (but may be used by
 others). 
 .\"
-.\" $Log$
+.\" $Log: root-config.1,v $
+.\" Revision 1.1  2000/12/08 17:41:01  rdm
+.\" man pages of all ROOT executables provided by Christian Holm.
+.\"
 .\"
diff --git a/man/root.1 b/man/root.1
index 849b1c50c18..f265e1f9cbd 100644
--- a/man/root.1
+++ b/man/root.1
@@ -1,5 +1,5 @@
 .\" 
-.\" $Id$
+.\" $Id: root.1,v 1.1 2000/12/08 17:41:01 rdm Exp $
 .\" 
 .TH ROOT 1 "Version 3" "ROOT"
 .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
@@ -48,6 +48,11 @@ For extensive documentation on the \fBROOT\fR system, see
 .UR http://root.cern.ch
 \fIhttp://root.cern.ch\fR
 .UE
+.PP
+A \fBUsers Guide\fR is avaliable from 
+.UR http://root.cern.ch/root/UsersGuide.html
+\fIhttp://root.cern.ch/root/UsersGuide.html\fR
+.UE
 .PP 
 The classes of ROOT are all documented on 
 .UR http://root.cern.ch/root/html/ClassIndex.html
@@ -112,5 +117,8 @@ This manual page was written by Christian Holm Christensen
 <cholm@nbi.dk>, for the Debian GNU/Linux system (but may be used by
 others). 
 .\" 
-.\" $Log$
+.\" $Log: root.1,v $
+.\" Revision 1.1  2000/12/08 17:41:01  rdm
+.\" man pages of all ROOT executables provided by Christian Holm.
+.\"
 .\" 
diff --git a/man/rootn.exe.1 b/man/rootn.exe.1
new file mode 100644
index 00000000000..4088264e6e9
--- /dev/null
+++ b/man/rootn.exe.1
@@ -0,0 +1,54 @@
+.TH ROOTN.EXE 1 "Version 3" "ROOT"
+.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
+.\" other parms are allowed: see man(7), man(1)
+.SH NAME
+rootn.exe \- ROOT interpretor memory managed backend 
+.SH DESCRIPTION
+This executable is linked with \fBlibNew\fR, unlike \fIroot.exe\fR,
+which makes it appropiate for if one wants to use memory mapped file,
+\fBTMapFile\fR, and so on. In all other aspects, it's the same as
+the \fIroot\fR(1) executable.
+.SH "SEE ALSO"
+.SB
+\fIroot\fR(1), \fIroot.exe\fR(1), and \fIcint\fR(1)
+.SE
+.SH "ORIGINAL AUTHORS"
+The ROOT team:
+.RS
+.B Rene Brun 
+and
+.B Fons Rademakers
+.RE
+.SH "COPYRIGHT"
+ROOT Software Terms and Conditions
+.PP
+The authors hereby grant permission to use, copy, and distribute this
+software and its documentation for any purpose, provided that existing
+copyright notices are retained in all copies and that this notice is
+included verbatim in any distributions. Additionally, the authors grant
+permission to modify this software and its documentation for any purpose,
+provided that such modifications are not distributed without the explicit
+consent of the authors and that existing copyright notices are retained in
+all copies. Users of the software are asked to feed back problems, benefits,
+and/or suggestions about the software to the ROOT Development Team
+(rootdev@root.cern.ch). Support for this software - fixing of bugs,
+incorporation of new features - is done on a best effort basis. All bug
+fixes and enhancements will be made available under the same terms and
+conditions as the original software,
+.PP
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.PP
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS
+PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO
+OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+.SH AUTHOR 
+This manual page was written by Christian Holm Christensen
+<cholm@nbi.dk>, for the Debian GNU/Linux system (but may be used by
+others). 
+
-- 
GitLab