diff options
author | 2007-01-28 17:28:47 +0000 | |
---|---|---|
committer | 2007-01-28 17:28:47 +0000 | |
commit | 67182eb02186b9f4169eda403b7314a74b12798e (patch) | |
tree | 79d90b7ef59aaf86a8285fffef87fcb9e99925a9 | |
download | dertobi123-67182eb02186b9f4169eda403b7314a74b12798e.tar.gz dertobi123-67182eb02186b9f4169eda403b7314a74b12798e.tar.bz2 dertobi123-67182eb02186b9f4169eda403b7314a74b12798e.zip |
oracle-xe import
svn path=/; revision=1
-rw-r--r-- | dev-db/oracle-xe/Manifest | 21 | ||||
-rw-r--r-- | dev-db/oracle-xe/files/99oracle | 13 | ||||
-rw-r--r-- | dev-db/oracle-xe/files/digest-oracle-xe-10.2.0.1_p1 | 6 | ||||
-rw-r--r-- | dev-db/oracle-xe/files/oracle-xe | 63 | ||||
-rw-r--r-- | dev-db/oracle-xe/files/oracle_configure.sh | 329 | ||||
-rw-r--r-- | dev-db/oracle-xe/oracle-xe-10.2.0.1_p1.ebuild | 182 |
6 files changed, 614 insertions, 0 deletions
diff --git a/dev-db/oracle-xe/Manifest b/dev-db/oracle-xe/Manifest new file mode 100644 index 0000000..8e82d44 --- /dev/null +++ b/dev-db/oracle-xe/Manifest @@ -0,0 +1,21 @@ +AUX 99oracle 431 RMD160 ee662c2b97aa5794ff013917008abe49f2c4e63f SHA1 ddb11bc93113feb080cc3920340ac3b5417f29a5 SHA256 53a8c7a76a605289aef9d68df0857c3aaef624fcecffe92742352af67511eb38 +MD5 389e0b43f3dad8f1d62886581c05e171 files/99oracle 431 +RMD160 ee662c2b97aa5794ff013917008abe49f2c4e63f files/99oracle 431 +SHA256 53a8c7a76a605289aef9d68df0857c3aaef624fcecffe92742352af67511eb38 files/99oracle 431 +AUX oracle-xe 1784 RMD160 1750f63e414161c8b95ffb54b25e867a5f469208 SHA1 93ce19f3c728a6b31bf1abd7bf57b816f2f85854 SHA256 2ae0562e9fade07e8ec369ca3b25a9a425c16a11ebcf75793d50aa8b33cb7df2 +MD5 a44e9840fe55943f6cff44e3864d8d84 files/oracle-xe 1784 +RMD160 1750f63e414161c8b95ffb54b25e867a5f469208 files/oracle-xe 1784 +SHA256 2ae0562e9fade07e8ec369ca3b25a9a425c16a11ebcf75793d50aa8b33cb7df2 files/oracle-xe 1784 +AUX oracle_configure.sh 9023 RMD160 510a6df02cae5e9c1c662f6bb3eade0847ae7357 SHA1 5e1c56b433d46a8446ce9499abbfb0ee56b8ff84 SHA256 31d0b7894d6139d821fe2dda515cfec79f2555832b3644514ff8e2f64ec288eb +MD5 b401cb5c804cfa742646b5baeb3df8ad files/oracle_configure.sh 9023 +RMD160 510a6df02cae5e9c1c662f6bb3eade0847ae7357 files/oracle_configure.sh 9023 +SHA256 31d0b7894d6139d821fe2dda515cfec79f2555832b3644514ff8e2f64ec288eb files/oracle_configure.sh 9023 +DIST oracle-xe-10.2.0.1-1.0.i386.rpm 221136869 RMD160 9e3367f6252f2187bb492b60a5912b2ab1283b17 SHA1 6882c294912f0bb9d1f24faa06a400c6d42ad5e4 SHA256 dced0ac834281725ed3895a4fa246b8926b982adb3780a84a99b3da299174bfb +DIST oracle-xe-univ-10.2.0.1-1.0.i386.rpm 262909363 RMD160 6124d0233aa3dc11d17094304e8ddd7dd52e87d8 SHA1 c4854b6b56e3d71d7977b446c7138d06954f58e4 SHA256 dcea6c12f1bf241925b80d8497b5907ac2999034f2efb4eb083f594928ea4e44 +EBUILD oracle-xe-10.2.0.1_p1.ebuild 4481 RMD160 8f058be089488f4b3c58c02f830343162e61c14b SHA1 7b0f9b5d9d1e1d4567a6e53dbb0f197286ebf3c6 SHA256 aedaeae233144cdaa6ea9c537e0faa45c8a97e2561a2845fc5795ccdb4e50281 +MD5 d43c5a61d8ca7f20456f279e03ee5fc5 oracle-xe-10.2.0.1_p1.ebuild 4481 +RMD160 8f058be089488f4b3c58c02f830343162e61c14b oracle-xe-10.2.0.1_p1.ebuild 4481 +SHA256 aedaeae233144cdaa6ea9c537e0faa45c8a97e2561a2845fc5795ccdb4e50281 oracle-xe-10.2.0.1_p1.ebuild 4481 +MD5 897763409d34aea1d377f216f4c0db39 files/digest-oracle-xe-10.2.0.1_p1 581 +RMD160 b200aba9f24ba4b9551de2d027bf876c755996d5 files/digest-oracle-xe-10.2.0.1_p1 581 +SHA256 2ff9c1add6cfc1e9ddc1a173897520e924debe7778f2eb7d1cc31f3e4993e006 files/digest-oracle-xe-10.2.0.1_p1 581 diff --git a/dev-db/oracle-xe/files/99oracle b/dev-db/oracle-xe/files/99oracle new file mode 100644 index 0000000..99aa9a6 --- /dev/null +++ b/dev-db/oracle-xe/files/99oracle @@ -0,0 +1,13 @@ +ORACLE_BASE=/usr/lib/oracle +ORACLE_HOME=%ORACLE_HOME% +ORACLE_SID='%ORACLE_SID%' +ORACLE_OWNER=%ORACLE_OWNER% +TNS_ADMIN=$ORACLE_HOME/network/admin +NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 +ORA_NLS10=$ORACLE_HOME/nls/data +CLASSPATH=$ORACLE_HOME/jdbc/lib/classes12.zip +LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32 +DISABLE_HUGETLBFS=1 +PATH=$PATH:$ORACLE_HOME/bin +ROOTPATH=$ORACLE_HOME/bin +LDPATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32 diff --git a/dev-db/oracle-xe/files/digest-oracle-xe-10.2.0.1_p1 b/dev-db/oracle-xe/files/digest-oracle-xe-10.2.0.1_p1 new file mode 100644 index 0000000..3d86234 --- /dev/null +++ b/dev-db/oracle-xe/files/digest-oracle-xe-10.2.0.1_p1 @@ -0,0 +1,6 @@ +MD5 707641df1e51320607ba9b0a7b19fb3d oracle-xe-10.2.0.1-1.0.i386.rpm 221136869 +RMD160 9e3367f6252f2187bb492b60a5912b2ab1283b17 oracle-xe-10.2.0.1-1.0.i386.rpm 221136869 +SHA256 dced0ac834281725ed3895a4fa246b8926b982adb3780a84a99b3da299174bfb oracle-xe-10.2.0.1-1.0.i386.rpm 221136869 +MD5 627c23c942c62ea9ec7894b6816aec94 oracle-xe-univ-10.2.0.1-1.0.i386.rpm 262909363 +RMD160 6124d0233aa3dc11d17094304e8ddd7dd52e87d8 oracle-xe-univ-10.2.0.1-1.0.i386.rpm 262909363 +SHA256 dcea6c12f1bf241925b80d8497b5907ac2999034f2efb4eb083f594928ea4e44 oracle-xe-univ-10.2.0.1-1.0.i386.rpm 262909363 diff --git a/dev-db/oracle-xe/files/oracle-xe b/dev-db/oracle-xe/files/oracle-xe new file mode 100644 index 0000000..84d27db --- /dev/null +++ b/dev-db/oracle-xe/files/oracle-xe @@ -0,0 +1,63 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 + +SU=/bin/su +ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server +ORACLE_OWNER=oraclexe +ORACLE_SID=XE +export ORACLE_HOME +export ORACLE_SID +export PATH=$ORACLE_HOME/bin:$PATH +LOG="$ORACLE_HOME_LISTNER/listener.log" + +export LC_ALL=C + +depend() { + need net +} + +checkconfig() { + if [ ! -f /etc/conf.d/oracle-xe ] ; then + eerror "You need to configure Oracle Database 10g Express Edition before" + eerror "you can start it." + eerror "Run $ORACLE_HOME/bin/oracle_configure.sh first" + return 1 + fi + + if [ "$CONFIGURE_RUN" != "true" ] ; then + eerror "You need to configure Oracle Database 10g Express Edition before" + eerror "you can start it." + eerror "Run $ORACLE_HOME/bin/oracle_configure.sh first" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting Oracle Net Listener." + status=`ps -ef | grep tns | grep oraclexe` + if [ "$status" == "" ] + then + if [ -f $ORACLE_HOME/bin/tnslsnr ] + then + $SU $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" > /dev/null 2>&1 + fi + fi + ebegin "Starting Oracle Database 10g Express Edition Instance." + $SU $ORACLE_OWNER -c "$ORACLE_HOME/bin/sqlplus -s /nolog @$ORACLE_HOME/config/scripts/startdb.sql" > /dev/null 2>&1 + eend $? +} + +stop() { + ebegin "Shutting down Oracle Database 10g Express Edition Instance." + $SU $ORACLE_OWNER -c "$ORACLE_HOME/bin/sqlplus -s /nolog @$ORACLE_HOME/config/scripts/stopdb.sql" > /dev/null 2>&1 + ebegin "Stopping Oracle Net Listener." + $SU $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop" > /dev/null 2>&1 + RETVAL=$? + if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$ORACLE_HOME/bin/sqlplus + then + return $RETVAL + fi + return $RETVAL +} diff --git a/dev-db/oracle-xe/files/oracle_configure.sh b/dev-db/oracle-xe/files/oracle_configure.sh new file mode 100644 index 0000000..c246036 --- /dev/null +++ b/dev-db/oracle-xe/files/oracle_configure.sh @@ -0,0 +1,329 @@ +#!/bin/bash +# +# +# chkconfig: 2345 80 05 +# description: This is a program that is responsible for taking care of +# configuring the Oracle Database 10g Express Edition and its associated +# services. +# +# processname: oracle-xe +# config: /etc/conf.d/oracle-xe +# +# change log: +# svaggu - creation 28-Sep-2005 + +ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server +ORACLE_OWNER=oraclexe +ORACLE_GROUP=dba +ORACLE_SID=XE +LSNR=$ORACLE_HOME/bin/lsnrctl +SQLPLUS=$ORACLE_HOME/bin/sqlplus +SU=/bin/su +export ORACLE_HOME +export ORACLE_SID +export ORACLE_OWNER +export ORACLE_GROUP +export PATH=$ORACLE_HOME/bin:$PATH +LOG="$ORACLE_HOME_LISTNER/listener.log" + +export LC_ALL=C + +if [ $(id -u) != "0" ] +then + echo "You must be root to run the configure script. Login as root and then run the +configure script." + exit 1 +fi + +# +# write_sysconfig() +# +# Writes the system configuration +# +write_sysconfig() +{ + cat >/etc/conf.d/oracle-xe <<EOF + +#This is a configuration file for automatic starting of the Oracle +#Database and listener at system startup.It is generated By running +#'/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_configure.sh' +#Please use that method to modify this file + +# LISTENER_PORT: +LISTENER_PORT=${LISTENER_PORT} + +# HTTP_PORT +HTTP_PORT=${HTTP_PORT} + +#Configuration +CONFIGURE_RUN=${CONFIGURE_RUN} + +EOF + + if [ $? != 0 ] + then + return 1 + fi + return 0 +} + +# configure_perform() +# +# Instantantiate listener.ora,tnsnames.ora,and create the database, +# sets the password,start the listener,and adds database to inittab +# if necessary + +configure_perform() +{ + sed -i "s/%hostname%/`hostname`/g" $ORACLE_HOME/network/admin/listener.ora + sed -i "s/%port%/$LISTENER_PORT/g" $ORACLE_HOME/network/admin/listener.ora + + sed -i "s/%port%/$LISTENER_PORT/g" $ORACLE_HOME/network/admin/tnsnames.ora + sed -i "s/%hostname%/`hostname`/g" $ORACLE_HOME/network/admin/tnsnames.ora + + sed -i "s/%httpport%/$HTTP_PORT/g" $ORACLE_HOME/config/scripts/postDBCreation.sql + sed -i "s/%FRA_DIR%/\/usr\/lib\/oracle\/xe\/app\/oracle\/flash_recovery_area/g" $ORACLE_HOME/config/scripts/postDBCreation.sql + + sed -i "s/%port%/$LISTENER_PORT/g" $ORACLE_HOME/config/scripts/init.ora + sed -i "s/%hostname%/`hostname`/g" $ORACLE_HOME/config/scripts/init.ora + + # SGA and PGA Voodoo + TM=`cat /proc/meminfo | grep '^MemTotal' | awk '{print $2}'` + TM=`echo 0.40 \* $TM | bc | sed "s/\..*//"` + TMSP=`echo $TM-40960 | bc` + sga=`echo 0.75 \* $TMSP \* 1024 | bc | sed "s/\..*//"` + pga=`echo 0.25 \* $TMSP \* 1024 | bc | sed "s/\..*//"` + + if [ $sga -lt 146800640 ]; then + sga=146800640 + fi + + if [ $pga -lt 16777216 ]; then + pga=16777216 + fi + + sed -i "s/%sga_target%/$sga/g" $ORACLE_HOME/config/scripts/init.ora + sed -i "s/%pga_aggregate_target%/$pga/g" $ORACLE_HOME/config/scripts/init.ora + + sed -i "s/%sga_target%/$sga/g" $ORACLE_HOME/config/scripts/initXETemp.ora + sed -i "s/%pga_aggregate_target%/$pga/g" $ORACLE_HOME/config/scripts/initXETemp.ora + + #sed -i "s/%httpport%/$HTTP_PORT/g" /usr/share/applications/oraclexe-GotoDBHome.desktop + #sed -i "s/%httpport%/$HTTP_PORT/g" /usr/share/applications/oraclexe-ReadOnlineHelp.desktop + + + homedir=`echo $HOME` + if [ "$homedir" == "/root" ] + then + homedir=`sh -c "echo ~$USER"` + fi + + if [ -f $homedir/.gnome-desktop/oraclexe-GettingStartedDesktop.desktop ] + then + chown $ORACLE_OWNER:$ORACLE_GROUP $homedir/.gnome-desktop/oraclexe-GettingStartedDesktop.desktop + chmod 664 $homedir/.gnome-desktop/oraclexe-GettingStartedDesktop.desktop + fi + if [ -f $homedir/Desktop/oraclexe-GettingStartedDesktop.desktop ] + then + chown $ORACLE_OWNER:$ORACLE_GROUP $homedir/Desktop/oraclexe-GettingStartedDesktop.desktop + chmod 664 $homedir/Desktop/oraclexe-GettingStartedDesktop.desktop + fi + + mkdir /usr/lib/oracle/xe/oradata/XE -p + chmod -R 640 /usr/lib/oracle/xe/oradata/XE + chmod 750 /usr/lib/oracle/xe/oradata/XE + chown -R $ORACLE_OWNER:$ORACLE_GROUP /usr/lib/oracle + + chown -R root:$ORACLE_GROUP $ORACLE_HOME/bin + chmod -R 755 $ORACLE_HOME/bin + chmod 6751 $ORACLE_HOME/bin/oracle + + + if [ -f /etc/oratab ] + then + echo "XE:$ORACLE_HOME:N" >> /etc/oratab + else + echo "XE:$ORACLE_HOME:N" >> /etc/oratab + chown $ORACLE_OWNER:$ORACLE_GROUP /etc/oratab + chmod 644 /etc/oratab + fi + + + echo Configuring Database... + + SQLPLUS="$ORACLE_HOME/bin/sqlplus" + $SU $ORACLE_OWNER -c "$ORACLE_HOME/config/scripts/XE.sh" + + echo "alter user flows_020100 identified by \"$ORACLE_PASSWORD\";" | $SU $ORACLE_OWNER -c "$SQLPLUS -s / as sysdba" + echo "alter user sys identified by \"$ORACLE_PASSWORD\";" | $SU $ORACLE_OWNER -c "$SQLPLUS -s / as sysdba" + echo "alter user system identified by \"$ORACLE_PASSWORD\";" | $SU $ORACLE_OWNER -c "$SQLPLUS -s / as sysdba" + echo "alter user flows_files identified by \"$ORACLE_PASSWORD\";" | $SU $ORACLE_OWNER -c "$SQLPLUS -s / as sysdba" + echo "alter user anonymous identified by \"$ORACLE_PASSWORD\";" | $SU $ORACLE_OWNER -c "$SQLPLUS -s / as sysdba" + + $SU $ORACLE_OWNER -c "$ORACLE_HOME/bin/sqlplus -s /nolog @$ORACLE_HOME/config/scripts/stopdb.sql" + + chmod -R 640 /usr/lib/oracle/xe/oradata/XE + chmod 750 /usr/lib/oracle/xe/oradata/XE + chown -R oraclexe:dba /usr/lib/oracle/xe + rm -fr $ORACLE_HOME/config/seeddb + + echo "Done." + echo + echo "To start oracle-xe, run:" + echo "/etc/init.d/oracle-xe start" + echo "and point your Browser to:" + echo "http://localhost:$HTTP_PORT/apex/" + echo + echo "Log in using username system and the password you supplied..." + echo + +} + +# +#configure_ask() +# +# Ask configuration questions,setting the variables. +# + +configure_ask() +{ + cat <<EOF + +Oracle Database 10g Express Edition Configuration +------------------------------------------------- +This will configure on-boot properties of Oracle Database 10g Express +Edition. The following questions will determine whether the database should +be starting upon system boot, the ports it will use, and the passwords that +will be used for database accounts. Press <Enter> to accept the defaults. +Ctrl-C will abort. + +EOF + + #get the http port value + while : + do + while [ 1 ] + do + echo -n Specify the HTTP port that will be used for HTML DB [8080]: + read LINE + if [ -z $LINE ] + then + LINE=8080 + fi + port=`netstat -n --tcp --listen | grep :$LINE | awk '{print $4}' | cut -d':' -f2` + if [ "$port" = "$LINE" ] + then + echo Port $port appears to be in use by another application.\ + Please specify a different port. + else + break; + fi + done + + case "$LINE" in + "") + break + ;; + *[^0-9]*) + echo "Invalid http port: $LINE" >&2 + ;; + *) + HTTP_PORT=$LINE + break + ;; + esac + done + + #get the listener port value + while : + do + echo + while [ 1 ] + do + echo -n Specify a port that will be used for the database listener [1521]: + read LINE + if [ -z $LINE ] + then + LINE=1521 + fi + echo + port=`netstat -n --tcp --listen | grep :$LINE | awk '{print $4}' | cut -d':' -f2` + if [ "$port" = "$LINE" ] + then + echo Port $port appears to be in use by another application.\ + Please specify a different port. + else + break; + fi + done + + case "$LINE" in + "") + break + ;; + *[^0-9]*) + echo "Invalid port: $LINE" >&2 + ;; + *) + LISTENER_PORT=$LINE + break + ;; + esac + done + + #get the database password + while : + do + echo -n "Specify a password to be used for database accounts. Note that the same +password will be used for SYS, SYSTEM and FLOWS_020100. Oracle recommends +the use of different passwords for each database account. This can be done +after initial configuration:" + while [ 1 ] + do + stty -echo + read LINE + while [ -z $LINE ] + do + echo + echo -n "Password can't be null. Enter password:" + read LINE + done + if [ -n $LINE ] + then + echo + echo -n "Confirm the password:" + read LINE1 + echo + if [ "$LINE" != "$LINE1" ]; + then + echo + echo -n "Passwords do not match. Enter the password:" + else + break; + fi + fi + done + + case "$LINE" in + + *[^a-zA-Z0-9]*) + echo "Invalid password: $LINE" >&2 + ;; + *) + stty echo + ORACLE_PASSWORD=$LINE + break + ;; + esac + done +} + +configure() +{ + configure_ask + configure_perform + CONFIGURE_RUN=true + write_sysconfig +} + +configure diff --git a/dev-db/oracle-xe/oracle-xe-10.2.0.1_p1.ebuild b/dev-db/oracle-xe/oracle-xe-10.2.0.1_p1.ebuild new file mode 100644 index 0000000..ce6aeb7 --- /dev/null +++ b/dev-db/oracle-xe/oracle-xe-10.2.0.1_p1.ebuild @@ -0,0 +1,182 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit eutils rpm + +IUSE="hardened latin1" + +MY_PV="${PV/_p/-}.0" +MY_P="${PN}-univ-${MY_PV}.i386" + +DESCRIPTION="Oracle 10g Express Edition for Linux" +HOMEPAGE="http://www.oracle.com/technology/products/database/xe/index.html" +SRC_URI="latin1? ( ${MY_P/-univ/}.rpm ) + !latin1? ( ${MY_P}.rpm )" + +LICENSE="OTN" +SLOT="0" +KEYWORDS="~x86" +RESTRICT="fetch" + +S="${WORKDIR}" + +RDEPEND=">=dev-libs/libaio-0.3.96 + sys-devel/bc + !dev-db/oracle-instantclient-basic + !dev-db/oracle-instantclient-jdbc + !dev-db/oracle-instantclient-sqlplus" + +DEPEND="${RDEPEND}" + +ORACLEHOME="/usr/lib/oracle/xe/app/oracle/product/10.2.0/server" +ORACLE_OWNER="oraclexe" +ORACLE_GROUP="dba" +ORACLE_SID="XE" + +pkg_nofetch() { + eerror "Please go to:" + eerror " ${HOMEPAGE}" + eerror "and download the Oracle 10g Express Edition package. Put it in:" + eerror " ${DISTDIR}" + eerror " ${MY_P_LATIN1} ... ${MY_P_UNICODE}" + eerror "after downloading it." +} + +src_unpack() { + rpm_src_unpack +} + +pkg_setup() { + if use hardened; then + ewarn + ewarn "Oracle-xe and hardened do not mix very well, USE AT YOUR OWN RISK!" + ewarn + ebeep + fi + + einfo "checking for ${ORACLE_GROUP} group..." + enewgroup ${ORACLE_GROUP} + einfo "checking for ${ORACLE_OWNER} user..." + enewuser ${ORACLE_OWNER} -1 /bin/bash /usr/lib/oracle/xe ${ORACLE_GROUP} +} + +src_install() { + mv "${WORKDIR}/usr" "${D}" + + exeinto ${ORACLEHOME}/bin + doexe "${FILESDIR}/oracle_configure.sh" + doinitd "${FILESDIR}/oracle-xe" + + doenvd "${FILESDIR}/99oracle" + + dosed "s:%ORACLE_HOME%:${ORACLEHOME}:g" /etc/env.d/99oracle + dosed "s:%ORACLE_SID%:${ORACLE_SID}:g" /etc/env.d/99oracle + dosed "s:%ORACLE_OWNER%:${ORACLE_OWNER}:g" /etc/env.d/99oracle + + # snafu... (remove; sparc binaries on a x86 are pretty useless) + [[ -n "$(file "${D}${ORACLEHOME}/lib/hsdb_ora.so" 2>/dev/null | grep SPARC)" ]] && \ + rm -f "${D}${ORACLEHOME}/lib/hsdb_ora.so" 2>/dev/null + + # fix NULL DT_RPATH + einfo "Fixing DT_RPATH issues..." + TMPDIR="/ade" scanelf -XrR "${D}${ORACLEHOME}/lib" &>/dev/null +} + +pkg_postinst() { + einfo + einfo "The Oracle 10g Express Edition Database has been installed." + einfo + einfo "You have to run" + einfo " ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config" + einfo "to adjust kernel parameters and" + einfo " ${ORACLEHOME}/bin/oracle_configure.sh" + einfo "to configure oracle-xe before first use!" + einfo +} + +pkg_config() { + einfo "Checking kernel parameters..." + einfo + + # Check and Update Kernel parameters + semmsl=`cat /proc/sys/kernel/sem | awk '{print $1}'` + semmns=`cat /proc/sys/kernel/sem | awk '{print $2}'` + semopm=`cat /proc/sys/kernel/sem | awk '{print $3}'` + semmni=`cat /proc/sys/kernel/sem | awk '{print $4}'` + shmmax=`cat /proc/sys/kernel/shmmax` + shmmni=`cat /proc/sys/kernel/shmmni` + shmall=`cat /proc/sys/kernel/shmall` + filemax=`cat /proc/sys/fs/file-max` + ip_local_port_range_lb=`cat /proc/sys/net/ipv4/ip_local_port_range | awk '{print $1}'` + ip_local_port_range_ub=`cat /proc/sys/net/ipv4/ip_local_port_range | awk '{print $2}'` + + change=no + if [ $semmsl -lt 250 ]; then + semmsl=250 + change=yes + fi + + if [ $semmns -lt 32000 ]; then + semmns=32000 + change=yes + fi + + if [ $semopm -lt 100 ]; then + semopm=100 + change=yes + fi + + if [ $semmni -lt 128 ]; then + semmni=128 + change=yes + fi + + if [ "$change" != "no" ]; then + einfo "kernel.sem="$semmsl $semmns $semopm $semmni"" + fi + + if [ $shmmax -lt 536870912 ]; then + einfo "kernel.shmmax="536870912"" + change=yes + fi + + if [ $shmmni -lt 4096 ]; then + einfo "kernel.shmmni="4096"" + change=yes + fi + + if [ $shmall -lt 2097152 ]; then + einfo "kernel.shmall="2097152"" + change=yes + fi + + if [ $filemax -lt 65536 ]; then + einfo "fs.file-max="65536"" + change=yes + fi + + changeport=no + if [ $ip_local_port_range_lb -lt 1024 ]; then + changeport=yes + ip_local_port_range_lb=1024 + fi + + if [ $ip_local_port_range_ub -gt 65000 ]; then + ip_local_port_range_ub=65000 + changeport=yes + fi + + if [ "$changeport" != "no" ]; then + einfo "net.ipv4.ip_local_port_range="$ip_local_port_range_lb $ip_local_port_range_ub"" + fi + + if [ "$change" != "no" ] || [ "$changeport" != "no" ]; then + einfo + einfo "It is recommended to add the above kernel parameters to /etc/sysctl.conf:" + einfo "After setting kernel parameters activate them using '/sbin/sysctl -p'" + else + einfo "Kernel parameters set, configure oracle-xe using" + einfo " ${ORACLEHOME}/bin/oracle_configure.sh" + fi +} |