# HG changeset patch # User Michael Schloh von Bennewitz # Date 1229342065 -3600 # Node ID 3715407014ea0080bf95d923b0ad21acb1548454 # Parent 7118aa4adf8866468d9a7624a80bf6ed9cc72a3c Import original revisions from the OpenPKG project. diff -r 7118aa4adf88 -r 3715407014ea mico/mico.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mico/mico.spec Mon Dec 15 12:54:25 2008 +0100 @@ -0,0 +1,231 @@ +## +## mico.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package information +Name: mico +Summary: CORBA Toolkit +URL: http://www.mico.org/ +Vendor: The MICO Project +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: PLUS +Group: RPC +License: LGPL/GPL +Version: 2.3.12 +Release: 20080101 + +# package options +%option with_ssl no +%option with_x11 no +%option with_qt no +%option with_gtk no +%option with_tcl no + +# list of sources +Source0: http://www.mico.org/mico-%{version}.tar.gz +Source2: rc.mico + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20060823, gcc, make +PreReq: OpenPKG, openpkg >= 20060823 +%if "%{with_ssl}" == "yes" +BuildPreReq: openssl +PreReq: openssl +%endif +%if "%{with_x11}" == "yes" +BuildPreReq: X11 +PreReq: X11 +%endif +%if "%{with_qt}" == "yes" +BuildPreReq: qt, pkgconfig +PreReq: qt +%endif +%if "%{with_gtk}" == "yes" +BuildPreReq: gtk +PreReq: gtk +%endif +%if "%{with_tcl}" == "yes" +BuildPreReq: tcl +PreReq: tcl +%endif +AutoReq: no +AutoReqProv: no + +%description + The acronym MICO expands to MICO Is CORBA. The intention of this + project is to provide a freely available and fully compliant + implementation of the CORBA standard. The following design + principles guided the implementation of MICO: + - Start from scratch, and only use standard APIs (Posix/Win32) + - Don't rely on propietary or specialized libraries + - Use standard C++ for the implementation + - Only make use of widely available, free, non-proprietary tools + - Only implement what is required for a CORBA compliant implementation + - Provide a clear design even for implementation internals + +%track + prog mico = { + version = %{version} + url = http://www.mico.org/down.html + regex = mico-(__VER__)\.tar\.gz + } + +%prep + %setup -q -n mico + +%build + CC="%{l_cc}" + CXX="%{l_cxx}" + CFLAGS="%{l_cflags -O}" + CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated" + CPPFLAGS="%{l_cppflags}" + includedir="" +%if "%{with_qt}" == "yes" + CFLAGS="$CFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`" + CXXFLAGS="$CXXFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`" + CPPFLAGS="$CPPFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-I qt`" + includedir="$includedir %{l_prefix}/include/qt" + LDFLAGS="$LDFLAGS `%{l_prefix}/bin/pkg-config --libs-only-L qt`" +%endif +%if "%{with_ssl}" == "yes" + includedir="$includedir %{l_prefix}/include/openssl" +%endif +%if "%{with_gtk}" == "yes" + includedir="$includedir %{l_prefix}/include/gtk" +%endif +%if "%{with_tcl}" == "yes" + includedir="$includedir %{l_prefix}/include/tcl" +%endif + for dir in $includedir; do + CPPFLAGS="$CPPFLAGS -I$dir" + done + LDFLAGS="%{l_ldflags}" + JAVAC=no + export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS JAVAC + ./configure \ + --prefix=%{l_prefix} \ +%if "%{with_ssl}" == "yes" + --with-ssl=%{l_prefix} \ +%endif +%if "%{with_x11}" == "yes" + --with-x \ + --x-includes=`%{l_rc} --query x11_incdir` \ + --x-libraries=`%{l_rc} --query x11_libdir` \ +%else + --without-x \ +%endif +%if "%{with_qt}" == "yes" + --with-qt=%{l_prefix} \ +%endif +%if "%{with_gtk}" == "yes" + --with-gtk=%{l_prefix} \ +%endif +%if "%{with_tcl}" == "yes" + --with-tcl=%{l_prefix} \ +%endif + --disable-mini-stl \ + --disable-shared + touch cpp/.depend + %{l_make} %{l_mflags} + +%install + rm -rf $RPM_BUILD_ROOT + + # make directory structure + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/bin \ + $RPM_BUILD_ROOT%{l_prefix}/lib \ + $RPM_BUILD_ROOT%{l_prefix}/include/mico \ + $RPM_BUILD_ROOT%{l_prefix}/include/coss \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ + $RPM_BUILD_ROOT%{l_prefix}/var/mico \ + $RPM_BUILD_ROOT%{l_prefix}/man/man1 \ + $RPM_BUILD_ROOT%{l_prefix}/man/man5 \ + $RPM_BUILD_ROOT%{l_prefix}/man/man8 + + # install binaries, libraries, headers + %{l_make} %{l_mflags} install \ + INSTDIR=$RPM_BUILD_ROOT%{l_prefix} \ + SHARED_INSTDIR=$RPM_BUILD_ROOT%{l_prefix} + + # install our own things + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.mico} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # cleanup installation files + rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc + rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/ministl + rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mico-setup.* + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true + mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/nsd.8 \ + $RPM_BUILD_ROOT%{l_prefix}/man/man8/mico-nsd.8 + ( cd $RPM_BUILD_ROOT%{l_prefix}/lib + for name in mico micoaux micocoss micoir; do + mv lib${name}%{version}.a lib${name}.a + done +%if "%{with_x11}" == "yes" + mv libmicox%{version}.a libmicox.a +%endif +%if "%{with_qt}" == "yes" + mv libmicoqt%{version}.a libmicoqt.a +%endif +%if "%{with_gtk}" == "yes" + mv libmicogtk%{version}.a libmicogtk.a +%endif +%if "%{with_tcl}" == "yes" + mv libmicotcl%{version}.a libmicotcl.a +%endif + ) || exit $? + + # generate files listing + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ + '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mico' + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + +%pre + # before upgrade, save status and stop service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} mico status 2>/dev/null | tee %{l_tmpfile}` + %{l_rc} mico stop 2>/dev/null + exit 0 + +%post + if [ $1 -eq 2 ]; then + # after upgrade, restore status + eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} + [ ".$mico_active" = .yes ] && %{l_rc} mico start + fi + exit 0 + +%preun + # before erase, stop service + [ $1 -eq 0 ] || exit 0 + %{l_rc} mico stop 2>/dev/null + exit 0 + diff -r 7118aa4adf88 -r 3715407014ea mico/rc.mico --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mico/rc.mico Mon Dec 15 12:54:25 2008 +0100 @@ -0,0 +1,71 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.mico -- Run-Commands +## + +%config + mico_enable="$openpkg_rc_def" + mico_micod="no" + mico_nsd="no" + mico_ip_micod="127.0.0.1" + mico_ip_nsd="127.0.0.1" + mico_micod_args="-ORBGIOPVersion 1.2 -ORBIIOPVersion 1.2 -ORBIIOPAddr inet:${mico_ip_micod}:8912" + mico_nsd_args="-ORBGIOPVersion 1.2 -ORBIIOPVersion 1.2 -ORBIIOPAddr inet:${mico_ip_nsd}:8914" + +%common + mico_micod_pidfile="@l_prefix@/var/mico/micod.pid" + mico_nsd_pidfile="@l_prefix@/var/mico/nsd.pid" + mico_signal () { + local rc_micod=0 + local rc_nsd=0 + if rcVarIsYes mico_micod; then + [ -f $mico_micod_pidfile ] \ + && kill -$1 `cat $mico_micod_pidfile` + rc_micod=$? + fi + if rcVarIsYes mico_nsd; then + [ -f $mico_nsd_pidfile ] \ + && kill -$1 `cat $mico_nsd_pidfile` + rc_nsd=$? + fi + [ $rc_micod -eq 0 -a $rc_nsd -eq 0 ] + } + +%status -u @l_rusr@ -o + mico_usable="unknown" + mico_active="no" + rcService mico enable yes && \ + ( rcVarIsYes mico_micod || rcVarIsYes mico_nsd ) && \ + mico_signal 0 && mico_active="yes" + echo "mico_enable=\"$mico_enable\"" + echo "mico_usable=\"$mico_usable\"" + echo "mico_active=\"$mico_active\"" + +%start -u @l_rusr@ + rcService mico enable yes || exit 0 + rcService mico active yes && exit 0 + # run the object adapter daemon for dynamic object activation + if rcVarIsYes mico_micod; then + @l_prefix@/bin/micod ${mico_micod_args} & + echo $! >$mico_micod_pidfile + fi + # run the name service daemon for flexible object indexing + if rcVarIsYes mico_nsd; then + @l_prefix@/bin/nsd ${mico_nsd_args} & + echo $! >$mico_nsd_pidfile + fi + +%stop -u @l_rusr@ + rcService mico enable yes || exit 0 + rcService mico active no && exit 0 + mico_signal TERM + rm -f $mico_micod_pidfile 2>/dev/null || true + rm -f $mico_nsd_pidfile 2>/dev/null || true + +%restart -u @l_rusr@ + rcService mico enable yes || exit 0 + rcService mico active no && exit 0 + rc mico stop + sleep 2 + rc mico start +