mico/mico.spec

Sun, 02 Sep 2012 18:18:43 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 02 Sep 2012 18:18:43 +0200
changeset 659
79e32993cb4d
parent 85
e6a1cd7ed6ba
permissions
-rw-r--r--

Introduce new version of tcpdump, reorder taglib and cryptbreaker to
the end because they fail to build on Linux, and correct flawed URLs
probably copied from the doxygen build entry.

michael@5 1 ##
michael@5 2 ## mico.spec -- OpenPKG RPM Package Specification
michael@5 3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@5 4 ##
michael@5 5 ## Permission to use, copy, modify, and distribute this software for
michael@5 6 ## any purpose with or without fee is hereby granted, provided that
michael@5 7 ## the above copyright notice and this permission notice appear in all
michael@5 8 ## copies.
michael@5 9 ##
michael@5 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@5 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@5 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@5 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@5 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@5 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@5 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@5 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@5 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@5 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@5 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@5 21 ## SUCH DAMAGE.
michael@5 22 ##
michael@5 23
michael@5 24 # package information
michael@5 25 Name: mico
michael@5 26 Summary: CORBA Toolkit
michael@5 27 URL: http://www.mico.org/
michael@5 28 Vendor: The MICO Project
michael@5 29 Packager: OpenPKG Foundation e.V.
michael@5 30 Distribution: OpenPKG Community
michael@5 31 Class: PLUS
michael@5 32 Group: RPC
michael@5 33 License: LGPL/GPL
michael@6 34 Version: 2.3.13
michael@628 35 Release: 20120800
michael@5 36
michael@5 37 # package options
michael@5 38 %option with_ssl no
michael@5 39 %option with_x11 no
michael@5 40 %option with_qt no
michael@5 41 %option with_gtk no
michael@5 42 %option with_tcl no
michael@5 43
michael@5 44 # list of sources
michael@5 45 Source0: http://www.mico.org/mico-%{version}.tar.gz
michael@5 46 Source2: rc.mico
michael@5 47
michael@5 48 # build information
michael@628 49 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, gcc::with_cxx = yes
michael@628 50 PreReq: OpenPKG, openpkg >= 20100101
michael@5 51 %if "%{with_ssl}" == "yes"
michael@5 52 BuildPreReq: openssl
michael@5 53 PreReq: openssl
michael@5 54 %endif
michael@5 55 %if "%{with_x11}" == "yes"
michael@5 56 BuildPreReq: X11
michael@5 57 PreReq: X11
michael@5 58 %endif
michael@5 59 %if "%{with_qt}" == "yes"
michael@6 60 BuildPreReq: qt < 4, pkgconfig
michael@6 61 PreReq: qt < 4
michael@5 62 %endif
michael@5 63 %if "%{with_gtk}" == "yes"
michael@5 64 BuildPreReq: gtk
michael@5 65 PreReq: gtk
michael@5 66 %endif
michael@5 67 %if "%{with_tcl}" == "yes"
michael@5 68 BuildPreReq: tcl
michael@5 69 PreReq: tcl
michael@5 70 %endif
michael@5 71
michael@5 72 %description
michael@5 73 The acronym MICO expands to MICO Is CORBA. The intention of this
michael@5 74 project is to provide a freely available and fully compliant
michael@5 75 implementation of the CORBA standard. The following design
michael@5 76 principles guided the implementation of MICO:
michael@5 77 - Start from scratch, and only use standard APIs (Posix/Win32)
michael@5 78 - Don't rely on propietary or specialized libraries
michael@5 79 - Use standard C++ for the implementation
michael@5 80 - Only make use of widely available, free, non-proprietary tools
michael@5 81 - Only implement what is required for a CORBA compliant implementation
michael@5 82 - Provide a clear design even for implementation internals
michael@5 83
michael@5 84 %track
michael@5 85 prog mico = {
michael@5 86 version = %{version}
michael@5 87 url = http://www.mico.org/down.html
michael@5 88 regex = mico-(__VER__)\.tar\.gz
michael@5 89 }
michael@5 90
michael@5 91 %prep
michael@5 92 %setup -q -n mico
michael@628 93 %{l_shtool} subst \
michael@628 94 -e '/#include <mico\/impl.h>/a#include "limits.h"' \
michael@628 95 orb/fast_array.cc
michael@5 96
michael@5 97 %build
michael@5 98 CC="%{l_cc}"
michael@5 99 CXX="%{l_cxx}"
michael@5 100 CFLAGS="%{l_cflags -O}"
michael@5 101 CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated"
michael@5 102 CPPFLAGS="%{l_cppflags}"
michael@5 103 includedir=""
michael@5 104 %if "%{with_qt}" == "yes"
michael@5 105 CFLAGS="$CFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
michael@5 106 CXXFLAGS="$CXXFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
michael@5 107 CPPFLAGS="$CPPFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-I qt`"
michael@5 108 includedir="$includedir %{l_prefix}/include/qt"
michael@5 109 LDFLAGS="$LDFLAGS `%{l_prefix}/bin/pkg-config --libs-only-L qt`"
michael@5 110 %endif
michael@5 111 %if "%{with_ssl}" == "yes"
michael@5 112 includedir="$includedir %{l_prefix}/include/openssl"
michael@5 113 %endif
michael@5 114 %if "%{with_gtk}" == "yes"
michael@5 115 includedir="$includedir %{l_prefix}/include/gtk"
michael@5 116 %endif
michael@5 117 %if "%{with_tcl}" == "yes"
michael@5 118 includedir="$includedir %{l_prefix}/include/tcl"
michael@5 119 %endif
michael@5 120 for dir in $includedir; do
michael@5 121 CPPFLAGS="$CPPFLAGS -I$dir"
michael@5 122 done
michael@5 123 LDFLAGS="%{l_ldflags}"
michael@5 124 JAVAC=no
michael@5 125 export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS JAVAC
michael@5 126 ./configure \
michael@5 127 --prefix=%{l_prefix} \
michael@5 128 %if "%{with_ssl}" == "yes"
michael@5 129 --with-ssl=%{l_prefix} \
michael@5 130 %endif
michael@5 131 %if "%{with_x11}" == "yes"
michael@5 132 --with-x \
michael@5 133 --x-includes=`%{l_rc} --query x11_incdir` \
michael@5 134 --x-libraries=`%{l_rc} --query x11_libdir` \
michael@5 135 %else
michael@5 136 --without-x \
michael@5 137 %endif
michael@5 138 %if "%{with_qt}" == "yes"
michael@5 139 --with-qt=%{l_prefix} \
michael@5 140 %endif
michael@5 141 %if "%{with_gtk}" == "yes"
michael@5 142 --with-gtk=%{l_prefix} \
michael@5 143 %endif
michael@5 144 %if "%{with_tcl}" == "yes"
michael@5 145 --with-tcl=%{l_prefix} \
michael@5 146 %endif
michael@5 147 --disable-mini-stl \
michael@5 148 --disable-shared
michael@5 149 touch cpp/.depend
michael@6 150 %{l_make} %{l_mflags -O}
michael@5 151
michael@5 152 %install
michael@5 153 # make directory structure
michael@5 154 %{l_shtool} mkdir -f -p -m 755 \
michael@5 155 $RPM_BUILD_ROOT%{l_prefix}/bin \
michael@5 156 $RPM_BUILD_ROOT%{l_prefix}/lib \
michael@5 157 $RPM_BUILD_ROOT%{l_prefix}/include/mico \
michael@5 158 $RPM_BUILD_ROOT%{l_prefix}/include/coss \
michael@5 159 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@5 160 $RPM_BUILD_ROOT%{l_prefix}/var/mico \
michael@5 161 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
michael@5 162 $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
michael@5 163 $RPM_BUILD_ROOT%{l_prefix}/man/man8
michael@5 164
michael@5 165 # install binaries, libraries, headers
michael@5 166 %{l_make} %{l_mflags} install \
michael@6 167 LDCONFIG=true \
michael@5 168 INSTDIR=$RPM_BUILD_ROOT%{l_prefix} \
michael@5 169 SHARED_INSTDIR=$RPM_BUILD_ROOT%{l_prefix}
michael@5 170
michael@5 171 # install our own things
michael@5 172 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@5 173 %{SOURCE rc.mico} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@5 174
michael@5 175 # cleanup installation files
michael@5 176 rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc
michael@5 177 rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/ministl
michael@5 178 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mico-setup.*
michael@5 179 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@5 180 ( cd $RPM_BUILD_ROOT%{l_prefix}/lib
michael@5 181 for name in mico micoaux micocoss micoir; do
michael@5 182 mv lib${name}%{version}.a lib${name}.a
michael@5 183 done
michael@5 184 %if "%{with_x11}" == "yes"
michael@5 185 mv libmicox%{version}.a libmicox.a
michael@5 186 %endif
michael@5 187 %if "%{with_qt}" == "yes"
michael@5 188 mv libmicoqt%{version}.a libmicoqt.a
michael@5 189 %endif
michael@5 190 %if "%{with_gtk}" == "yes"
michael@5 191 mv libmicogtk%{version}.a libmicogtk.a
michael@5 192 %endif
michael@5 193 %if "%{with_tcl}" == "yes"
michael@5 194 mv libmicotcl%{version}.a libmicotcl.a
michael@5 195 %endif
michael@5 196 ) || exit $?
michael@5 197
michael@5 198 # generate files listing
michael@5 199 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
michael@5 200 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mico'
michael@5 201
michael@5 202 %files -f files
michael@5 203
michael@5 204 %clean
michael@5 205
michael@5 206 %pre
michael@5 207 # before upgrade, save status and stop service
michael@5 208 [ $1 -eq 2 ] || exit 0
michael@5 209 eval `%{l_rc} mico status 2>/dev/null | tee %{l_tmpfile}`
michael@5 210 %{l_rc} mico stop 2>/dev/null
michael@5 211 exit 0
michael@5 212
michael@5 213 %post
michael@5 214 if [ $1 -eq 2 ]; then
michael@5 215 # after upgrade, restore status
michael@5 216 eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
michael@5 217 [ ".$mico_active" = .yes ] && %{l_rc} mico start
michael@5 218 fi
michael@5 219 exit 0
michael@5 220
michael@5 221 %preun
michael@5 222 # before erase, stop service
michael@5 223 [ $1 -eq 0 ] || exit 0
michael@5 224 %{l_rc} mico stop 2>/dev/null
michael@5 225 exit 0
michael@5 226

mercurial