Группа :: Базы Данных
Пакет: oracle-preinstall
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
%define swowner oracle
%define orainventory oinstall
%define osdba dba
%define osoper oper
%define oracle_base /opt/oracle
%define inventory %oracle_base/%swowner/oraInventory
%define invloc %_sysconfdir/oraInst.loc
%define oratab %_sysconfdir/oratab
Name: oracle-preinstall
Version: 0.4
Release: alt7
Summary: Oracle pre-installation scripts
License: GPL
Group: Databases
Packager: Igor Muratov (ALT Linux Team) <migor at altlinux.org>
#Url: http://www.lrn.ru/~migor/
BuildArch: noarch
# Environment set
Source1: oracle.sh
Source5: oracle.menu
Source6: oracle.sysconfig
# Scripts
Source11: oracle-db
Source12: oracle-lsnr
# Documentation
Source20: README
Source21: Oracle10g_ALT40.patch
Obsoletes: oracle8-tuning oracle9-tuning oracle10-tuning
Requires: binutils make gcc findutils gawk pdksh
Requires: glibc glibc-devel libaio libaio-devel libstdc++3.3
Requires: xorg-x11-libs xorg-x11-locales xorg-x11-xauth
Requires: fonts-type1-xorg
# ssh needs if you install RAC
Requires: openssh-clients
%description
Common scripts to install and maintenance Oracle(TM) database server
and it services. May be used with Oracle9i and later.
%package client
Summary: Oracle Client preinstall package
Group: Databases
Requires: %name
%description client
Common scripts to install and maintenance Oracle(TM) database server
and it services. May be used with Oracle9i and later.
%prep
%build
%install
%__install -dD $RPM_BUILD_ROOT%_initdir
%__install -m755 -D %SOURCE11 %SOURCE12 $RPM_BUILD_ROOT%_initdir/
%__install -dD $RPM_BUILD_ROOT%_sysconfdir/{profile.d,sysconfig}
%__install -m755 -D %SOURCE1 $RPM_BUILD_ROOT%_sysconfdir/profile.d/
%__install -m755 -D %SOURCE6 $RPM_BUILD_ROOT%_sysconfdir/sysconfig/oracle
%__install -m644 -D %SOURCE20 $RPM_BUILD_ROOT%_docdir/%name-%version/README
%__install -m644 -D %SOURCE21 $RPM_BUILD_ROOT%_docdir/%name-%version/Oracle10g_ALT40.patch
%__install -m644 -D %SOURCE5 $RPM_BUILD_ROOT%_menudir/%name
# Optimal Flexible Architecture Directory Structure
%__install -m0775 -dD $RPM_BUILD_ROOT%oracle_base/{admin,product,crs,doc,local,oradata}
%__install -m0770 -dD $RPM_BUILD_ROOT%oracle_base/{oraInventory,flash_recovery_area}
%pre
/usr/sbin/groupadd -r -f %orainventory >/dev/null 2>&1 ||:
/usr/sbin/groupadd -r -f %osdba >/dev/null 2>&1 ||:
/usr/sbin/groupadd -r -f %osoper >/dev/null 2>&1 ||:
/usr/sbin/useradd -g %orainventory -G %osdba,%osoper \
-c "Oracle database server" -n %swowner >/dev/null 2>&1 ||:
/bin/su - oracle -c "ssh-keygen -t dsa -b 2048 -C 'Autogenerated key' -f ~/.ssh/id_dsa -N '' -q" ||:
if [ ! -f %invloc ]
then
echo "inventory_loc=%oracle_base/oraInventory" > %invloc
echo "inst_group=%orainventory" >> %invloc
chown %swowner:%orainventory %invloc
echo "File %invloc created."
fi
if [ ! -f %oratab ]
then
echo "# Oracle instances" >> %oratab
chown %swowner:%orainventory %oratab
echo "File %oratab created."
fi
%preun
%preun_service oracle-lsnr
%preun_service oracle-db
%post client
%update_menus
%postun client
%update_menus
%files
%defattr(-, root, root)
%config(noreplace) %_initdir/*
%config(noreplace) %_sysconfdir/sysconfig/*
%attr(-, %swowner, %orainventory) %oracle_base
%_docdir/%name-%version
%files client
%config(noreplace) %_sysconfdir/profile.d/*
%_menudir/*
%changelog
…
Полный changelog можно просмотреть здесь
%define orainventory oinstall
%define osdba dba
%define osoper oper
%define oracle_base /opt/oracle
%define inventory %oracle_base/%swowner/oraInventory
%define invloc %_sysconfdir/oraInst.loc
%define oratab %_sysconfdir/oratab
Name: oracle-preinstall
Version: 0.4
Release: alt7
Summary: Oracle pre-installation scripts
License: GPL
Group: Databases
Packager: Igor Muratov (ALT Linux Team) <migor at altlinux.org>
#Url: http://www.lrn.ru/~migor/
BuildArch: noarch
# Environment set
Source1: oracle.sh
Source5: oracle.menu
Source6: oracle.sysconfig
# Scripts
Source11: oracle-db
Source12: oracle-lsnr
# Documentation
Source20: README
Source21: Oracle10g_ALT40.patch
Obsoletes: oracle8-tuning oracle9-tuning oracle10-tuning
Requires: binutils make gcc findutils gawk pdksh
Requires: glibc glibc-devel libaio libaio-devel libstdc++3.3
Requires: xorg-x11-libs xorg-x11-locales xorg-x11-xauth
Requires: fonts-type1-xorg
# ssh needs if you install RAC
Requires: openssh-clients
%description
Common scripts to install and maintenance Oracle(TM) database server
and it services. May be used with Oracle9i and later.
%package client
Summary: Oracle Client preinstall package
Group: Databases
Requires: %name
%description client
Common scripts to install and maintenance Oracle(TM) database server
and it services. May be used with Oracle9i and later.
%prep
%build
%install
%__install -dD $RPM_BUILD_ROOT%_initdir
%__install -m755 -D %SOURCE11 %SOURCE12 $RPM_BUILD_ROOT%_initdir/
%__install -dD $RPM_BUILD_ROOT%_sysconfdir/{profile.d,sysconfig}
%__install -m755 -D %SOURCE1 $RPM_BUILD_ROOT%_sysconfdir/profile.d/
%__install -m755 -D %SOURCE6 $RPM_BUILD_ROOT%_sysconfdir/sysconfig/oracle
%__install -m644 -D %SOURCE20 $RPM_BUILD_ROOT%_docdir/%name-%version/README
%__install -m644 -D %SOURCE21 $RPM_BUILD_ROOT%_docdir/%name-%version/Oracle10g_ALT40.patch
%__install -m644 -D %SOURCE5 $RPM_BUILD_ROOT%_menudir/%name
# Optimal Flexible Architecture Directory Structure
%__install -m0775 -dD $RPM_BUILD_ROOT%oracle_base/{admin,product,crs,doc,local,oradata}
%__install -m0770 -dD $RPM_BUILD_ROOT%oracle_base/{oraInventory,flash_recovery_area}
%pre
/usr/sbin/groupadd -r -f %orainventory >/dev/null 2>&1 ||:
/usr/sbin/groupadd -r -f %osdba >/dev/null 2>&1 ||:
/usr/sbin/groupadd -r -f %osoper >/dev/null 2>&1 ||:
/usr/sbin/useradd -g %orainventory -G %osdba,%osoper \
-c "Oracle database server" -n %swowner >/dev/null 2>&1 ||:
/bin/su - oracle -c "ssh-keygen -t dsa -b 2048 -C 'Autogenerated key' -f ~/.ssh/id_dsa -N '' -q" ||:
if [ ! -f %invloc ]
then
echo "inventory_loc=%oracle_base/oraInventory" > %invloc
echo "inst_group=%orainventory" >> %invloc
chown %swowner:%orainventory %invloc
echo "File %invloc created."
fi
if [ ! -f %oratab ]
then
echo "# Oracle instances" >> %oratab
chown %swowner:%orainventory %oratab
echo "File %oratab created."
fi
%preun
%preun_service oracle-lsnr
%preun_service oracle-db
%post client
%update_menus
%postun client
%update_menus
%files
%defattr(-, root, root)
%config(noreplace) %_initdir/*
%config(noreplace) %_sysconfdir/sysconfig/*
%attr(-, %swowner, %orainventory) %oracle_base
%_docdir/%name-%version
%files client
%config(noreplace) %_sysconfdir/profile.d/*
%_menudir/*
%changelog
…
Полный changelog можно просмотреть здесь