Import original revisions from the OpenPKG project.

Mon, 15 Dec 2008 12:54:25 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 15 Dec 2008 12:54:25 +0100
changeset 5
3715407014ea
parent 4
7118aa4adf88
child 6
eab6243607cb

Import original revisions from the OpenPKG project.

mico/mico.spec file | annotate | diff | comparison | revisions
mico/rc.mico file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mico/mico.spec	Mon Dec 15 12:54:25 2008 +0100
     1.3 @@ -0,0 +1,231 @@
     1.4 +##
     1.5 +##  mico.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package information
    1.28 +Name:         mico
    1.29 +Summary:      CORBA Toolkit
    1.30 +URL:          http://www.mico.org/
    1.31 +Vendor:       The MICO Project
    1.32 +Packager:     OpenPKG Foundation e.V.
    1.33 +Distribution: OpenPKG Community
    1.34 +Class:        PLUS
    1.35 +Group:        RPC
    1.36 +License:      LGPL/GPL
    1.37 +Version:      2.3.12
    1.38 +Release:      20080101
    1.39 +
    1.40 +#   package options
    1.41 +%option       with_ssl      no
    1.42 +%option       with_x11      no
    1.43 +%option       with_qt       no
    1.44 +%option       with_gtk      no
    1.45 +%option       with_tcl      no
    1.46 +
    1.47 +#   list of sources
    1.48 +Source0:      http://www.mico.org/mico-%{version}.tar.gz
    1.49 +Source2:      rc.mico
    1.50 +
    1.51 +#   build information
    1.52 +Prefix:       %{l_prefix}
    1.53 +BuildRoot:    %{l_buildroot}
    1.54 +BuildPreReq:  OpenPKG, openpkg >= 20060823, gcc, make
    1.55 +PreReq:       OpenPKG, openpkg >= 20060823
    1.56 +%if "%{with_ssl}" == "yes"
    1.57 +BuildPreReq:  openssl
    1.58 +PreReq:       openssl
    1.59 +%endif
    1.60 +%if "%{with_x11}" == "yes"
    1.61 +BuildPreReq:  X11
    1.62 +PreReq:       X11
    1.63 +%endif
    1.64 +%if "%{with_qt}" == "yes"
    1.65 +BuildPreReq:  qt, pkgconfig
    1.66 +PreReq:       qt
    1.67 +%endif
    1.68 +%if "%{with_gtk}" == "yes"
    1.69 +BuildPreReq:  gtk
    1.70 +PreReq:       gtk
    1.71 +%endif
    1.72 +%if "%{with_tcl}" == "yes"
    1.73 +BuildPreReq:  tcl
    1.74 +PreReq:       tcl
    1.75 +%endif
    1.76 +AutoReq:      no
    1.77 +AutoReqProv:  no
    1.78 +
    1.79 +%description
    1.80 +    The acronym MICO expands to MICO Is CORBA. The intention of this
    1.81 +    project is to provide a freely available and fully compliant
    1.82 +    implementation of the CORBA standard. The following design
    1.83 +    principles guided the implementation of MICO:
    1.84 +    - Start from scratch, and only use standard APIs (Posix/Win32)
    1.85 +    - Don't rely on propietary or specialized libraries
    1.86 +    - Use standard C++ for the implementation
    1.87 +    - Only make use of widely available, free, non-proprietary tools
    1.88 +    - Only implement what is required for a CORBA compliant implementation
    1.89 +    - Provide a clear design even for implementation internals
    1.90 +
    1.91 +%track
    1.92 +    prog mico = {
    1.93 +        version   = %{version}
    1.94 +        url       = http://www.mico.org/down.html
    1.95 +        regex     = mico-(__VER__)\.tar\.gz
    1.96 +    }
    1.97 +
    1.98 +%prep
    1.99 +    %setup -q -n mico
   1.100 +
   1.101 +%build
   1.102 +    CC="%{l_cc}"
   1.103 +    CXX="%{l_cxx}"
   1.104 +    CFLAGS="%{l_cflags -O}"
   1.105 +    CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated"
   1.106 +    CPPFLAGS="%{l_cppflags}"
   1.107 +    includedir=""
   1.108 +%if "%{with_qt}" == "yes"
   1.109 +    CFLAGS="$CFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
   1.110 +    CXXFLAGS="$CXXFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
   1.111 +    CPPFLAGS="$CPPFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-I qt`"
   1.112 +    includedir="$includedir %{l_prefix}/include/qt"
   1.113 +    LDFLAGS="$LDFLAGS `%{l_prefix}/bin/pkg-config --libs-only-L qt`"
   1.114 +%endif
   1.115 +%if "%{with_ssl}" == "yes"
   1.116 +    includedir="$includedir %{l_prefix}/include/openssl"
   1.117 +%endif
   1.118 +%if "%{with_gtk}" == "yes"
   1.119 +    includedir="$includedir %{l_prefix}/include/gtk"
   1.120 +%endif
   1.121 +%if "%{with_tcl}" == "yes"
   1.122 +    includedir="$includedir %{l_prefix}/include/tcl"
   1.123 +%endif
   1.124 +    for dir in $includedir; do
   1.125 +        CPPFLAGS="$CPPFLAGS -I$dir"
   1.126 +    done
   1.127 +    LDFLAGS="%{l_ldflags}"
   1.128 +    JAVAC=no
   1.129 +    export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS JAVAC
   1.130 +    ./configure \
   1.131 +        --prefix=%{l_prefix} \
   1.132 +%if "%{with_ssl}" == "yes"
   1.133 +        --with-ssl=%{l_prefix} \
   1.134 +%endif
   1.135 +%if "%{with_x11}" == "yes"
   1.136 +        --with-x \
   1.137 +        --x-includes=`%{l_rc} --query x11_incdir` \
   1.138 +        --x-libraries=`%{l_rc} --query x11_libdir` \
   1.139 +%else
   1.140 +        --without-x \
   1.141 +%endif
   1.142 +%if "%{with_qt}" == "yes"
   1.143 +        --with-qt=%{l_prefix} \
   1.144 +%endif
   1.145 +%if "%{with_gtk}" == "yes"
   1.146 +        --with-gtk=%{l_prefix} \
   1.147 +%endif
   1.148 +%if "%{with_tcl}" == "yes"
   1.149 +        --with-tcl=%{l_prefix} \
   1.150 +%endif
   1.151 +        --disable-mini-stl \
   1.152 +        --disable-shared
   1.153 +    touch cpp/.depend
   1.154 +    %{l_make} %{l_mflags}
   1.155 +
   1.156 +%install
   1.157 +    rm -rf $RPM_BUILD_ROOT
   1.158 +
   1.159 +    #   make directory structure
   1.160 +    %{l_shtool} mkdir -f -p -m 755 \
   1.161 +        $RPM_BUILD_ROOT%{l_prefix}/bin \
   1.162 +        $RPM_BUILD_ROOT%{l_prefix}/lib \
   1.163 +        $RPM_BUILD_ROOT%{l_prefix}/include/mico \
   1.164 +        $RPM_BUILD_ROOT%{l_prefix}/include/coss \
   1.165 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
   1.166 +        $RPM_BUILD_ROOT%{l_prefix}/var/mico \
   1.167 +        $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
   1.168 +        $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
   1.169 +        $RPM_BUILD_ROOT%{l_prefix}/man/man8
   1.170 +
   1.171 +    #   install binaries, libraries, headers
   1.172 +    %{l_make} %{l_mflags} install \
   1.173 +        INSTDIR=$RPM_BUILD_ROOT%{l_prefix} \
   1.174 +        SHARED_INSTDIR=$RPM_BUILD_ROOT%{l_prefix}
   1.175 +
   1.176 +    #   install our own things
   1.177 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.178 +        %{SOURCE rc.mico} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.179 +
   1.180 +    #   cleanup installation files
   1.181 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc
   1.182 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/ministl
   1.183 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/mico-setup.*
   1.184 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   1.185 +    mv  $RPM_BUILD_ROOT%{l_prefix}/man/man8/nsd.8 \
   1.186 +        $RPM_BUILD_ROOT%{l_prefix}/man/man8/mico-nsd.8
   1.187 +    ( cd $RPM_BUILD_ROOT%{l_prefix}/lib
   1.188 +      for name in mico micoaux micocoss micoir; do
   1.189 +          mv lib${name}%{version}.a lib${name}.a
   1.190 +      done
   1.191 +%if "%{with_x11}" == "yes"
   1.192 +      mv libmicox%{version}.a libmicox.a
   1.193 +%endif
   1.194 +%if "%{with_qt}" == "yes"
   1.195 +      mv libmicoqt%{version}.a libmicoqt.a
   1.196 +%endif
   1.197 +%if "%{with_gtk}" == "yes"
   1.198 +      mv libmicogtk%{version}.a libmicogtk.a
   1.199 +%endif
   1.200 +%if "%{with_tcl}" == "yes"
   1.201 +      mv libmicotcl%{version}.a libmicotcl.a
   1.202 +%endif
   1.203 +    ) || exit $?
   1.204 +
   1.205 +    #   generate files listing
   1.206 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
   1.207 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mico'
   1.208 +
   1.209 +%files -f files
   1.210 +
   1.211 +%clean
   1.212 +    rm -rf $RPM_BUILD_ROOT
   1.213 +
   1.214 +%pre
   1.215 +    #   before upgrade, save status and stop service
   1.216 +    [ $1 -eq 2 ] || exit 0
   1.217 +    eval `%{l_rc} mico status 2>/dev/null | tee %{l_tmpfile}`
   1.218 +    %{l_rc} mico stop 2>/dev/null
   1.219 +    exit 0
   1.220 +
   1.221 +%post
   1.222 +    if [ $1 -eq 2 ]; then
   1.223 +        #   after upgrade, restore status
   1.224 +        eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
   1.225 +        [ ".$mico_active" = .yes ] && %{l_rc} mico start
   1.226 +    fi
   1.227 +    exit 0
   1.228 +
   1.229 +%preun
   1.230 +    #   before erase, stop service
   1.231 +    [ $1 -eq 0 ] || exit 0
   1.232 +    %{l_rc} mico stop 2>/dev/null
   1.233 +    exit 0
   1.234 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/mico/rc.mico	Mon Dec 15 12:54:25 2008 +0100
     2.3 @@ -0,0 +1,71 @@
     2.4 +#!@l_prefix@/bin/openpkg rc
     2.5 +##
     2.6 +##  rc.mico -- Run-Commands
     2.7 +##
     2.8 +
     2.9 +%config
    2.10 +    mico_enable="$openpkg_rc_def"
    2.11 +    mico_micod="no"
    2.12 +    mico_nsd="no"
    2.13 +    mico_ip_micod="127.0.0.1"
    2.14 +    mico_ip_nsd="127.0.0.1"
    2.15 +    mico_micod_args="-ORBGIOPVersion 1.2 -ORBIIOPVersion 1.2 -ORBIIOPAddr inet:${mico_ip_micod}:8912"
    2.16 +    mico_nsd_args="-ORBGIOPVersion 1.2 -ORBIIOPVersion 1.2 -ORBIIOPAddr inet:${mico_ip_nsd}:8914"
    2.17 +
    2.18 +%common
    2.19 +    mico_micod_pidfile="@l_prefix@/var/mico/micod.pid"
    2.20 +    mico_nsd_pidfile="@l_prefix@/var/mico/nsd.pid"
    2.21 +    mico_signal () {
    2.22 +        local rc_micod=0
    2.23 +        local rc_nsd=0
    2.24 +        if rcVarIsYes mico_micod; then
    2.25 +            [ -f $mico_micod_pidfile ] \
    2.26 +            && kill -$1 `cat $mico_micod_pidfile`
    2.27 +            rc_micod=$?
    2.28 +        fi
    2.29 +        if rcVarIsYes mico_nsd; then
    2.30 +            [ -f $mico_nsd_pidfile ] \
    2.31 +            && kill -$1 `cat $mico_nsd_pidfile`
    2.32 +            rc_nsd=$?
    2.33 +        fi
    2.34 +        [ $rc_micod -eq 0 -a $rc_nsd -eq 0 ]
    2.35 +    }
    2.36 +
    2.37 +%status -u @l_rusr@ -o
    2.38 +    mico_usable="unknown"
    2.39 +    mico_active="no"
    2.40 +    rcService mico enable yes && \
    2.41 +        ( rcVarIsYes mico_micod || rcVarIsYes mico_nsd ) && \
    2.42 +        mico_signal 0 && mico_active="yes"
    2.43 +    echo "mico_enable=\"$mico_enable\""
    2.44 +    echo "mico_usable=\"$mico_usable\""
    2.45 +    echo "mico_active=\"$mico_active\""
    2.46 +
    2.47 +%start -u @l_rusr@
    2.48 +    rcService mico enable yes || exit 0
    2.49 +    rcService mico active yes && exit 0
    2.50 +    #   run the object adapter daemon for dynamic object activation
    2.51 +    if rcVarIsYes mico_micod; then
    2.52 +        @l_prefix@/bin/micod ${mico_micod_args} &
    2.53 +        echo $! >$mico_micod_pidfile
    2.54 +    fi
    2.55 +    #   run the name service daemon for flexible object indexing
    2.56 +    if rcVarIsYes mico_nsd; then
    2.57 +        @l_prefix@/bin/nsd ${mico_nsd_args} &
    2.58 +        echo $! >$mico_nsd_pidfile
    2.59 +    fi
    2.60 +
    2.61 +%stop -u @l_rusr@
    2.62 +    rcService mico enable yes || exit 0
    2.63 +    rcService mico active no && exit 0
    2.64 +    mico_signal TERM
    2.65 +    rm -f $mico_micod_pidfile 2>/dev/null || true
    2.66 +    rm -f $mico_nsd_pidfile 2>/dev/null || true
    2.67 +
    2.68 +%restart -u @l_rusr@
    2.69 +    rcService mico enable yes || exit 0
    2.70 +    rcService mico active no && exit 0
    2.71 +    rc mico stop
    2.72 +    sleep 2
    2.73 +    rc mico start
    2.74 +

mercurial