Fri, 16 Jan 2009 10:58:21 +0100
Correct and improve code logic, buildconf, and packaging. In particular:
1. Use descriptive variable names <var>libs instead of just <var>.
2. Although Nokia states in all Qt builds that 'NOTE: When linking
against OpenSSL, you can override the default library names
through OPENSSL_LIBS.' and even gives an example, their own
configuration logic rejects such an attempt. Correct this by
hard coding the OpenSSL library string in the configure script.
3. Consistently use the whitespace substitution [\t ] throughout.
4. Patch the buggy INCPATH of SQL plugin Qmake project files.
5. Add the 'x11' configuration variable to the qtconfig Qmake
project using the src/gui/gui.pro file as a model. This is
needed for qtconfig although not in other tools, because
the qtconfig buildconf indirectly includes qt_x11_p.h which
is dependent on X11 headers.
6. Avoid 'ld.so: fatal: hardware capability unsupported: SSE2 AMD_3DNow'
on platforms for which the config.tests/unix/[3dnow|sse2] succeed
although unsopported at run time by testing for the x86-64
instruction set at build time and regulating hardware capabilities.
7. Correctly install the desinger plugin by explicitly building it.
8. Remove custom plugin installation logic which is unnecessary.
9. Correct removal of temporary paths from shared object files.
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@6 | 35 | Release: 20081215 |
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@5 | 49 | Prefix: %{l_prefix} |
michael@5 | 50 | BuildRoot: %{l_buildroot} |
michael@85 | 51 | BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, gcc::with_cxx = yes |
michael@5 | 52 | PreReq: OpenPKG, openpkg >= 20060823 |
michael@5 | 53 | %if "%{with_ssl}" == "yes" |
michael@5 | 54 | BuildPreReq: openssl |
michael@5 | 55 | PreReq: openssl |
michael@5 | 56 | %endif |
michael@5 | 57 | %if "%{with_x11}" == "yes" |
michael@5 | 58 | BuildPreReq: X11 |
michael@5 | 59 | PreReq: X11 |
michael@5 | 60 | %endif |
michael@5 | 61 | %if "%{with_qt}" == "yes" |
michael@6 | 62 | BuildPreReq: qt < 4, pkgconfig |
michael@6 | 63 | PreReq: qt < 4 |
michael@5 | 64 | %endif |
michael@5 | 65 | %if "%{with_gtk}" == "yes" |
michael@5 | 66 | BuildPreReq: gtk |
michael@5 | 67 | PreReq: gtk |
michael@5 | 68 | %endif |
michael@5 | 69 | %if "%{with_tcl}" == "yes" |
michael@5 | 70 | BuildPreReq: tcl |
michael@5 | 71 | PreReq: tcl |
michael@5 | 72 | %endif |
michael@5 | 73 | AutoReq: no |
michael@5 | 74 | AutoReqProv: no |
michael@5 | 75 | |
michael@5 | 76 | %description |
michael@5 | 77 | The acronym MICO expands to MICO Is CORBA. The intention of this |
michael@5 | 78 | project is to provide a freely available and fully compliant |
michael@5 | 79 | implementation of the CORBA standard. The following design |
michael@5 | 80 | principles guided the implementation of MICO: |
michael@5 | 81 | - Start from scratch, and only use standard APIs (Posix/Win32) |
michael@5 | 82 | - Don't rely on propietary or specialized libraries |
michael@5 | 83 | - Use standard C++ for the implementation |
michael@5 | 84 | - Only make use of widely available, free, non-proprietary tools |
michael@5 | 85 | - Only implement what is required for a CORBA compliant implementation |
michael@5 | 86 | - Provide a clear design even for implementation internals |
michael@5 | 87 | |
michael@5 | 88 | %track |
michael@5 | 89 | prog mico = { |
michael@5 | 90 | version = %{version} |
michael@5 | 91 | url = http://www.mico.org/down.html |
michael@5 | 92 | regex = mico-(__VER__)\.tar\.gz |
michael@5 | 93 | } |
michael@5 | 94 | |
michael@5 | 95 | %prep |
michael@5 | 96 | %setup -q -n mico |
michael@5 | 97 | |
michael@5 | 98 | %build |
michael@5 | 99 | CC="%{l_cc}" |
michael@5 | 100 | CXX="%{l_cxx}" |
michael@5 | 101 | CFLAGS="%{l_cflags -O}" |
michael@5 | 102 | CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated" |
michael@5 | 103 | CPPFLAGS="%{l_cppflags}" |
michael@5 | 104 | includedir="" |
michael@5 | 105 | %if "%{with_qt}" == "yes" |
michael@5 | 106 | CFLAGS="$CFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`" |
michael@5 | 107 | CXXFLAGS="$CXXFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`" |
michael@5 | 108 | CPPFLAGS="$CPPFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-I qt`" |
michael@5 | 109 | includedir="$includedir %{l_prefix}/include/qt" |
michael@5 | 110 | LDFLAGS="$LDFLAGS `%{l_prefix}/bin/pkg-config --libs-only-L qt`" |
michael@5 | 111 | %endif |
michael@5 | 112 | %if "%{with_ssl}" == "yes" |
michael@5 | 113 | includedir="$includedir %{l_prefix}/include/openssl" |
michael@5 | 114 | %endif |
michael@5 | 115 | %if "%{with_gtk}" == "yes" |
michael@5 | 116 | includedir="$includedir %{l_prefix}/include/gtk" |
michael@5 | 117 | %endif |
michael@5 | 118 | %if "%{with_tcl}" == "yes" |
michael@5 | 119 | includedir="$includedir %{l_prefix}/include/tcl" |
michael@5 | 120 | %endif |
michael@5 | 121 | for dir in $includedir; do |
michael@5 | 122 | CPPFLAGS="$CPPFLAGS -I$dir" |
michael@5 | 123 | done |
michael@5 | 124 | LDFLAGS="%{l_ldflags}" |
michael@5 | 125 | JAVAC=no |
michael@5 | 126 | export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS JAVAC |
michael@5 | 127 | ./configure \ |
michael@5 | 128 | --prefix=%{l_prefix} \ |
michael@5 | 129 | %if "%{with_ssl}" == "yes" |
michael@5 | 130 | --with-ssl=%{l_prefix} \ |
michael@5 | 131 | %endif |
michael@5 | 132 | %if "%{with_x11}" == "yes" |
michael@5 | 133 | --with-x \ |
michael@5 | 134 | --x-includes=`%{l_rc} --query x11_incdir` \ |
michael@5 | 135 | --x-libraries=`%{l_rc} --query x11_libdir` \ |
michael@5 | 136 | %else |
michael@5 | 137 | --without-x \ |
michael@5 | 138 | %endif |
michael@5 | 139 | %if "%{with_qt}" == "yes" |
michael@5 | 140 | --with-qt=%{l_prefix} \ |
michael@5 | 141 | %endif |
michael@5 | 142 | %if "%{with_gtk}" == "yes" |
michael@5 | 143 | --with-gtk=%{l_prefix} \ |
michael@5 | 144 | %endif |
michael@5 | 145 | %if "%{with_tcl}" == "yes" |
michael@5 | 146 | --with-tcl=%{l_prefix} \ |
michael@5 | 147 | %endif |
michael@5 | 148 | --disable-mini-stl \ |
michael@5 | 149 | --disable-shared |
michael@5 | 150 | touch cpp/.depend |
michael@6 | 151 | %{l_make} %{l_mflags -O} |
michael@5 | 152 | |
michael@5 | 153 | %install |
michael@5 | 154 | rm -rf $RPM_BUILD_ROOT |
michael@5 | 155 | |
michael@5 | 156 | # make directory structure |
michael@5 | 157 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@5 | 158 | $RPM_BUILD_ROOT%{l_prefix}/bin \ |
michael@5 | 159 | $RPM_BUILD_ROOT%{l_prefix}/lib \ |
michael@5 | 160 | $RPM_BUILD_ROOT%{l_prefix}/include/mico \ |
michael@5 | 161 | $RPM_BUILD_ROOT%{l_prefix}/include/coss \ |
michael@5 | 162 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
michael@5 | 163 | $RPM_BUILD_ROOT%{l_prefix}/var/mico \ |
michael@5 | 164 | $RPM_BUILD_ROOT%{l_prefix}/man/man1 \ |
michael@5 | 165 | $RPM_BUILD_ROOT%{l_prefix}/man/man5 \ |
michael@5 | 166 | $RPM_BUILD_ROOT%{l_prefix}/man/man8 |
michael@5 | 167 | |
michael@5 | 168 | # install binaries, libraries, headers |
michael@5 | 169 | %{l_make} %{l_mflags} install \ |
michael@6 | 170 | LDCONFIG=true \ |
michael@5 | 171 | INSTDIR=$RPM_BUILD_ROOT%{l_prefix} \ |
michael@5 | 172 | SHARED_INSTDIR=$RPM_BUILD_ROOT%{l_prefix} |
michael@5 | 173 | |
michael@5 | 174 | # install our own things |
michael@5 | 175 | %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
michael@5 | 176 | %{SOURCE rc.mico} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
michael@5 | 177 | |
michael@5 | 178 | # cleanup installation files |
michael@5 | 179 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc |
michael@5 | 180 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/ministl |
michael@5 | 181 | rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mico-setup.* |
michael@5 | 182 | strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
michael@5 | 183 | ( cd $RPM_BUILD_ROOT%{l_prefix}/lib |
michael@5 | 184 | for name in mico micoaux micocoss micoir; do |
michael@5 | 185 | mv lib${name}%{version}.a lib${name}.a |
michael@5 | 186 | done |
michael@5 | 187 | %if "%{with_x11}" == "yes" |
michael@5 | 188 | mv libmicox%{version}.a libmicox.a |
michael@5 | 189 | %endif |
michael@5 | 190 | %if "%{with_qt}" == "yes" |
michael@5 | 191 | mv libmicoqt%{version}.a libmicoqt.a |
michael@5 | 192 | %endif |
michael@5 | 193 | %if "%{with_gtk}" == "yes" |
michael@5 | 194 | mv libmicogtk%{version}.a libmicogtk.a |
michael@5 | 195 | %endif |
michael@5 | 196 | %if "%{with_tcl}" == "yes" |
michael@5 | 197 | mv libmicotcl%{version}.a libmicotcl.a |
michael@5 | 198 | %endif |
michael@5 | 199 | ) || exit $? |
michael@5 | 200 | |
michael@5 | 201 | # generate files listing |
michael@5 | 202 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ |
michael@5 | 203 | '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mico' |
michael@5 | 204 | |
michael@5 | 205 | %files -f files |
michael@5 | 206 | |
michael@5 | 207 | %clean |
michael@5 | 208 | rm -rf $RPM_BUILD_ROOT |
michael@5 | 209 | |
michael@5 | 210 | %pre |
michael@5 | 211 | # before upgrade, save status and stop service |
michael@5 | 212 | [ $1 -eq 2 ] || exit 0 |
michael@5 | 213 | eval `%{l_rc} mico status 2>/dev/null | tee %{l_tmpfile}` |
michael@5 | 214 | %{l_rc} mico stop 2>/dev/null |
michael@5 | 215 | exit 0 |
michael@5 | 216 | |
michael@5 | 217 | %post |
michael@5 | 218 | if [ $1 -eq 2 ]; then |
michael@5 | 219 | # after upgrade, restore status |
michael@5 | 220 | eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} |
michael@5 | 221 | [ ".$mico_active" = .yes ] && %{l_rc} mico start |
michael@5 | 222 | fi |
michael@5 | 223 | exit 0 |
michael@5 | 224 | |
michael@5 | 225 | %preun |
michael@5 | 226 | # before erase, stop service |
michael@5 | 227 | [ $1 -eq 0 ] || exit 0 |
michael@5 | 228 | %{l_rc} mico stop 2>/dev/null |
michael@5 | 229 | exit 0 |
michael@5 | 230 |