Current 1.0: success on Solaris 8..

Vincent Cojot <[email protected]>
Newsgroups gmane.network.up2date.current.devel
Message-ID <[email protected]>
Hello everyone,

	It took me more time that I would have liked but I am happy to
report that I have a current server working fine from a Solaris 8 (sparc)
server.. In my case, the server which used to collect all of the Redhat
updates is a SUN server with their NFS implementation.. Therefore, the
idea was to try to figure out if it would be possible to run a current
server on that box.. The most difficult task was clearly to get all of
current's software requirements to function properly on Solaris 8 (to name
some of them: python (with bsddb), rpm, db-3.1, etc..).

Only problems that I encountered are:

1) In current.init, the invocation of stunnel is wrong (I think):
        daemon stunnel -d $CURRENT_HTTPS_PORT \
                       -r $CURRENT_HTTP_PORT \
                       -p $CURRENT_KEY_FILE \
                       -P /var/run/stunnel.pid

Should be:
        daemon stunnel -d $CURRENT_HTTPS_PORT \
                       -r $CURRENT_HTTP_PORT \
                       -p $CURRENT_KEY_FILE \
                       -P /var/run/

This gives me a pid file named: /var/run/stunnel.8080.pid

2) Perhaps a Python-2.2 vs. current-1.0 problem but rebuilding a DB has a
minor display glitch:

Mar %2m 13:12:48 Adding kernel-enterprise-2.2.19-6.2.12.sparc64.rpm
Mar %2m 13:12:48 Removing kernel-enterprise-2.2.19-6.2.15.sparc.rpm
Mar %2m 13:12:49 Adding kernel-smp-2.2.19-6.2.12.sparc64.rpm
    ^
    \---(see "Mar %2m" instead of "Mar 17"...)

Whole procedure In short:

1) db-3.1.  BerkeleyDB.3.1 compiled fine on this box and I accepted the
default of installing under /usr/local/BerkeleyDB.3.1/{lib,include}.

Build script:
root@ergoth:[/usr/local/src ]cat db-3.1.17/build_unix/go.sh
#!/bin/csh
# Solaris 8 : SUN compiled gcc (/opt/sfw)
setenv CFLAGS "-pipe -O3"
setenv CC /opt/sfw/bin/gcc
setenv CXX /opt/sfw/bin/g++
#../dist/configure --prefix=/usr/local --enable-cxx --enable-dynamic \
../dist/configure --enable-cxx --enable-dynamic \
        --enable-static --enable-shared --enable-compat185

2) Python. I had to use python-2.2 in order to get the bsddb module to
build correctly (I will report to the python lists later on). And even
then, the module wouldn't import correctly. I had to link it manually. The
problem mostly came from the Modules build that python does once the
engine is built.. That Modules build discarded my CFLAGS and LDFLAGS..
Since I didn't want to mess with the Python setup.py and Makefile.pre.in
files, I had to compile and link manually the bsddb module.

Build script:
#!/bin/csh
# Solaris 8 : SUN compiled gcc (/opt/sfw)
setenv CFLAGS "-pipe -O3"
setenv CC /opt/sfw/bin/gcc
setenv CXX /opt/sfw/bin/g++
setenv PATH /usr/local/BerkeleyDB.3.1/bin:${PATH}
setenv CFLAGS '-I/usr/local/BerkeleyDB.3.1/include'
setenv CPPFLAGS '-I/usr/local/BerkeleyDB.3.1/include'
setenv LIBS '-L/usr/local/BerkeleyDB.3.1/lib'
setenv LDFLAGS '-L/usr/local/BerkeleyDB.3.1/lib'
setenv BASEMODLIBS '-L/usr/local/BerkeleyDB.3.1/lib'
./configure --prefix=/usr/local --enable-ipv6

3) RPM. Having not much success with rpm-4.0.2, I decided to use
rpm-4.0.4. Even with the "--with-python" argument, the build process
decided not to build the Python module (poptmodule* and rpmmodule*). As
with python, instead of fixing configure.in (because I didn't have enough
time), I built that manually. Also, I had to fix
rpm-4.0.4/lib/signature.c:

root@ergoth:[/usr/local/src/rpm-4.0.4/lib ]/usr/local/bin/diff -c
signature.c.orig signature.c
*** signature.c.orig    Sat Feb  2 21:55:49 2002
--- signature.c Fri Mar 15 20:07:36 2002
***************
*** 23,28 ****
--- 23,32 ----
  #include "signature.h"
  #include "debug.h"

+ #ifndef HAVE_ENVIRON_DECL
+ extern char **environ;
+ #endif
+
  /*@access Header@*/           /* XXX compared with NULL */
  /*@access FD_t@*/             /* XXX compared with NULL */

Build script:
#!/bin/csh
# Solaris 8 : SUN compiled gcc (/opt/sfw)
setenv CFLAGS "-pipe -O3"
setenv CC /opt/sfw/bin/gcc
setenv CXX /opt/sfw/bin/g++
setenv CPPFLAGS '-I/usr/local/include/python2.2'
./configure --prefix=/usr/local --with-included-gettext --with-python \
--disable-nls

4) popt-1.6.4:
Nothing to report, Build script:
#!/bin/csh
# Solaris 8 : SUN compiled gcc (/opt/sfw)
setenv CFLAGS "-pipe -O3"
setenv CC /opt/sfw/bin/gcc
setenv CXX /opt/sfw/bin/g++
setenv PATH /usr/local/bin:${PATH}
./configure --prefix=/usr/local --disable-nls --with-included-gettext

5) stunnel-3.22:
Nothing to report, Build script:
#!/bin/csh
# Solaris 8 : SUN compiled gcc (/opt/sfw)
setenv CFLAGS "-pipe -O3"
setenv CC /opt/sfw/bin/gcc
setenv CXX /opt/sfw/bin/g++
./configure --prefix=/usr/local

(I already had openssl under /usr/local/include/ssl and
/usr/local/lib/libcryp*). For reference, build script for openssl:

#!/bin/csh
# Solaris 8 : SUN compiled gcc (/opt/sfw)
setenv CFLAGS "-pipe -O3"
setenv CC /opt/sfw/bin/gcc
setenv CXX /opt/sfw/bin/g++
./Configure solaris-sparcv8-gcc shared=solaris-shared --prefix=/usr/local \
        --openssldir=/usr/local/ssl

6) Current-1.0:
Nothing to report:
gmake, gmake install

I just patched sucessfully a RedHat-6.2 (sparc64) machine from my Solaris8
(sparc) server.. Here is the startup script I used (taken from current,
adapted to Solaris 8).

root@ergoth:[/usr/local/src/current-1.0 ]cat /etc/init.d/current
------------------------------ cut here --------------------------------
#!/bin/bash
#
# current:     Starts the up2date server Current
#
# Author:      Hunter Matthews
#
# chkconfig: - 02 96
# description: Current is an open source server for Red Hat up2date clients.
# config: /etc/current/current.conf

# Grab the port numbers and pem file location from the current.conf file
# CURRENT_HTTP_PORT, CURRENT_HTTPS_PORT, CURRENT_KEY_FILE
#eval $(cadmin initconfig)
export CURRENT_HTTP_PORT=8080
export CURRENT_HTTPS_PORT=8081
export CURRENT_KEY_FILE=/etc/current/current.pem

start() {
    # FIXME: We should start this as current_stunnel or some such, otherwise
    # we can't stop _just_ stunnel - we'll kill them all.

    echo -n "Starting Current(stunnel): "
        /usr/local/sbin/stunnel -d $CURRENT_HTTPS_PORT \
                       -r $CURRENT_HTTP_PORT \
                       -p $CURRENT_KEY_FILE \
                       -P /var/run/
        echo -n "Starting Current(daemon): "
        /usr/local/sbin/current
}

stop() {
        echo -n "Stopping Current(stunnel): "
        /bin/pkill -f /usr/local/sbin/stunnel
        echo -n "Stopping Current(daemon): "
        /bin/pkill -f /usr/local/sbin/current
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac
------------------------------ cut here --------------------------------

I hope it helps others who can't run "current" under Linux alone..

,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,
Vincent S. Cojot, Computer Engineering. STEP project. _.,-*~'`^`'~*-,._.,-*~
Ecole Polytechnique de Montreal, Comite Micro-Informatique. _.,-*~'`^`'~*-,.
Linux Xview/OpenLook resources page _.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'
http://step.polymtl.ca/~coyote  _.,-*~'`^`'~*-,._ [email protected]

They cannot scare me with their empty spaces
Between stars - on stars where no human race is
I have it in me so much nearer home
To scare myself with my own desert places.       - Robert Frost
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.