OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Michael Schloh
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 18-Jan-2005 19:21:45
Branch: HEAD Handle: 2005011818214500
Modified files:
openpkg-src/tiff tiff.spec
Log:
do not use C++ ios unless explicitly instructed to build stream
components with new with_cxx option (solves implicit libstdc++ link
problem in other packages like gtk2/gimp)
Summary:
Revision Changes Path
1.40 +61 -1 openpkg-src/tiff/tiff.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/tiff/tiff.spec
============================================================================
$ cvs diff -u -r1.39 -r1.40 tiff.spec
--- openpkg-src/tiff/tiff.spec 1 Jan 2005 10:55:19 -0000 1.39
+++ openpkg-src/tiff/tiff.spec 18 Jan 2005 18:21:45 -0000 1.40
@@ -34,7 +34,10 @@
Group: Graphics
License: GPL
Version: 3.7.1
-Release: 20041222
+Release: 20050118
+
+# package library options (a 'yes' builds both libtiff and libtiff_cxx)
+%option with_cxx no
# list of sources
Source0: ftp://ftp.remotesensing.org/pub/libtiff/tiff-%{version}.tar.gz
@@ -46,6 +49,10 @@
PreReq: OpenPKG, openpkg >= 20040130
BuildPreReq: jpeg, zlib
PreReq: jpeg, zlib
+%if "%{with_cxx}" == "yes"
+BuildPreReq: gcc
+PreReq: gcc
+%endif
AutoReq: no
AutoReqProv: no
@@ -63,10 +70,52 @@
%prep
%setup -q
+ %{l_shtool} subst \
+ -e 's;enable_c++;enable_cxx;' \
+ -e 's;\[^-_$as_cr_alnum];[^+-_$as_cr_alnum];' \
+ -e 's;\(echo \$ac_feature | sed \)\(.\)\([^\`]*\);\1\2\3 | sed
\2s/+/x/g\2;g' \
+ configure
%build
+%if "%{with_cxx}" == "yes"
+ # conditionally build libtiff_cxx with C++ streams as user's request
+ CC="%{l_cc}" \
+ CXX="%{l_cxx}" \
+ CFLAGS="%{l_cflags -O}" \
+ CXXFLAGS="%{l_cxxflags -O}" \
+ CPPFLAGS="%{l_cppflags}" \
+ LDFLAGS="%{l_ldflags}" \
+ ./configure \
+ --prefix=%{l_prefix} \
+ --includedir=%{l_prefix}/include/tiff \
+ --disable-shared \
+ --enable-static \
+ --enable-c++ \
+ --with-zlib-include-dir=%{l_prefix}/include \
+ --with-zlib-lib-dir=%{l_prefix}/lib \
+ --with-jpeg-include-dir=%{l_prefix}/include \
+ --with-jpeg-lib-dir=%{l_prefix}/lib \
+ --without-x
+ %{l_make} %{l_mflags -O}
+
+ # save C++ library for later installation, and clean out the rest
+ %{l_shtool} mkdir -f -p -m 755 tmpcxx/.libs
+ mv libtiff/.libs/libtiff.a tmpcxx/.libs/libtiff_cxx.a
+ mv libtiff/.libs/libtiff.lai tmpcxx/.libs/libtiff_cxx.lai
+ mv libtiff/libtiff.la tmpcxx/libtiff_cxx.la
+ ln -s ../libtiff_cxx.la tmpcxx/.libs/libtiff_cxx.la
+ %{l_shtool} subst \
+ -e 's;libtiff;libtiff_cxx;g' \
+ tmpcxx/.libs/libtiff_cxx.lai \
+ tmpcxx/.libs/libtiff_cxx.la
+ %{l_make} %{l_mflags -O} distclean
+%endif
+
+ # unconditionally build libtiff without C++ streams
CC="%{l_cc}" \
+ CXX= \
CFLAGS="%{l_cflags -O}" \
+ CXXFLAGS= \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags}" \
./configure \
@@ -74,6 +123,8 @@
--includedir=%{l_prefix}/include/tiff \
--disable-shared \
--enable-static \
+ --disable-c++ \
+ --with-zlib-include-dir=%{l_prefix}/include \
--with-zlib-include-dir=%{l_prefix}/include \
--with-zlib-lib-dir=%{l_prefix}/lib \
--with-jpeg-include-dir=%{l_prefix}/include \
@@ -84,6 +135,15 @@
%install
rm -rf $RPM_BUILD_ROOT
%{l_make} %{l_mflags -O} install DESTDIR=$RPM_BUILD_ROOT
+%if "%{with_cxx}" == "yes"
+ # conditionally install libtiff_cxx just like the Makefile does
+ ( cd tmpcxx
+ ../libtool --mode=install \
+ `grep "^INSTALL =" ../libtiff/Makefile | %{l_shtool} subst -e
's;[^=]*= \(.*\)$;\1;'` \
+ libtiff_cxx.la \
+ $RPM_BUILD_ROOT%{l_prefix}/lib
+ ) || exit $?
+%endif
( cd $RPM_BUILD_ROOT%{l_prefix}/man/man3
for manpage in *.3tiff; do
base=`echo $manpage | sed -e 's;\.3tiff$;;'`
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]