Sun, 11 Jan 2009 00:48:38 +0100
Import new package spec for introduction into repository.
michael@67 | 1 | ## |
michael@67 | 2 | ## libgdiplus.spec -- OpenPKG RPM Package Specification |
michael@67 | 3 | ## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com> |
michael@67 | 4 | ## |
michael@67 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@67 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@67 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@67 | 8 | ## copies. |
michael@67 | 9 | ## |
michael@67 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@67 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@67 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@67 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@67 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@67 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@67 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@67 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@67 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@67 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@67 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@67 | 21 | ## SUCH DAMAGE. |
michael@67 | 22 | ## |
michael@67 | 23 | |
michael@67 | 24 | # package information |
michael@67 | 25 | Name: libgdiplus |
michael@67 | 26 | Summary: Unix GDI+ Development API |
michael@67 | 27 | URL: http://www.mono-project.com/Libgdiplus |
michael@67 | 28 | Packager: Michael Schloh von Bennewitz |
michael@67 | 29 | Distribution: Europalab Production |
michael@67 | 30 | Class: EVAL |
michael@67 | 31 | Group: XWindow |
michael@67 | 32 | License: MIT X11 |
michael@67 | 33 | Version: 2.0 |
michael@67 | 34 | Release: 20090106 |
michael@67 | 35 | |
michael@67 | 36 | # build options |
michael@67 | 37 | %option with_shared no |
michael@67 | 38 | |
michael@67 | 39 | # list of sources |
michael@67 | 40 | Source0: ftp://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-%{version}.tar.bz2 |
michael@67 | 41 | |
michael@67 | 42 | # build information |
michael@67 | 43 | Prefix: %{l_prefix} |
michael@67 | 44 | BuildRoot: %{l_buildroot} |
michael@67 | 45 | BuildPreReq: OpenPKG, openpkg >= 20040130, zlib, glib2, X11, xrender |
michael@67 | 46 | BuildPreReq: cairo, fontconfig, freetype, giflib, jpeg, png, tiff |
michael@67 | 47 | PreReq: OpenPKG, openpkg >= 20040130, zlib, glib2, X11, xrender |
michael@67 | 48 | PreReq: cairo, fontconfig, freetype, giflib, jpeg, png, tiff |
michael@67 | 49 | AutoReq: no |
michael@67 | 50 | AutoReqProv: no |
michael@67 | 51 | Conflicts: pnet |
michael@67 | 52 | |
michael@67 | 53 | %description |
michael@67 | 54 | The Graphics Device Interface Plus (GDI+) development API exposes |
michael@67 | 55 | abstract graphics and formatted text logic. The calling process |
michael@67 | 56 | may write to those devices for which the GDI+ has a device driver, |
michael@67 | 57 | such as a video display or printer. |
michael@67 | 58 | |
michael@67 | 59 | %track |
michael@67 | 60 | prog libgdiplus = { |
michael@67 | 61 | version = %{version} |
michael@67 | 62 | url = ftp://ftp.novell.com/pub/mono/sources/libgdiplus/ |
michael@67 | 63 | regex = libgdiplus-(\d+\.\d+)\.tar\.bz2 |
michael@67 | 64 | } |
michael@67 | 65 | |
michael@67 | 66 | %prep |
michael@67 | 67 | # unpack sources |
michael@67 | 68 | %setup -q |
michael@67 | 69 | |
michael@67 | 70 | # remove subdirectory builds to assure internal library usage |
michael@67 | 71 | rm -rf cairo |
michael@67 | 72 | |
michael@67 | 73 | # correct flaws in the build configuration |
michael@67 | 74 | %{l_shtool} subst \ |
michael@67 | 75 | -e 's;\(libexif_pkgconfig=\)\("No\.[^"]*"\);\1no \&\& echo \2;g' \ |
michael@67 | 76 | configure |
michael@67 | 77 | %{l_shtool} subst \ |
michael@67 | 78 | -e 's;^\(SUBDIRS\) *= *@CAIRO_DIR@ src tests;\1=src tests;' \ |
michael@67 | 79 | Makefile.in |
michael@67 | 80 | |
michael@67 | 81 | %build |
michael@67 | 82 | # detect X11 paths |
michael@67 | 83 | x11_incdir=`%{l_rc} --query x11_incdir` |
michael@67 | 84 | x11_libdir=`%{l_rc} --query x11_libdir` |
michael@67 | 85 | |
michael@67 | 86 | %if "%{with_shared}" == "yes" |
michael@67 | 87 | # configure shared library |
michael@67 | 88 | CC="%{l_cc}" \ |
michael@67 | 89 | CFLAGS="%{l_cflags -O}" \ |
michael@67 | 90 | CPPFLAGS="%{l_cppflags tiff} -I${x11_incdir}" \ |
michael@67 | 91 | LDFLAGS="%{l_ldflags}" \ |
michael@67 | 92 | ./configure \ |
michael@67 | 93 | --prefix=%{l_prefix} \ |
michael@67 | 94 | --with-cairo=installed \ |
michael@67 | 95 | --without-libexif \ |
michael@67 | 96 | --disable-static \ |
michael@67 | 97 | --enable-shared \ |
michael@67 | 98 | --with-gnu-ld |
michael@67 | 99 | |
michael@67 | 100 | # build shared library |
michael@67 | 101 | %{l_make} %{l_mflags -O} |
michael@67 | 102 | |
michael@67 | 103 | # install early, as we delete to build again |
michael@67 | 104 | %{l_shtool} mkdir -f -p -m 755 gdidyn |
michael@67 | 105 | mv src/.libs/libgdiplus* gdidyn/ |
michael@67 | 106 | |
michael@67 | 107 | # reset build configuration |
michael@67 | 108 | %{l_make} %{l_mflags} distclean |
michael@67 | 109 | %endif |
michael@67 | 110 | |
michael@67 | 111 | # configure static library |
michael@67 | 112 | CC="%{l_cc}" \ |
michael@67 | 113 | CFLAGS="%{l_cflags -O}" \ |
michael@67 | 114 | CPPFLAGS="%{l_cppflags tiff} -I${x11_incdir}" \ |
michael@67 | 115 | LDFLAGS="%{l_ldflags}" \ |
michael@67 | 116 | ./configure \ |
michael@67 | 117 | --prefix=%{l_prefix} \ |
michael@67 | 118 | --with-cairo=installed \ |
michael@67 | 119 | --without-libexif \ |
michael@67 | 120 | --enable-static \ |
michael@67 | 121 | --disable-shared \ |
michael@67 | 122 | --with-gnu-ld |
michael@67 | 123 | |
michael@67 | 124 | # build static library |
michael@67 | 125 | %{l_make} %{l_mflags -O} |
michael@67 | 126 | |
michael@67 | 127 | %install |
michael@67 | 128 | # install static library |
michael@67 | 129 | rm -rf $RPM_BUILD_ROOT |
michael@67 | 130 | %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT" |
michael@67 | 131 | |
michael@67 | 132 | %if "%{with_shared}" == "yes" |
michael@67 | 133 | # install shared library |
michael@67 | 134 | %{l_tar} cf - gdidyn | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib |
michael@67 | 135 | %endif |
michael@67 | 136 | |
michael@67 | 137 | # determine installation files |
michael@67 | 138 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@67 | 139 | %{l_files_std} \ |
michael@67 | 140 | '%not %dir %{l_prefix}/lib/pkgconfig' |
michael@67 | 141 | |
michael@67 | 142 | %files -f files |
michael@67 | 143 | |
michael@67 | 144 | %clean |
michael@67 | 145 | rm -rf $RPM_BUILD_ROOT |
michael@67 | 146 |