diff -r ffb537ebcb0a -r ce0d31e18b66 libgdiplus/libgdiplus.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgdiplus/libgdiplus.spec Sun Jan 11 00:48:38 2009 +0100 @@ -0,0 +1,146 @@ +## +## libgdiplus.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2009 Michael Schloh von Bennewitz +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package information +Name: libgdiplus +Summary: Unix GDI+ Development API +URL: http://www.mono-project.com/Libgdiplus +Packager: Michael Schloh von Bennewitz +Distribution: Europalab Production +Class: EVAL +Group: XWindow +License: MIT X11 +Version: 2.0 +Release: 20090106 + +# build options +%option with_shared no + +# list of sources +Source0: ftp://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-%{version}.tar.bz2 + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20040130, zlib, glib2, X11, xrender +BuildPreReq: cairo, fontconfig, freetype, giflib, jpeg, png, tiff +PreReq: OpenPKG, openpkg >= 20040130, zlib, glib2, X11, xrender +PreReq: cairo, fontconfig, freetype, giflib, jpeg, png, tiff +AutoReq: no +AutoReqProv: no +Conflicts: pnet + +%description + The Graphics Device Interface Plus (GDI+) development API exposes + abstract graphics and formatted text logic. The calling process + may write to those devices for which the GDI+ has a device driver, + such as a video display or printer. + +%track + prog libgdiplus = { + version = %{version} + url = ftp://ftp.novell.com/pub/mono/sources/libgdiplus/ + regex = libgdiplus-(\d+\.\d+)\.tar\.bz2 + } + +%prep + # unpack sources + %setup -q + + # remove subdirectory builds to assure internal library usage + rm -rf cairo + + # correct flaws in the build configuration + %{l_shtool} subst \ + -e 's;\(libexif_pkgconfig=\)\("No\.[^"]*"\);\1no \&\& echo \2;g' \ + configure + %{l_shtool} subst \ + -e 's;^\(SUBDIRS\) *= *@CAIRO_DIR@ src tests;\1=src tests;' \ + Makefile.in + +%build + # detect X11 paths + x11_incdir=`%{l_rc} --query x11_incdir` + x11_libdir=`%{l_rc} --query x11_libdir` + +%if "%{with_shared}" == "yes" + # configure shared library + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags tiff} -I${x11_incdir}" \ + LDFLAGS="%{l_ldflags}" \ + ./configure \ + --prefix=%{l_prefix} \ + --with-cairo=installed \ + --without-libexif \ + --disable-static \ + --enable-shared \ + --with-gnu-ld + + # build shared library + %{l_make} %{l_mflags -O} + + # install early, as we delete to build again + %{l_shtool} mkdir -f -p -m 755 gdidyn + mv src/.libs/libgdiplus* gdidyn/ + + # reset build configuration + %{l_make} %{l_mflags} distclean +%endif + + # configure static library + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags tiff} -I${x11_incdir}" \ + LDFLAGS="%{l_ldflags}" \ + ./configure \ + --prefix=%{l_prefix} \ + --with-cairo=installed \ + --without-libexif \ + --enable-static \ + --disable-shared \ + --with-gnu-ld + + # build static library + %{l_make} %{l_mflags -O} + +%install + # install static library + rm -rf $RPM_BUILD_ROOT + %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT" + +%if "%{with_shared}" == "yes" + # install shared library + %{l_tar} cf - gdidyn | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib +%endif + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + '%not %dir %{l_prefix}/lib/pkgconfig' + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT +