OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Michael Schloh
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   21-Apr-2005 18:34:51
  Branch: HEAD                             Handle: 2005042117345100

  Modified files:
    openpkg-src/j2ee        j2ee.spec j2ee.state rc.j2ee

  Log:
    use independent JDK_HOME and JAVA_HOME variables, install more
    reliably by customizing unpacking and setup execution,
    unconditionarlly require infozip due to unpacking customization,
    simplify samples installation logic, disable TCP port testing, disable
    out of OpenPKG bounds product registry tracking, correct hardcoded
    pathnames in config files, always unpack quietly, activate postinstall
    logic, mark config files in RPM database, and add preliminary (not
    useful yet) runcommand framework

  Summary:
    Revision    Changes     Path
    1.28        +65 -63     openpkg-src/j2ee/j2ee.spec
    1.2         +2  -2      openpkg-src/j2ee/j2ee.state
    1.8         +37 -0      openpkg-src/j2ee/rc.j2ee
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/j2ee/j2ee.spec
  ============================================================================
  $ cvs diff -u -r1.27 -r1.28 j2ee.spec
  --- openpkg-src/j2ee/j2ee.spec        19 Apr 2005 19:50:31 -0000      1.27
  +++ openpkg-src/j2ee/j2ee.spec        21 Apr 2005 16:34:51 -0000      1.28
  @@ -40,7 +40,7 @@
   Group:        Language
   License:      Commercial
   Version:      %{V_openpkg}
  -Release:      20050419
  +Release:      20050421
   
   #   package options
   %option       with_docs     no
  @@ -63,11 +63,8 @@
   #   build information
   Prefix:       %{l_prefix}
   BuildRoot:    %{l_buildroot}
  -BuildPreReq:  OpenPKG, openpkg >= 20040122, j2se >= 1.4.2.04
  +BuildPreReq:  OpenPKG, openpkg >= 20040122, j2se >= 1.4.2.04, infozip
   PreReq:       OpenPKG, openpkg >= 20040122, j2se >= 1.4.2.04
  -%if "%{with_docs}" == "yes" || "%{with_samples}" == "yes"
  -BuildPreReq:  infozip
  -%endif
   AutoReq:      no
   AutoReqProv:  no
   
  @@ -107,24 +104,21 @@
           $RPM_BUILD_ROOT%{l_prefix}/libexec
   
       #   hack to correctly set JAVA_HOME variable
  -    JAVA_HOME=%{l_prefix}/libexec/j2se/jdk*
  +    JDK_HOME=%{l_prefix}/libexec/j2se
  +    JAVA_HOME=${JDK_HOME}/jre
   
       #   prepare state file for installation binary
   %if "%{with_samples}" == "yes"
  -    %{l_shtool} install -c %{l_value -s -a} \
  -        -e 's;@rpmbldroot@;%{l_buildroot};g' \
  -        -e 's;@sampdomain@;TRUE;g' \
  -        -e "s;@jdkhome@;`echo $JAVA_HOME`;g" \
  -        %{SOURCE j2ee.state} \
  -        $RPM_BUILD_ROOT
  +    sampvar=TRUE
   %else
  +    sampvar=FALSE
  +%endif
       %{l_shtool} install -c %{l_value -s -a} \
           -e 's;@rpmbldroot@;%{l_buildroot};g' \
  -        -e 's;@sampdomain@;FALSE;g' \
  -        -e "s;@jdkhome@;`echo $JAVA_HOME`;g" \
  +        -e "s;@sampdomain@;$sampvar;g" \
  +        -e "s;@jdkhome@;`echo $JDK_HOME`;g" \
           %{SOURCE j2ee.state} \
           $RPM_BUILD_ROOT
  -%endif
   
       #   unpack vendor distribution
       ( umask 022
  @@ -134,51 +128,31 @@
                 %{l_shtool} subst \
                     -e 
's;@platformid@;97c6adba9d2ee77580fdce6054fcd1c29a83bdc7;g' \
                     $RPM_BUILD_ROOT/j2ee.state
  -              ( %{SOURCE sjsas_pe-%{V_sunjava}-linux.bin} \
  -                    -javahome $JAVA_HOME \
  -                    -silent $RPM_BUILD_ROOT/j2ee.state
  -                true
  -              ) || exit $?
  +              unzip -q %{SOURCE sjsas_pe-%{V_sunjava}-linux.bin}
                 ;;
             i686-linux2* )
                 %{l_shtool} subst \
  -                  -e 
's;@platformid@;97c6adba9d2ee77580fdce6054fcd1c29a83bdc7;g' \
  +                  -e 
's;@platformid@;1c3c0bd104d5002ac9ba16804406ada0ee89ef5f;g' \
                     $RPM_BUILD_ROOT/j2ee.state
  -              ( %{SOURCE sjsas_pe-%{V_sunjava}-linux.bin} \
  -                    -javahome $JAVA_HOME \
  -                    -silent $RPM_BUILD_ROOT/j2ee.state
  -                true
  -              ) || exit $?
  +              unzip -q %{SOURCE sjsas_pe-%{V_sunjava}-linux.bin}
                 ;;
             ix86-sunos5.10 )
                 %{l_shtool} subst \
                     -e 
's;@platformid@;dc9c042e66c9d5463a4c8bf3cddc1c8bcad58388;g' \
                     $RPM_BUILD_ROOT/j2ee.state
  -              ( %{SOURCE sjsas_pe-%{V_sunjava}-solaris-i586.bin} \
  -                    -javahome $JAVA_HOME \
  -                    -silent $RPM_BUILD_ROOT/j2ee.state
  -                true
  -              ) || exit $?
  +              unzip -q %{SOURCE sjsas_pe-%{V_sunjava}-solaris-i586.bin}
                 ;;
             ix86-sunos5* )
                 %{l_shtool} subst \
                     -e 
's;@platformid@;7ea13f093e17c85d0fb7b90f78c1cb2718158ddc;g' \
                     $RPM_BUILD_ROOT/j2ee.state
  -              ( %{SOURCE sjsas_pe-%{V_sunjava}-solaris-i586.bin} \
  -                    -javahome $JAVA_HOME \
  -                    -silent $RPM_BUILD_ROOT/j2ee.state
  -                true
  -              ) || exit $?
  +              unzip -q %{SOURCE sjsas_pe-%{V_sunjava}-solaris-i586.bin}
                 ;;
             sun4u-sunos5* )
                 %{l_shtool} subst \
                     -e 
's;@platformid@;ba2d03febe84d6f4e6332aadb38428d50573b5cc;g' \
                     $RPM_BUILD_ROOT/j2ee.state
  -              ( %{SOURCE sjsas_pe-%{V_sunjava}-solaris-sparc.bin} \
  -                    -javahome $JAVA_HOME \
  -                    -silent $RPM_BUILD_ROOT/j2ee.state
  -                true
  -              ) || exit $?
  +              unzip -q %{SOURCE sjsas_pe-%{V_sunjava}-solaris-sparc.bin}
                 ;;
   
             * )
  @@ -189,30 +163,58 @@
                 exit 1
                 ;;
         esac
  +      if [ -f /var/tmp/productregistry ]; then
  +          cp -p /var/tmp/productregistry ./prdrgvartmp
  +      fi
  +      if [ -f /var/sadm/install/productregistry ]; then
  +          cp -p /var/sadm/install/productregistry ./prdrgvarsdm
  +      fi
  +      chmod +x setup
  +      ./setup -noportcheck \
  +          -javahome $JAVA_HOME \
  +          -silent $RPM_BUILD_ROOT/j2ee.state
  +      if [ -f ./prdrgvartmp ]; then
  +          cp ./prdrgvartmp /var/tmp/productregistry
  +      elif [ -f /var/tmp/productregistry ]; then
  +          rm /var/tmp/productregistry
  +      fi
  +      if [ -f ./prdrgvarsdm ]; then
  +          cp ./prdrgvarsdm /var/sadm/install/productregistry
  +      elif [ -f /var/sadm/install/productregistry ]; then
  +          rm /var/sadm/install/productregistry
  +      fi
       ) || exit $?
   
       #   remove leftover installation state file
       rm -f $RPM_BUILD_ROOT/j2ee.state
   
  -    #   activate binaries
  +    #   activate and correct hardcoded configure paths in binaries
       ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
         for bin in appclient asadmin asant asupgrade capture-schema deploytool 
\
  -          jspc package-appclient uninstall verifier wscompile wsdeploy; do
  -          ln -s ../libexec/j2ee/bin/$bin .
  +                 jspc package-appclient uninstall verifier wscompile 
wsdeploy; do
  +          ln -s %{l_prefix}/libexec/j2ee/bin/$bin .
  +          %{l_shtool} subst -e "s;$RPM_BUILD_ROOT;;" \
  +              $RPM_BUILD_ROOT%{l_prefix}/libexec/j2ee/bin/$bin
         done
       ) || exit $?
   
  +    #   correct hardcoded configure paths in config file
  +    %{l_shtool} subst \
  +        -e "s;$RPM_BUILD_ROOT;;" \
  +        -e "s;\(AS_PERL=\"\).*$;\1%{l_prefix}/bin/perl/nodependency\";" \
  +        $RPM_BUILD_ROOT%{l_prefix}/libexec/j2ee/config/asenv.conf
  +
       #   conditionally install apidocs
   %if "%{with_docs}" == "yes"
       ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/j2ee
  -      unzip %{SOURCE j2eeri-%{V_sundocs}-doc-api.zip}
  +      unzip -q %{SOURCE j2eeri-%{V_sundocs}-doc-api.zip}
       ) || exit $?
   %endif
   
       #   conditionally install samples
   %if "%{with_samples}" == "yes"
       ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/j2ee
  -      unzip %{SOURCE j2eesdk-%{V_sunsamp}-samples.zip}
  +      unzip -q %{SOURCE j2eesdk-%{V_sunsamp}-samples.zip}
       ) || exit $?
   %endif
   
  @@ -220,7 +222,9 @@
       %{l_shtool} install -c -m 755 %{l_value -s -a} \
           %{SOURCE rc.j2ee} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   
  -    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  +        '%config %{l_prefix}/libexec/j2ee/config/*' \
  +        '%config %{l_prefix}/libexec/j2ee/domains/domain1/config/*'
   
   %files -f files
   
  @@ -229,24 +233,22 @@
   
   %post
       if [ $1 -eq 1 ]; then
  -        # FIXME MSvB: #   display final hints on initial installation
  -        # FIXME MSvB: ( echo "Next Steps:"
  -        # FIXME MSvB:   echo "  1. Access the About Application Server PE 8 
welcome page at:"
  -        # FIXME MSvB:   echo "     
file:///home/<username>/SUNWappserver/docs/about.html"
  -        # FIXME MSvB:   echo ""
  -        # FIXME MSvB:   echo "  2. Start the Application Server by 
executing:"
  -        # FIXME MSvB:   echo "     
/home/<username>/SUNWappserver/bin/asadmin start-domain domain1"
  -        # FIXME MSvB:   echo ""
  -        # FIXME MSvB:   echo "  3. Start the Admin Console:"
  -        # FIXME MSvB:   echo "     http://localhost:4848";
  -        # FIXME MSvB: ) | %{l_rpmtool} msg -b -t notice
  +        #   display final hints on initial installation
  +        ( echo "Next Steps:"
  +          echo "  1. Read the Application Server welcome page at:"
  +          echo "     file://$RPM_INSTALL_PREFIX/libexec/j2ee/docs/about.html"
  +          echo ""
  +          echo "  2. Start the Application Server by executing:"
  +          echo "     $RPM_INSTALL_PREFIX/bin/asadmin start-domain domain1"
  +          echo ""
  +          echo "  3. Configure the Admin Console at:"
  +          echo "     http://localhost:4848";
  +        ) | %{l_rpmtool} msg -b -t notice
       fi
  -%if "%{with_samples}" == "yes"
       if [ $1 -eq 2 ]; then
  -        # FIXME MSvB: #   after upgrade, restart service
  -        # FIXME MSvB: eval `%{l_rc} j2ee status 2>/dev/null`
  -        # FIXME MSvB: [ ".$j2ee_active" = .yes ] && %{l_rc} j2ee restart
  +        #   after upgrade, restart service
  +        eval `%{l_rc} j2ee status 2>/dev/null`
  +        [ ".$j2ee_active" = .yes ] && %{l_rc} j2ee restart
       fi
  -%endif
       exit 0
   
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/j2ee/j2ee.state
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 j2ee.state
  --- openpkg-src/j2ee/j2ee.state       19 Apr 2005 17:24:46 -0000      1.1
  +++ openpkg-src/j2ee/j2ee.state       21 Apr 2005 16:34:51 -0000      1.2
  @@ -8,11 +8,11 @@
   #
   #
   [STATE_BEGIN Sun Java System Application Server @[EMAIL PROTECTED]
  -defaultInstallDirectory = /home/user/SUNWappserver
  +defaultInstallDirectory = @rpmbldroot@@l_prefix@/libexec/j2ee
   currentInstallDirectory = @rpmbldroot@@l_prefix@/libexec/j2ee
   JDK_LOCATION = @jdkhome@
   INST_ASADMIN_USERNAME = admin
  -INST_ASADMIN_PASSWORD = cgavudbjiddgldmgfiikjbeuqmnnffjbeq
  +INST_ASADMIN_PASSWORD = bibrntuopjrttkrwybdmreusctcracxtnqzva
   INST_MASTER_PASSWORD = pfqvycktptyscxdrshenunatrvg
   INST_ASADMIN_PORT = 4848
   INST_ASWEB_PORT = 8080
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/j2ee/rc.j2ee
  ============================================================================
  $ cvs diff -u -r1.7 -r1.8 rc.j2ee
  --- openpkg-src/j2ee/rc.j2ee  19 Apr 2005 17:24:46 -0000      1.7
  +++ openpkg-src/j2ee/rc.j2ee  21 Apr 2005 16:34:51 -0000      1.8
  @@ -7,6 +7,43 @@
       j2ee_enable="$openpkg_rc_def"
       j2ee_home="@l_prefix@/libexec/j2ee"
   
  +%status -u @l_susr@ -o
  +    j2ee_usable="unknown"
  +    j2ee_active="no"
  +    false >/dev/null 2>&1 && j2ee_usable="yes"
  +    false >/dev/null 2>&1 || j2ee_active="yes"
  +    echo "j2ee_enable=\"$j2ee_enable\""
  +    echo "j2ee_usable=\"$j2ee_usable\""
  +    echo "j2ee_active=\"$j2ee_active\""
  +
  +%start -u @l_susr@
  +    rcService j2ee enable yes || exit 0
  +    rcService j2ee active yes && exit 0
  +    @l_prefix@/libexec/j2ee start
  +
  +%stop -u @l_susr@
  +    rcService j2ee enable yes || exit 0
  +    rcService j2ee active no  && exit 0
  +    @l_prefix@/libexec/j2ee stop
  +    sleep 2
  +
  +%restart -u @l_susr@
  +    rcService j2ee enable yes || exit 0
  +    rcService j2ee active no  && exit 0
  +    @l_prefix@/libexec/j2ee restart
  +
  +%reload -u @l_susr@
  +    rcService j2ee enable yes || exit 0
  +    rcService j2ee active no  && exit 0
  +    @l_prefix@/libexec/j2ee reload
  +
  +%daily -u @l_susr@
  +    rcService j2ee enable yes || exit 0
  +    shtool rotate -f \
  +        -n ${j2ee_log_numfiles} -s 0 \
  +        -z ${j2ee_log_complevel} -m 644 -o @l_musr@ -g @l_mgrp@ \
  +        @l_prefix@/var/j2ee/j2ee.log
  +
   %env
       rcService j2ee enable yes || exit 0
       J2EE_HOME="$j2ee_home"
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to