[omniORB-dev] Re: omniORB RPM spec file for 4.0.4
Thomas Lockhart
lockhart at fourpalms.org
Thu Jul 22 20:35:23 BST 2004
> ... So I have reminded myself that I was going to send you my
> updated RPM build files, because the source RPM from your site didn't
> work for me. I hope you will be able to use them for the new release.
Hi Dirk. I've integrated many of your changes in the spec file, and
would like to understand more about what "didn't work for you" versus
what was changed for stylistic reasons or LSB compliance. So, here are
some questions and comments for clarification:
1) You assign parameters at the very top, including %{name} and
%{version} (I do this too for some other parameters). Those are then
used to set "Name:" and "Version:", which (internally to RPM) then go
ahead and set %{name} and %{version}. Since the "Name:" line etc are at
or near the top of the file, it seems more direct to me to set those
directly and then let RPM do what it should to get the internal
variables defined rather than have the definitions done twice (certainly
just a detail). Is there a different behavior in SuSE?
2) You define %{libname} as "libomniorb" and use it only in the
"Provides:" areas of the packages. I've noticed that my Mandrake distro
has, for some packages, taken to starting the names of those parts with
libraries in them with "lib", but your current spec file does not take
this step. Was SuSE unable to use the original "Provides:" arguments?
You also removed the "Provides:" alternate names "omniorb-*", leaving
just "libomniorb-*". I think they were both there for historical
reasons. If we take one out, we should list that one as "Obsoletes:".
I'm inclined to leave this stuff as-is until later, like 4.1.
3) Removed /sbin/chkconfig from SuSE dependencies. OK. Though istm that
is is provided by SuSE and is or could be used for our installation.
Comments?
4) Prerequisites for SuSE are different from RedHat which are different
from Mandrake due to naming and content differences in packages. The
Mandrake ones are really sticky, since for some library packages (python
and openssl for example) they embed a version number into the package
*name* to allow multiple versions to be installed at a time. I'm not at
all excited about embedding those specific version numbers into the
prerequisites list. This isn't your problem, and I've included your
prerequisites for SuSE.
5) I defined %{rc_path} but both Mandrake and Fedora define
%{_initrddir} already. Does SuSE have _initrddir too? Use "rpmbuild
--showrc" to find out.
6) Do the SuSE init scripts really all end in ".in"?? There is some
postprocessing that is necessary for these files to work, but I don't
see where that happens in your spec file. Is something missing or does
SuSE do something automagically? Should I add a sed substitution rather
than the cp step?
7) You substituted %{prefix} for "/usr" to point at openssl during
configuration. That seems to be a better assumption, but neither is
ideal since in principle openssl could be installed under a different
prefix than omniORB. I did incorporate the change though.
8) $RPM_BUILD_ROOT is also defined as %{buildroot} which you
substituted. I like your choice better.
9) Oh, you used "-buildroot" as the last part of the temporary build
area path, rather than just "-root". I'd gotten my choice from somewhere
(probably the RPM book or by copying another RPM spec file); what is the
basis for the alternate name?
10) Use %{_bindir} rather than %{prefix}/bin. OK.
11) Use %{_mandir} rather than %{prefix}/share/man. OK.
12) Are install_initd and remove_initd available on all SuSE systems? If
not, for what versions are they available? Does using these disallow
some viable SuSE distros?
13) You create the "alternative init.d" links into /usr/sbin during
package building, rather than during a "%post" operation during package
installation. Is this style strongly recommended, required by SuSE, or
just a suggestion?
14) ${_libdir} is the same as %{prefix}/lib and %{_datadir} is the same
as %{prefix}/share. OK.
15) Thanks for the many good tips for available RPM variables, along
with the other work.
I put source and binary RPMs labeled as 4.0.3-7 for Mandrake 10.0 in
http://www.fourpalms.org/pub/omniORB/devel/
and enclose here my current spec file and Dirk's omniNames.SuSE
initialization script. I did not yet do the initialization
transformation for SuSE, pending resolution of some of the details above.
That's all for now :)
- Tom
Oh Duncan, I've also enclosed a patch for the RedHat/Mandrake startup
script to allow use of the "omni" user rather than using root. Probably
a good idea, and/or we could generalize and parameterize it to allow
starting as any user including root.
-------------- next part --------------
%define omnigid 255
%define omniuid 255
Summary: Object Request Broker (ORB)
Name: omniORB
Version: 4.0.3
Release: 7
License: GPL / LGPL
Group: System/Libraries
Source0: %{name}-%{version}.tar.gz
Source1: omniNames.SuSE.in
Patch0: omniORB-su.patches
Prefix: /usr
%if "%{_vendor}" != "suse"
Prereq: /sbin/chkconfig
%endif
Prereq: /sbin/ldconfig
URL: http://omniorb.sourceforge.net/
#Provides: corba
BuildRequires: python glibc-devel
%if "%{_vendor}" == "MandrakeSoft"
BuildRequires: openssl
%endif
%if "%{_vendor}" == "redhat"
BuildRequires: python-devel openssl-devel
%endif
%if "%{_vendor}" == "suse"
BuildRequires: openssl-devel
%endif
Buildroot: %{_tmppath}/%{name}-%{version}-root
#BuildArch: i586
%description
%{name} is an Object Request Broker (ORB) which implements
specification 2.6 of the Common Object Request Broker Architecture
(CORBA). Contains the libraries needed to run programs dynamically
linked with %{name}.
# servers
%package servers
Summary: Utility programs
Group: Development/C++
Prereq: /sbin/service /sbin/chkconfig
Prereq: /usr/sbin/groupadd /usr/sbin/groupdel
Prereq: /usr/sbin/useradd /usr/sbin/userdel
Requires: %{name} = %{version}-%{release}
Provides: libomniorb-servers = %{version}-%{release} %{name}-servers = %{version}-%{release}
%description servers
%{name} CORBA services including a Naming Service.
%package bootscripts
Summary: Utility programs
Group: Development/C++
Requires: %{name}-servers = %{version}-%{release} %{name}-utils = %{version}-%{release}
Provides: %{name}-bootscripts = %{version}-%{release}
%description bootscripts
Automatic starting of the %{name} CORBA Naming Service.
# utilities
%package utils
Summary: Utility programs
Group: Development/C++
Requires: %{name} = %{version}-%{release}
Provides: libomniorb-utils = %{version}-%{release} %{name}-utils = %{version}-%{release}
%description utils
%{name} utility programs which may be useful at runtime.
# devel part of the bundle
%package devel
Summary: Header files and libraries needed for %{name} development
Group: Development/C++
Requires: %{name} = %{version}-%{release}
Provides: libomniorb-devel = %{version}-%{release} %{name}-devel = %{version}-%{release}
%description devel
The header files and libraries needed for developing programs using
%{name}.
# docs and examples are in a separate package
%package doc
Summary: Documentation and examples for %{name}
Group: Development/C++
#Requires: %{name} = %{version}
%description doc
Developer documentation and examples.
%define py_ver %(python -c 'import sys;print(sys.version[0:3])')
%prep
%setup -n %{name}-%{version}
%patch0 -p1
%if "%{_vendor}" == "suse"
# Replace the init script with something appropriate for SuSE
# FIXME Note that we hardcode a relative path here,
# since we do not have that available directly from RPM.
cp -f %{SOURCE1} etc/init.d/omniNames
%endif
./configure --prefix=%{prefix} --with-openssl=%{prefix}
%build
# We abuse the CPPFLAGS to pass optimisation options through.
make IMPORT_CPPFLAGS+="$RPM_OPT_FLAGS" all
%install
make DESTDIR=%{buildroot} install
mkdir -p %{buildroot}%{_initrddir}
cp sample.cfg %{buildroot}%{_sysconfdir}/omniORB.cfg
cp etc/init.d/omniNames %{buildroot}%{_initrddir}
mkdir -p %{buildroot}/%{_mandir}/man{1,5}
cp -r man/* %{buildroot}/%{_mandir}
mkdir -p %{buildroot}%{_var}/omniNames
mkdir -p %{buildroot}%{_localstatedir}/omniMapper
# Rename catior to avoid naming conflict with TAO
mv %{buildroot}%{_bindir}/catior %{buildroot}%{_bindir}/catior.omni
mv %{buildroot}/%{_mandir}/man1/catior.1 %{buildroot}/%{_mandir}/man1/catior.omni.1
%clean
[ -z %{buildroot} ] || rm -rf %{buildroot}
%pre
%post
/sbin/ldconfig
%pre servers
/usr/sbin/groupadd -g %{omnigid} -o -r omni >/dev/null 2>&1 || :
/usr/sbin/useradd -M -n -g omni -o -r -d /var/omniNames -s /bin/bash \
-c "omniORB Servers" -u %{omniuid} omni >/dev/null 2>&1 || :
%post servers
/sbin/ldconfig
%pre bootscripts
# a previous version is already installed?
if [ $1 -ge 2 ]; then
/sbin/service omniNames stop >/dev/null 2>&1
fi
%post bootscripts
%if "%{_vendor}" == "suse"
# Most SuSE service scripts have a corresponding link into /usr/sbin
mkdir -p %{prefix}/sbin
ln -sf %{_initrddir}/omniNames %{prefix}/sbin/rcomniNames
/sbin/insserv omniNames
%else
/sbin/chkconfig --add omniNames
%endif
/sbin/service omniNames restart >/dev/null 2>&1
%preun bootscripts
%if "%{_vendor}" == "suse"
/sbin/insserv -r omniNames
rm -rf %{prefix}/sbin/rcomniNames
%else
/sbin/chkconfig --del omniNames
%endif
/sbin/service omniNames stop >/dev/null 2>&1
rm -rf /var/omniNames/*
rm -rf /var/lib/omniMapper/*
%postun
/sbin/ldconfig
%postun servers
/sbin/ldconfig
# uninstalling all versions?
if [ $1 -eq 0 ] ; then
/usr/sbin/userdel omni >/dev/null 2>&1 || :
/usr/sbin/groupdel omni >/dev/null 2>&1 || :
fi
# main package includes libraries and copyright info
%files
%defattr (-,root,root)
%doc CREDITS COPYING COPYING.LIB
%config(noreplace) %{_sysconfdir}/*.cfg
%{_libdir}/*.so.*
%{_datadir}/idl/*
%files servers
%defattr (-,root,root)
%dir %attr(700,omni,omni) %{_var}/omniNames
%dir %attr(700,omni,omni) %{_localstatedir}/omniMapper
%attr(644,root,man) %{_mandir}/man1/omniNames*
#%attr(644,root,man) %{_mandir}/man1/omniMapper*
%attr(755,root,root) %{_bindir}/omniMapper
%attr(755,root,root) %{_bindir}/omniNames
# Thin substitute for standard Linux init script
%files bootscripts
%defattr (-,root,root)
%config(noreplace) %attr(775,root,root) %{_initrddir}/*
%files utils
%defattr (-,root,root)
%attr(644,root,man) %{_mandir}/man1/catior*
%attr(644,root,man) %{_mandir}/man1/genior*
%attr(644,root,man) %{_mandir}/man1/nameclt*
%{_bindir}/catior.omni
%{_bindir}/convertior
%{_bindir}/genior
%{_bindir}/nameclt
%files devel
%defattr(-,root,root)
%doc ReleaseNotes* readmes/*
%attr(644,root,man) %{_mandir}/man1/omniidl*
%{_bindir}/omnicpp
%{_bindir}/omniidl
%{_bindir}/omniidlrun.py
%{_bindir}/omkdepend
%{_libdir}/*.a
%{_libdir}/*.so
%{_includedir}/*
%{_libdir}/python%{py_ver}/site-packages/omniidl/*
%{_libdir}/python%{py_ver}/site-packages/omniidl_be/*.py*
%{_libdir}/python%{py_ver}/site-packages/omniidl_be/cxx/*.py*
%{_libdir}/python%{py_ver}/site-packages/omniidl_be/cxx/header/*
%{_libdir}/python%{py_ver}/site-packages/omniidl_be/cxx/skel/*
%{_libdir}/python%{py_ver}/site-packages/omniidl_be/cxx/dynskel/*
%{_libdir}/python%{py_ver}/site-packages/omniidl_be/cxx/impl/*
%{_libdir}/python%{py_ver}/site-packages/_omniidlmodule.so*
%{_libdir}/pkgconfig/*.pc
%files doc
%defattr(-,root,root)
%doc doc/*
%changelog
* Thu Jul 22 2004 Thomas Lockhart <lockhart at fourpalms.org> 4.0.3-7
- Incorporate additional SuSE features per Dirk O. Siebnich <dok at dok-net.net>
- Use additional standard RPM substitution parameters rather than hardcoded paths
* Wed Dec 24 2003 Thomas Lockhart <lockhart at fourpalms.org> 4.0.3
- Fix ownership of boot scripts per Bastiann Bakker
- Clean up pre- and post-install actions to support servers
* Tue Dec 08 2003 Thomas Lockhart <lockhart at fourpalms.org> 4.0.3
- Include additional build dependencies for redhat per Bastiann Bakker
- Put man pages for all distros into %{prefix}/share/man per FHS conventions
- Run omniNames under user "omni" per Jan Holst Jensen
* Mon Dec 01 2003 Thomas Lockhart <lockhart at fourpalms.org> 4.0.3
- Merge SuSE spec contributions from Johan Cronje
* Wed Nov 19 2003 Duncan Grisby <duncan at grisby.org> 4.0.3
- Merge contributed updates, bump version number.
* Fri Aug 08 2003 Thomas Lockhart <lockhart at fourpalms.org> 4.0.2
- Rename catior man page to match catior.omni binary name
* Wed Aug 6 2003 Duncan Grisby <dgrisby at apasphere.com> 4.0.2
- Bump version number.
* Tue Jun 10 2003 Duncan Grisby <dgrisby at apasphere.com> 4.0.2pre1
- Fix some text, bump version number, add init script, minor tweaks.
* Wed Feb 12 2003 Thomas Lockhart <lockhart at fourpalms.org> 4.0.0
- Rename catior to catior.omni to avoid name conflict with TAO
* Tue Oct 01 2002 Thomas Lockhart <lockhart at fourpalms.org> 4.0.0
- Track down changes in documentation for 4.0.0
- Omit patches required to build the previous beta
* Mon Jul 29 2002 Thomas Lockhart <lockhart at fourpalms.org> 4.0.0beta
- Separate out utility programs to manage name conflict for catior with TAO
* Wed Jul 03 2002 Thomas Lockhart <lockhart at fourpalms.org> 4.0.0beta
- Start from 3.04 spec files
- Strip workarounds from the spec file since 4.0 builds more cleanly
-------------- next part --------------
#!/bin/sh
#
# Startup script to start/stop the omniORB services
#
# chkconfig: 345 90 10
# description: CORBA Naming Service from omniORB
# processname: omniNames
# config: /etc/omniORB.cfg
#
# Author: Sander Steffann <sander at steffann.nl>
# Modified: Thomas Lockhart <lockhart at fourpalms.org>
# - Put omniNames files under /var/log/omniNames
# - Adjust start/stop levels
# Modified: Duncan Grisby <duncan at grisby.org>
# - Put omniNames files under /var/omniNames, since they are not log files
# Modified: Johan Cronje <jcronje at dsp.sun.ac.za>
# - Edited the file to work in SuSE Linux
# Modified: Dirk O. Siebnich <dok at dok-net.net>
# - better LSB compliance
### BEGIN INIT INFO
# Provides: omniNames
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 2 3 5
# Short-Description: omniNames daemon that provides a CORBA naming service
# Description: The CORBA naming service provides a way for CORBA clients
# to obtain object references by using object names rather
# than IOR string references.
# Enable this service if the machine will act as a Naming
# Service Server.
### END INIT INFO
# Program options
# Edit the paths if they do not correspond with your installation
GENIOR=@prefix@/bin/genior
OMNINAMES=@prefix@/bin/omniNames
OMNINAMES_DIR=/var/omniNames
OMNIMAPPER_DIR=/var/lib/omniMapper
test -x $OMNINAMES || exit 5
. /lib/lsb/init-functions
rc_reset
# Registered port number for CORBA naming service is 2809.
# Should be preferred but may conflict with other ORBs running concurrently.
TCPPORT=2809
if [ -f /etc/sysconfig/omniNames ];then
. /etc/sysconfig/omniNames
fi
case "$1" in
start)
# Make sure directories exist
[ -d $OMNINAMES_DIR ] || mkdir -p $OMNINAMES_DIR
[ -d $OMNIMAPPER_DIR ] || mkdir -p $OMNIMAPPER_DIR
echo -n "Starting omniNames"
OMNINAMES_OPTIONS="-errlog $OMNINAMES_DIR/error.log -logdir $OMNINAMES_DIR"
if [ ! -f $OMNINAMES_DIR/omninames-*.log ];
then
OMNINAMES_OPTIONS="$OMNINAMES_OPTIONS -start $TCPPORT"
echo -n " for the first time"
fi
# Run it
startproc -u omni $OMNINAMES $OMNINAMES_OPTIONS
if [ rc_status ];
then
touch /var/lock/subsys/omniNames
fi
rc_status -v
echo -n "Configuring NameService with genior"
$GENIOR IDL:omg.org/CosNaming/NamingContextExt:1.0 `hostname` $TCPPORT NameService > $OMNIMAPPER_DIR/NameService
rc_status -v
;;
stop)
echo -n "Stopping omniNames"
killproc -TERM $OMNINAMES
rm -f $OMNIMAPPER_DIR/NameService
rm -f /var/lock/subsys/omniNames
rc_status -v
;;
try-restart)
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
# Remember status and be quiet
rc_status
;;
restart|reload)
$0 stop
$0 start
;;
status)
echo -n "Checking for omniNames"
checkproc $OMNINAMES
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
rc_exit
-------------- next part --------------
diff -cr omniORB-4.0.3.orig/etc/init.d/omniNames.in omniORB-4.0.3/etc/init.d/omniNames.in
*** omniORB-4.0.3.orig/etc/init.d/omniNames.in 2003-11-18 16:14:48.000000000 -0800
--- omniORB-4.0.3/etc/init.d/omniNames.in 2003-12-10 07:27:21.000000000 -0800
***************
*** 9,15 ****
#
# Author: Sander Steffann <sander at steffann.nl>
# Modified: Thomas Lockhart <lockhart at fourpalms.org>
! # - Put omniNames log files under /var/log/omniNames
# - Adjust start/stop levels
# Modified: Duncan Grisby <duncan at grisby.org>
# - Put omniNames files under /var/omniNames, since they are not log files
--- 9,15 ----
#
# Author: Sander Steffann <sander at steffann.nl>
# Modified: Thomas Lockhart <lockhart at fourpalms.org>
! # - Put omniNames files under /var/log/omniNames
# - Adjust start/stop levels
# Modified: Duncan Grisby <duncan at grisby.org>
# - Put omniNames files under /var/omniNames, since they are not log files
***************
*** 52,58 ****
fi
# Run it
! $OMNINAMES $OMNINAMES_OPTIONS &> /dev/null &
OMNINAMES_PID=$!
# Sleep a while, and then check if omniNames is still running
--- 52,58 ----
fi
# Run it
! su omni -c "$OMNINAMES $OMNINAMES_OPTIONS" &> /dev/null &
OMNINAMES_PID=$!
# Sleep a while, and then check if omniNames is still running
More information about the omniORB-dev
mailing list