michael@5: ##
michael@5: ## mico.spec -- OpenPKG RPM Package Specification
michael@5: ## Copyright (c) 2000-2008 OpenPKG Foundation e.V.
michael@5: ##
michael@5: ## Permission to use, copy, modify, and distribute this software for
michael@5: ## any purpose with or without fee is hereby granted, provided that
michael@5: ## the above copyright notice and this permission notice appear in all
michael@5: ## copies.
michael@5: ##
michael@5: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@5: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@5: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@5: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@5: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@5: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@5: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@5: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@5: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@5: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@5: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@5: ## SUCH DAMAGE.
michael@5: ##
michael@5:
michael@5: # package information
michael@5: Name: mico
michael@5: Summary: CORBA Toolkit
michael@5: URL: http://www.mico.org/
michael@5: Vendor: The MICO Project
michael@5: Packager: OpenPKG Foundation e.V.
michael@5: Distribution: OpenPKG Community
michael@5: Class: PLUS
michael@5: Group: RPC
michael@5: License: LGPL/GPL
michael@6: Version: 2.3.13
michael@628: Release: 20120800
michael@5:
michael@5: # package options
michael@5: %option with_ssl no
michael@5: %option with_x11 no
michael@5: %option with_qt no
michael@5: %option with_gtk no
michael@5: %option with_tcl no
michael@5:
michael@5: # list of sources
michael@5: Source0: http://www.mico.org/mico-%{version}.tar.gz
michael@5: Source2: rc.mico
michael@5:
michael@5: # build information
michael@628: BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, gcc::with_cxx = yes
michael@628: PreReq: OpenPKG, openpkg >= 20100101
michael@5: %if "%{with_ssl}" == "yes"
michael@5: BuildPreReq: openssl
michael@5: PreReq: openssl
michael@5: %endif
michael@5: %if "%{with_x11}" == "yes"
michael@5: BuildPreReq: X11
michael@5: PreReq: X11
michael@5: %endif
michael@5: %if "%{with_qt}" == "yes"
michael@6: BuildPreReq: qt < 4, pkgconfig
michael@6: PreReq: qt < 4
michael@5: %endif
michael@5: %if "%{with_gtk}" == "yes"
michael@5: BuildPreReq: gtk
michael@5: PreReq: gtk
michael@5: %endif
michael@5: %if "%{with_tcl}" == "yes"
michael@5: BuildPreReq: tcl
michael@5: PreReq: tcl
michael@5: %endif
michael@5:
michael@5: %description
michael@5: The acronym MICO expands to MICO Is CORBA. The intention of this
michael@5: project is to provide a freely available and fully compliant
michael@5: implementation of the CORBA standard. The following design
michael@5: principles guided the implementation of MICO:
michael@5: - Start from scratch, and only use standard APIs (Posix/Win32)
michael@5: - Don't rely on propietary or specialized libraries
michael@5: - Use standard C++ for the implementation
michael@5: - Only make use of widely available, free, non-proprietary tools
michael@5: - Only implement what is required for a CORBA compliant implementation
michael@5: - Provide a clear design even for implementation internals
michael@5:
michael@5: %track
michael@5: prog mico = {
michael@5: version = %{version}
michael@5: url = http://www.mico.org/down.html
michael@5: regex = mico-(__VER__)\.tar\.gz
michael@5: }
michael@5:
michael@5: %prep
michael@5: %setup -q -n mico
michael@628: %{l_shtool} subst \
michael@628: -e '/#include /a#include "limits.h"' \
michael@628: orb/fast_array.cc
michael@5:
michael@5: %build
michael@5: CC="%{l_cc}"
michael@5: CXX="%{l_cxx}"
michael@5: CFLAGS="%{l_cflags -O}"
michael@5: CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated"
michael@5: CPPFLAGS="%{l_cppflags}"
michael@5: includedir=""
michael@5: %if "%{with_qt}" == "yes"
michael@5: CFLAGS="$CFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
michael@5: CXXFLAGS="$CXXFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
michael@5: CPPFLAGS="$CPPFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-I qt`"
michael@5: includedir="$includedir %{l_prefix}/include/qt"
michael@5: LDFLAGS="$LDFLAGS `%{l_prefix}/bin/pkg-config --libs-only-L qt`"
michael@5: %endif
michael@5: %if "%{with_ssl}" == "yes"
michael@5: includedir="$includedir %{l_prefix}/include/openssl"
michael@5: %endif
michael@5: %if "%{with_gtk}" == "yes"
michael@5: includedir="$includedir %{l_prefix}/include/gtk"
michael@5: %endif
michael@5: %if "%{with_tcl}" == "yes"
michael@5: includedir="$includedir %{l_prefix}/include/tcl"
michael@5: %endif
michael@5: for dir in $includedir; do
michael@5: CPPFLAGS="$CPPFLAGS -I$dir"
michael@5: done
michael@5: LDFLAGS="%{l_ldflags}"
michael@5: JAVAC=no
michael@5: export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS JAVAC
michael@5: ./configure \
michael@5: --prefix=%{l_prefix} \
michael@5: %if "%{with_ssl}" == "yes"
michael@5: --with-ssl=%{l_prefix} \
michael@5: %endif
michael@5: %if "%{with_x11}" == "yes"
michael@5: --with-x \
michael@5: --x-includes=`%{l_rc} --query x11_incdir` \
michael@5: --x-libraries=`%{l_rc} --query x11_libdir` \
michael@5: %else
michael@5: --without-x \
michael@5: %endif
michael@5: %if "%{with_qt}" == "yes"
michael@5: --with-qt=%{l_prefix} \
michael@5: %endif
michael@5: %if "%{with_gtk}" == "yes"
michael@5: --with-gtk=%{l_prefix} \
michael@5: %endif
michael@5: %if "%{with_tcl}" == "yes"
michael@5: --with-tcl=%{l_prefix} \
michael@5: %endif
michael@5: --disable-mini-stl \
michael@5: --disable-shared
michael@5: touch cpp/.depend
michael@6: %{l_make} %{l_mflags -O}
michael@5:
michael@5: %install
michael@5: # make directory structure
michael@5: %{l_shtool} mkdir -f -p -m 755 \
michael@5: $RPM_BUILD_ROOT%{l_prefix}/bin \
michael@5: $RPM_BUILD_ROOT%{l_prefix}/lib \
michael@5: $RPM_BUILD_ROOT%{l_prefix}/include/mico \
michael@5: $RPM_BUILD_ROOT%{l_prefix}/include/coss \
michael@5: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@5: $RPM_BUILD_ROOT%{l_prefix}/var/mico \
michael@5: $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
michael@5: $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
michael@5: $RPM_BUILD_ROOT%{l_prefix}/man/man8
michael@5:
michael@5: # install binaries, libraries, headers
michael@5: %{l_make} %{l_mflags} install \
michael@6: LDCONFIG=true \
michael@5: INSTDIR=$RPM_BUILD_ROOT%{l_prefix} \
michael@5: SHARED_INSTDIR=$RPM_BUILD_ROOT%{l_prefix}
michael@5:
michael@5: # install our own things
michael@5: %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@5: %{SOURCE rc.mico} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@5:
michael@5: # cleanup installation files
michael@5: rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc
michael@5: rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/ministl
michael@5: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mico-setup.*
michael@5: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@5: ( cd $RPM_BUILD_ROOT%{l_prefix}/lib
michael@5: for name in mico micoaux micocoss micoir; do
michael@5: mv lib${name}%{version}.a lib${name}.a
michael@5: done
michael@5: %if "%{with_x11}" == "yes"
michael@5: mv libmicox%{version}.a libmicox.a
michael@5: %endif
michael@5: %if "%{with_qt}" == "yes"
michael@5: mv libmicoqt%{version}.a libmicoqt.a
michael@5: %endif
michael@5: %if "%{with_gtk}" == "yes"
michael@5: mv libmicogtk%{version}.a libmicogtk.a
michael@5: %endif
michael@5: %if "%{with_tcl}" == "yes"
michael@5: mv libmicotcl%{version}.a libmicotcl.a
michael@5: %endif
michael@5: ) || exit $?
michael@5:
michael@5: # generate files listing
michael@5: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
michael@5: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mico'
michael@5:
michael@5: %files -f files
michael@5:
michael@5: %clean
michael@5:
michael@5: %pre
michael@5: # before upgrade, save status and stop service
michael@5: [ $1 -eq 2 ] || exit 0
michael@5: eval `%{l_rc} mico status 2>/dev/null | tee %{l_tmpfile}`
michael@5: %{l_rc} mico stop 2>/dev/null
michael@5: exit 0
michael@5:
michael@5: %post
michael@5: if [ $1 -eq 2 ]; then
michael@5: # after upgrade, restore status
michael@5: eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
michael@5: [ ".$mico_active" = .yes ] && %{l_rc} mico start
michael@5: fi
michael@5: exit 0
michael@5:
michael@5: %preun
michael@5: # before erase, stop service
michael@5: [ $1 -eq 0 ] || exit 0
michael@5: %{l_rc} mico stop 2>/dev/null
michael@5: exit 0
michael@5: