/*---------- README-rpm-3.0.6.os2  ----------------------------------------*/


     ******   ****  ****** ******     ***** ****  *****       
     ****** ***********************   ******************      
     *******************************  *******************     
        *******  ***   *****     ****   ****   ****   ***     
        *****          ****       ***   ***    ***    ***     
        ****           ***        ****  ***    ***    ***     
        ***            ***         ***  ***    ***    ***     
        ***            ***         ***  ***    ***    ***     
        ***            ***         ***  ***    ***    ***     
        ***            ****       ****  ***    ***    ***     
        ***            *****     ****   ***    ***    ***     
    *************      *************  *******  *****  *****   
    *************      *** ********   *******  *****  *****   
    *************      ***  *****     *******  *****  *****   
                       ***                                    
                       ***                                    
                       ***                                    
                    **********                                
                    **********                   version 3.0.6
                    **********              OS/2 patch level 11
                                                    Feb-19-2001
                                                              
Table of contents
=================

Introduction                         @int

History of OS/2 port                 Read `CHANGES.os2'

Problems of OS/2 ported rpm          Read `PROBLEMS.os2'

Required Executables and DLLs        @req

OS/2 Note                            @os2

Installation                         @ins

IMPORTANT NOTICE                     @imp

Setup Language                       @lan

Initialize database                  @ini

Check installed rpm system           @che

Documentations                       @doc

Manpages                             @man

Sample Usage of RPM                  Read `EXAMPLE.os2'

Sample Usage of Tools                Read `EXAMPLE.os2'

Compile from Source                  @com

Make rpm package for RPM 3.0.6       @mak

What I want to do                    See  `TODO.os2'

Appendix                             @app 

Acknowledgment                       @ack

Introduction    @int
============

  Quite a lot of OS/2 users may use Linux. But they might not be able to treat 

RedHat's RPM package as they do with "tar + gzip" archives. 

  I started porting RPM from version 2.5.5. Now, I updated RPM version 3.0.3 

to 3.0.6. This version of RPM is available for RPM packages created by RPM 
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
version 4.0, which you will find in RedHat Linux 7.0 or later. 
~~~~~~~~~~~
  First I intended to extract source files from RPM package. Later, I realized 
that RPM is very useful to make OS/2 distribution. Someday, I will put RPM 
package for OS/2 in my web page. 
  Not all of RPM features are available and some bugs do exist, but this copy
is suffice to unpack or make RPM package. 
  If you have questions and suggestions, please mail me. 
 


                                             SAWATAISHI Jun, YOKOHAMA JAPAN
                                                      <jsawa@attglobal.net>
                           http://www2s.biglobe.ne.jp/~vtgf3mpr/index.htm


Required Executables and DLLs    @req
=============================

HOBBES=ftp://hobbes.nmsu.edu/pub/os2
LEO=ftp://ftp.leo.org/pub/comp/os/os2/leo


`sh.exe' included in KSH package
     LEO/shells/pdksh-5.2.13-emx.zip
     HOBBES/util/shell/ksh527rt.zip


DLL files of zlib, gdbm, bzip2 : Included in this package

GNU cpio version 2.4.1 or later : `cpio.exe' is included (2.4.2)
     I used a patch file of OS/2 ported cpio:
        HOBBES/util/archiver/
               gnucpio.zip  243656 1996/01/07  GNU cpio v2.4.1 archiver 
     I made a patch for 2.4.2 and included it:
               `emx\src\redhat\SOURCES\cpio-2.4.2-OS2.diff.gz'


emx runtime version 0.9d (or later) with FIX03 : Not included
     ftp://hobbes.nmsu.edu/pub/os2/dev/emx/v0.9d/emxrt.zip



OS/2 Note @os2
=========

Notable changes made for OS/2 are as follows:

1. Rpm depends on three configration file, `.rpmrc', `.rpmmacros', and
  `.popt' in the HOME directory. Original rpm reads other files too. 

2. You can set a drive to install files from RPM binary package with
   environmental variable `RPMDRV'. If RPMDRV is not set, files of binary 
   rpm will be installed in the current drive. 

3. Rpm can handle file names with drive letters. 

4. When we install RPM binary packages, compatibility check for platform, 
   for OS, or for shared libraries are omitted. 

5. `find-provides' and `find-requires' are modified to emulate original ones
    



Installation @ins
============

1. Unzip `rpm306.zip' in some HPFS drive

    `README-rpm-3.0.6.os2'(this file) and `emx-rpm.zip' will be extracted in 
  the current directory. 

    If you have installed older version of OS/2 ported rpm, backup confi-
  guration files: `.rpmrc', `.popt', and `rpmmacros' in your HOME directory. 


2-a. Simple installation
    If you have installed emx in drive X and your environment variable HOME 
  is "X:\emx", installation can be simple. If you'd like to install this pa-
  ckage as your own plan, read the next section "2-b". 
    
       > unzip emx-rpm -d X:\


    Now, configration files are installed in `X:\emx';
             .rpmrc
             .rpmmacros
             .popt

         executables      in `X:\emx\bin';
         DLLs             in `X:\emx\dll';
         documents        in `X:\emx\doc\rpm-3.0.6';
         C include files  in `X:\emx\include';
         C library files  in `X:\emx\lib';
         manpages         in `X:\emx\man';
         message files    in `X:\emx\share\locale';
         patch files      in `X:\emx\src\redhat\SOURCES';
             rpm-3.0.6-OS2.diff.gz ------- for rpm version 3.0.6
             bzip2-1.0.0-OS2.diff.gz ---- for bzip2 version 1.0.0
             cpio-2.4.2-OS2.diff.gz ------ for GNU cpio version 2.4.2
         spec file        in `X:\emx\src\redhat\SOURCES';
             rpm-3.0.6-os2.spec ---------- spec file for OS/2 ported rpm
             bzip2-1.0.0-os2.spec -------- spec file for OS/2 ported bzip2
             hello.spec ------------------ spec file for test

         RPM binary file  in `X:\emx\src\redhat\RPMS\i386';
             hello-1.0-1.i386-OS2.rpm ---- test program
         RPM source file  in `X:\emx\src\redhat\SRPMS';
             hello-1.0-1.src.rpm --------- test program


    Be sure that `X:\emx\dll' is specifiled by LIBPATH and `X:\emx\bin' by 
  environment variable PATH in your `config.sys'. If not, add these diretories
  to LIBPATH and/or PATH. 


    Add a line in your `config.sys':
    
         set GNULOCALEDIR=X:/emx/share/locale   # Do not use '\'


    If you have manpage system,  "X:\emx\man" should be included in 
  environment variable MANPATH. 


    If you don't have emx/gcc, you can delete `X:\emx\lib' and 
  `X:\emx\include'. 


    If you have installed emx/gcc, `X:\emx\lib' and `X:\emx\include' may 
   not be suitable directories. If needed, move C include files and library
   files to proper directories. 


    Open `X:\emx\.rpmmacros' with your editor.
    


    --------------------------------------------------------------------
      Variables for shell  -- do NOT change them!
    --------------------------------------------------------------------

           line  87  %_buildshell   sh.exe
                271  %___build_cmd  sh.exe

    --------------------------------------------------------------------
      Variables which should include drive letter
    --------------------------------------------------------------------
           line  26  %_usr                   /emx
                 27  %_usrsrc                %{_usr}/src
                121  %_topdir                %{_usrsrc}/redhat
                 86  %_builddir              %{_topdir}/BUILD
                112  %_rpmdir                %{_topdir}/RPMS
                117  %_sourcedir             %{_topdir}/SOURCES
                118  %_specdir               %{_topdir}/SPECS
                119  %_srcrpmdir             %{_topdir}/SRPMS
                 89  %_dbpath                %{_var}/lib/rpm

                416  %_prefix                /emx
                 28  %_var                   %{_prefix}
                121  %_tmppath               %{_var}/tmp

         Change "/emx" at line 25 and 416 to "X:/emx".

         You may change temporary directory: %_tmppath  c:/tmp

    
    --------------------------------------------------------------------
      Variables which must begin with '/'
    --------------------------------------------------------------------
    
                 91  %_defaultdocdir         /emx/doc
    
           This variable is used when creating rpm package if `Docdir' 
         is not defined in spec file. 


    --------------------------------------------------------------------
      Variables for encryption and signing tools
    --------------------------------------------------------------------

            117  %_signature             none

         Choose one of these strings as  `%_signature':
              none  ; do not use 
              pgp   ; use pgp version 2.xxx for signature
              pgp5  ; use pgp version PGP 5.0x for signature ported by 
                      William H. Geiger III <whgiii@invweb.net>, 
                      Reinhard Schuerer" <reinhard@nascom.de>, and 
                      goodyer@pobox.com (Ian D. Goodyer)
              gpg   ; use GNU Privacy Guard for signature

            170  %_gpg_name
            171  %_gpg_path
            213  %_pgp_name
            214  %_pgp_path

          Define your name for gpg and/or pgp if you need

                    e.g.   %_gpg_name      John Lennon

          If you define `%_pgp_path', PGPPATH environment variable will 
          be overridden when creating rpm package. 

                     e.g.  %_pgp_path   X:/emx/share/pgp

          If you define `%_gpg_path', GNUPGHOME environment variable will 
          be overridden when creating rpm package. 

                     e.g.  %_gpg_path   X:/emx/.gnupg

    --------------------------------------------------------------------
      Variable for you name
    --------------------------------------------------------------------

              198  #%packager

          You should define `%packager' as your name and email address. 

                 e.g. %packager  SAWAIAISHI Jun <jsawa@attglobal.net>

    --------------------------------------------------------------------
      Variable for compression
    --------------------------------------------------------------------
 
      By default z library is used. 
      I recommend you to define "w9.bzdio", because of better compression. 

            %_source_payload   w9.bzdio
            %_binary_payload   w9.bzdio


         Here is a example of created rpm binary package

                       w9.gzdio  66,547 Kb
                       w.bzdio   61,063
                       w9.bzdio  60,978




NOW GOTO section 3, "Set environmental variable RPMDRV"



2-b. Custom installation

    If a drive specified by HOME environment variable doesn't have enough 
  space, you can install files for rpm in other places. 
  
    Note that `.rpmrc', `.rpmmacros' and `. popt' MUST BE INSTALLED in HOME 
  directory. 
  
    First of all, unzip `emx-rpm.zip' somewhere.
  
           y:\tmp> unzip emx-rpm.zip
           y:\tmp> cd emx
           y:\tmp\emx>
  
    Executables, DLLs, C include files, C library files, message files, 
  manpages, and other documents can be freely installed anywhere.  
  
    @ According to your definitions of LIPATH, PATH, MANPATH, and LIBPATH in 
       `conifig.sys' install *.exe, *.dll, *.h, *.a, *.lib, and *.8 in right 
       directories. 
    
    @ Decide where to install message files, and do like this. 

           y:\tmp\emx> xcopy /e /s share\locale\* X:\FOO\BAR
    
       Add a line "set GNULOCALEDIR=X:/FOO/BAR" to `config.sys'


    Finally, you must specify directories for rpm by editing `.rpmmacros' 
  in HOME directory. 

         A - Top directory : Parent directory of BUILD, RPMS, SOURCES, 
                             SPECS, and SRPMS
                            
         B - Database directory : Where rpm database is created 

         D - Directory for temporary files
         
         E - "prefix" for Makefile
         
         F - ``packager'': Your name and address


     Open `y:\tmp\emx\.rpmmacros' by your editor. You will see following 
   lines. 
     
          %_usr                   /emx
          %_usrsrc                %{_usr}/src
          %_var                   /emx
          %_dbpath                %{_var}/lib/rpm ---------------- B
          %_defaultdocdir         /emx/doc
          %_topdir                %{_usrsrc}/redhat  ------------- A
          %_builddir              %{_topdir}/BUILD
          %_sourcedir             %{_topdir}/SOURCES
          %_signature             none
          %_specdir               %{_topdir}/SPECS
          %_srcrpmdir             %{_topdir}/SRPMS
          %_topdir                %{_usrsrc}/redhat
          %_tmppath               %{_var}/tmp -------------------- D
          %_prefix                g:/emx ------------------------- E
          #%packager                                               F

        
    @ Top directory
      If you prefer `g:\RedHat', change a line 89

          %_topdir                g:/RedHat

      And copy a directory tree to `g:/RedHat'
      
         y:\tmp\emx> mkdir g:\RedHat
         y:\tmp\emx> xcopy /e /s src\redhat\* g:\RedHat


    @ Rpm database directory and library directory
      If you'd like `c:\etc\rpm':

          %_dbpath                c:/etc/rpm
          %__find_provides        c:/etc/rpm
          %__find_requires        c:/etc/rpm
          #
       
           y:\tmp\emx> mkdir c:\etc
           y:\tmp\emx> mkdir c:\etc\rpm
         y:\tmp\emx> copy lib\rpm\* c:\etc\rpm
         

    @ Temporary directory
      To define it as `c:\tmp'   
          %_tmppath               c:/tmp
    
    @ "prefix" for Makefile
      If your emx/gcc in installed in `d:/emx'
          %_prefix                d:/emx



NOW go to the next section


3. Set environmental variable `RPMDRV'

    RPM binary packages (binaries, etc...) are extracted in a drive
  specified by `RPMDRV'.
   
    Add a line "set RPMDRV=Y" to `config.sys' 
                 ( `Y' is your  preffered drive to install)

NOW enter the next section


IMPORTANT NOTICE  @imp
================


Don not use `\' for directory separator in `.rpmmacros' in your home directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Using PGP 5.0i for OS/2 BETA 5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  We can download PGP 5 for OS/2 from  http://www.openpgp.net/

  In your `$HOME/.rpmmacros' define `%_signature' as `pgp5'
           %_signature   pgp5



Do not use `%defattr(..)'  in spec files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  `%defattr' will cause error and packaging will terminate


`docdir' defined in $HOME/.rpmmacros or spec files must begin with '/'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  `.rpmmacros':
        %_defaultdocdir         %{_usr}/doc
      You must begin %{_usr} with '/'


`.rpmrc', `.rpmmacros' and `.popt' must be DOS way text files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you make rpm from source, newline of `rpmpopt' may be UNIX way. To convert
newline into DOS way, open `rpmpopt' by E editor (e.exe) and make meaningless
change (c.f. add one SPACE ) and save the file. Now, `rpmpopt' has DOS way 
newline. Then, copy `rpmpopt' in your HOME directory as the name `popt'. 
  
 
  You can get newline code converter from hobbes ftp site.

         ftp://hobbes.nmsu.edu/pub/os2/apps/wp/

              ux_dos.zip  32985 1996/01/14  
                      Unix<->DOS, convert text files between Unix and DOS
         
         ftp://hobbes.nmsu.edu/pub/os2/util/file/
              flip1os2.zip 34194 1995/01/30  
                      Convert Unix text files to OS/2 & vice-versera


Never forget to define RPMDRV environment variable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Setup Language    @lan
==============
   
    Confirm that installation of message files have finished and 
  `config.sys' has a line "set GNULOCALEDIR=....". 

    Then, specify LANGUAGE environmental variable. 

         To know what kind of languages are prepared, do like this;

            \emx> dir /s X:\emx\share\locale\rpm.mo
         
         You will see MO files are installed; de, es, fr, .....

                           cs    Czech
                           de    German
                           es    Spanish
                           fi    Finnish
                           fr    French
                           ja    Japanese (SJIS)
                           pl    Polish
                           pt_Br Portuguese
                           ru    Russian
                           sk    Slovak
                           sr    Serbian
                           sv    Swedish
                           tr    Turkish
                           .................

         
         Add a line in your `config.sys'

                e.g      set LANGUAGE=tr
         

       Good way to test many kinds of language is to use one of GNU shell 
     utilities `env.exe'. 
       In OS/2 command shell
       
           > set GNULOCALEDIR=X:/emx/share/locale  
           > env LANGUAGE=it rpm --help            #  If you have done cus-
           > env LANGUAGE=ja rpm --help            #  tom installaion, GNU
           > env LANGUAGE=fr rpm --help            #  LOCALEDIR may be di-
                                                   #  fferent. 
         

      If you cannot use `env.exe', test messages like this.
                  (Be sure that *.exe and *.dll has been installed)
    
           > set GNULOCALEDIR=X:/emx/share/locale
           > set LANGUAGE=fr
           > rpm --help
        
                       You will see French messages
        
           > set LANGUAGE=es
           > rpm --help
    
                       Now Spanish messages will appear



    Now you had better confirm that environment variables, RPMDRV, 
  GNULOCALEDIR, LANGUAGE, HOME, PATH, and LIBPATH in `config.sys'
  are properly set. 
    Did you use '\' as directory separator in your `.rpmmacros' at HOME 
  directory? If so, change all '\' to '/'. 
  
    
    
REBOOT YOUR MACHINE, and read the next chapter ! 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Initializing database    @ini
=====================

   If you installed RPM for the first time, setup database. 

           > rpm --initdb

   If you already have installed old verstion (2.5.5 or 2.5.6), you have to
  reformat database. 

           > rpm --rebuilddb


   Confirm initial database is created or rebuilt in database directory.

           > dir X:\emx\src\redhat\rpm\*.rpm 
                         If you have done simple installation
                       
           > dir X:\FOO\BAR\rpm\*.rpm   
                         If you have done custom installation


[I:\src]dir i:\RedHat\rpm\*.rpm    # This my case

Directory of i:\RedHat\rpm

99-10-25  11:47       2048           0  conflictsindex.rpm
99-10-25  11:47      42496           0  fileindex.rpm
99-10-25  11:47       2048           0  groupindex.rpm
99-10-25  11:47       2048           0  nameindex.rpm
99-10-25  11:47     113480           0  packages.rpm
99-10-25  11:47       2048           0  providesindex.rpm
99-10-25  11:47       2048           0  requiredby.rpm
99-10-25  11:47       2048           0  triggerindex.rpm
        8 file(s)     168264 bytes used
                            34697728 bytes free
                            
     If you see an output like this, installation can be okay. 



Check installed rpm system @che
==========================

  If you installed this package properly, both RPM binary file,
`hello-1.0-1.i386-OS2.rpm', and RPM source fle, hello-1.0-1.src.rpm, should 
have been installed. These two files are for testing. 

  I assume these files are installed like this. 

       X:/emx/src/redhat/RPMS/i386/hello-1.0-1.i386-OS2.rpm
       X:/emx/src/redhat/SRPMS/hello-1.0-1.src.rpm

  If you have done custum installation, interprete ``X:/emx/src/redhat'' 
as rpm top directory of yours. 


Test 1: Querying

      > rpm -qip X:/emx/src/redhat/RPMS/i386/hello-1.0-1.i386-OS2.rpm
                                # ``-qip'' is equivalent to ``-p -i -p''
# begining of output

Name        : hello                        Relocations: /usr
Version     : 1.0                               Vendor: Red Hat Software
Release     : 1                             Build Date: Sun Oct 24 16:53:30
1999

Install date: (not installed)               Build Host: localhost
Group       : Utilities                     Source RPM: hello-1.0-1.src.rpm
Size        : 14069                            License: GPL
Packager    : Red Hat Software <bugs@redhat.com>
URL         : http://www.redhat.com
Summary     : hello -- hello, world rpm
Description :
Simple rpm demonstration.

# end of output

      > rpm -qip X:/emx/src/redhat/RPMS/i386/hello-1.0-1.i386-OS2.rpm
                                                      # Query package list
# begin

/emx/doc/hello-1.0
/emx/doc/hello-1.0/FAQ
/usr/local/bin/hello.exe

#end

   If you are not able to get these outputs, installation is not successful. 


Test 2: Install binary package

      > rpm -i X:/emx/src/redhat/RPMS/i386/hello-1.0-1.i386-OS2.rpm

   If an environment variable RPMDRV is 'c', files are installed like this. 

              c:/emx/doc/hello-1.0
              c:/emx/doc/hello-1.0/FAQ
              c:/usr/local/bin/hello.exe

IF you are ready to use emx/gcc system, do the next test, or step to the next
chapter. 


Test3: Make rpm package (NOTE: for this test you have emx/gcc )

   First of all, install source package for testing. 
   
      > rpm -i X:/emx/src/redhat/SRPMS/hello-1.0-1.src.rpm
   
   Confirm spec file and "tar + gzipped" source are installed. 

      > dir X:\emx\src\redhat\SPECS\hello*.*

        99-10-22   2:25        819           0  hello.spec
                1 file(s)        819 bytes used



      > dir X:\emx\src\redhat\SOURCES\hello*.*

        99-10-22   2:32      10240           0  hello-1.0.tar.gz
                1 file(s)      10240 bytes used


   Now, make binary and source package. 
   
   
      > rpm -ba X:/emx/src/redhat/SPECS/hello.spec
   Or  
      > rpm -ba X:/emx/src/redhat/SPECS/hello.spec 2>&1 | tee rpm.log
                                               # If you have `tee.exe'

    If successful, tail of an output read like this.
  
              Conflicts: goodbye
              Obsoletes: howdy
              Wrote: x:/emx/src/redhat/SRPMS/hello-1.0-1.src.rpm
              Wrote: x:/emx/src/redhat/RPMS/i386/hello-1.0-1.i386.rpm
              Executing: %clean
              + umask 022
              + cd x:/emx/src/RedHat/BUILD
              + cd hello-1.0
              + rm -rf /var/tmp/hello-root
              + exit 0
  
If some tests failed, read this manual again and recheck your installation. 



Mannuals    @doc
========

Documentations are in `emx\doc\rpm-3.0.6'. 

OS/2 specific docs are:
      README-rpm-3.0.6.os2
      CHANGES.os2
      PROBLEMES.os2
      EXAMPLE.os2
      TODO.os2

Linux HOWTOs
    RPM-HOWTO.gz       --- English HOWTO
    RPM-HOWTO-sjis.gz  --- Japanses SJIS HOWTO



Manpages    @man
========

Manpages are in `emx\man'
    rpm.8, rpm2cpio.8, popt.3

  Slovak, Polish, Russian, and Japanese manpage are in subdirectory, 
  sl, pl, ru, ja. 


  If you have not installed manpage system, you can get OS/2 ported copy 
from my web page: JSAWA=http://www2s.biglobe.ne.jp/~vtgf3mpr/

   `man' (requires GNU groff)
      JSAWA/linux/man.htm               ; v1.5g

   GNU groff v1.15 (with Japanization patch) 
     JSAWA/manpage/manpage-e.htm [English]
     JSAWA/manpage/manpage.htm  [Japanese]
          


Compile from source    @com
===================


Confirem that you have installed, GNU file utilities, GNU text utilities, 
GNU shell utilities, GNU sed, and GNU grep. 


To run shell script in `Makefile', `sh.exe' must be available. 
     You can get it from ftp sites:
        ftp.leo.org/pub/comp/os/os2/leo/shells/pdksh-5.2.13-emx.zip


   `patch.exe' and `install.exe' from OS/2 installation disketter or CDROM 
cannot be used to apply patch files or install files. You should delete 
these executables. 


    RPM source can be retrieved from ftp site. 

        ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-3.0.6.tar.gz
    ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-3.0.6-6x.src.rpm
           
                                           # Release number ``6x'' may not be
                                           # always valid

    Using ftp client, simplly get one of them. 

    You can install source rpm like this.

         x:/foo> rpm -i ftp://ftp.rpm.org/pub/rpm/dist/\ # Do not misunder-
                     rpm-3.0.x/rpm-3.0.6-6x.src.rpm      # stand line is
                                                         # braking

    If you `rpm-3.0.6-6x.src.rpm':
          
         x:/foo> rpm -i SOMEWHERE/rpm-3.0.6-6x.src.rpm
          
    If `rpm-3.0.6.tar.gz':
          
         x:/foo> copy SOMEWHERE/rpm-3.0.6.tar.gz X:\emx\src\redhat\SOURCES


Libraries and utilities that I used to compile RPM are as follows:

       Zlib library version 1.13
         XFree86 for OS/2 distribution contains this library, but
         for convenience I included headers and library in this package.

       Bzip2 version 0.9.d or later
           http://www.muraroa.demon.co.uk/
         I included OS/2 patch in this package:
               `emx\src\redhat\SOURCES\bzip2-1.0.0-OS2.diff.gz'
     
       GNU gettext 0.10.35 with Japanese Shift JIS availability
                http://www2s.biglobe.ne.jp/~vtgf3mpr/gnu/gettext.htm
           If you need only English message, you do not have to get 
           GNU gettext. 

       Multi-thread version "db.a" or "db.lib"
           I forgot the URL of "db_mt.zip" which contains db library 
         with GCC option "-Zmtd".
           So I included them in this package. 
                     \emx\src\redhat\SOURCES\db_mt.zip



0. Copy `exe.exe', `bz2_100.dll', and `rx_t20.dll' in SOURCES directory

  x:\> cp X:/emx/dll/bz2_100.dll X:/emx/dll/rx_t20.dll X:/emx/src/redhat/SOURCES/
  x:\> cp X:/emx/bin/exe.exe X:/emx/dll/rx_t20.dll X:/emx/src/redhat/SOURCES/


1. Uncompress source and apply a patch

       x:\> mkdir src
       x:\> cd src
       x:\src> tar zxvf SOMEWHERE/rpm-3.0.6.tar.gz
       x:\src> cd rpm-3.0.6
       x:\src\rpm-3.0.6> gzip -d < SOMEWHERE/rpm-3.0.6-OS2.diff.gz | patch -p1


2. run `configure' with `--prefix' and `--with-included-gettext'

       x:\src\rpm-3.0.6> configure --prefix=X:/emx --with-included-gettext

3. Compile and link

       x:\src\rpm-3.0.6> make 

4. Installation

       x:\src\rpm-3.0.6> make install
   Or
       x:\src\rpm-3.0.6> make install prefix=SOMEWHERE


6. Setup environmental variables and edit `~/.rpmmacros' 
   as described in earlier chapters. 
   
  


Make rpm package for rpm version 3.0.6    @mak
======================================

  Using OS/2 ported RPM, you can easily make binary or source RPM package. 

 
  Be sure that both `rpm-3.0.6.tar.gz' and `rpm-3.0.6-OS2.diff.gz' exists
in `SOURCES' directory, and `rpm-3.0.6-os2.spec' in SPECS directory.

        
  Do like this

        x:\foo> rpm -bb --clean X:/emx/src/redhat/SPECS/rpm-3.0.6-os2.spec


          Binary packages, `rpm-3.0.6-6x.i386-OS2.rpm' and 
         `rpm-devel-3.0.6-6x.i386-OS2.rpm'  will be created in 
         `X:/emx/src/redhat/RPMS/i386'. 

  To confirm newly created rpm packages are flawless, do some tests:

  Show information
     x:\foo> rpm -qip X:/emx/src/redhat/RPMS/i386/rpm-3.0.6-6x.i386-OS2.rpm
             
  List files
     x:\foo> rpm -qlp  X:/emx/src/redhat/RPMS/i386/rpm-3.0.6-6x.i386-OS2.rpm
          
  Install
     x:\foo> rpm -i  X:/emx/src/redhat/RPMS/i386/rpm-3.0.6-6x.i386-OS2.rpm



Appendix                @app
========

/emx/bin/unrpm.cmd  : Extact files from rpm package 
                      using `rpm.exe' and `cpio.exe'

     x:\foo> unrpm -e  X:/emx/src/redhat/RPMS/i386/rpm-3.0.6-6x.i386-OS2.rpm

  In this way, all files in `rpm-3.0.6-6x.i386-OS2.rpm' are extracted in 
  current directory with subdirectories. 

/emx/bin/os2conf.cmd : Sed script to modify `configure'


     x:\foo\src\bar> cp configure configure.orig
     x:\foo\src\bar> os2conf configure.orig > configure
     x:/foo/src/bar> sh configure 

  Almost always, modified `configure' will run successfully. 
  Prior to using `os2conf.cmd', you must modify it according to
  instruction described in it. 


/emx/doc/rpm-3.0.6/archiver.bb2.rpm
    If you use FM/2 (File Manager/2 by M. Kimes), add `archiver.bb2.rpm' 
    to your `archiver.bb2'. You will be able to see rpm, tar+gzip, 
    and tar+bzip2 package. 


/emx/doc/rpm-3.0.6/_eff.add  -- for ell ( a filer in VIO mode ) 
    Add this file to you `_eff' or '.eff'
           http://hp.vector.co.jp/authors/VA009797/warp/eff.html


/emx/doc/rpm-3.0.6/ell.add  -- for ell (archive viewer version 1.15) 
    Add this file to you `ell.cfg'
           http://hp.vector.co.jp/authors/VA009797/warp/ell.html


/emx/bin/exe.exe -- Yoh Shimizu's utility to run shell scripts

      When the first line of a script, FOO,  reads "#!BAR":

          x:/emx/bin> cp exe.exe FOO.exe

                        FOO maybe `sh', `perl', `sed'......

      Now you can run FOO.exe in shells like CMD.exe and YAOS.exe. 

/emx/bin/dllfind.cmd
      This script, using MIYATA's `ldd.exe',  shows DLLs except for 
    emx and OS/2 system related called by executables (*.exe, *.dll). 

           x:/foo> dllfind c:/emx/dll/rpm306.dll
               bz2_100.dll
               popt15.dll
               rpm306.dll
               z113.dll
               


Acknowledgment                       @ack
==============

    I thank Yoh Shimizu for his splended utility `exe.exe', which enables
  us to run shell script easily. 

    `find-requires' script improved using `ldd.exe', thanks to
                 Shigeru MIYATA <miyata@kusm.kyoto-u.ac.jp>



               http://www2.tky.threewebnet.or.jp/~yoh/os2/os2.html [Japanese]




That' all. 




                                             SAWATAISHI JUN, YOKOHAMA JAPAN
                                                       <jsawa@attblobal.net>
                           http://www2s.biglobe.ne.jp/~vtgf3mpr/indxos2.htm


/*----- end of document --------------------------------------------------*/

