66c68a
# RPM macros for Fedora MinGW.
66c68a
0c1e1f
%mingw32_pkg_name        %(echo %{name} | sed 's/^mingw-/mingw32-/')
0c1e1f
%mingw32_target          i686-w64-mingw32
1ea30e
66c68a
# Paths.
0c1e1f
%mingw32_sysroot         %{_prefix}/%{mingw32_target}/sys-root
0c1e1f
%mingw32_prefix          %{mingw32_sysroot}/mingw
0c1e1f
%mingw32_exec_prefix     %{mingw32_prefix}
0c1e1f
%mingw32_bindir          %{mingw32_exec_prefix}/bin
0c1e1f
%mingw32_sbindir         %{mingw32_exec_prefix}/sbin
0c1e1f
%mingw32_libexecdir      %{mingw32_exec_prefix}/libexec
0c1e1f
%mingw32_libdir          %{mingw32_exec_prefix}/lib
0c1e1f
%mingw32_datadir         %{mingw32_prefix}/share
0c1e1f
%mingw32_docdir          %{mingw32_prefix}/share/doc
0c1e1f
%mingw32_infodir         %{mingw32_prefix}/share/info
0c1e1f
%mingw32_mandir          %{mingw32_prefix}/share/man
0c1e1f
%mingw32_sysconfdir      %{mingw32_prefix}/etc
0c1e1f
%mingw32_sharedstatedir  %{mingw32_prefix}/com
0c1e1f
%mingw32_localstatedir   %{mingw32_prefix}/var
0c1e1f
%mingw32_includedir      %{mingw32_prefix}/include
66c68a
66c68a
# Build macros.
0c1e1f
%mingw32_host            %{mingw32_target}
d9bad0
0c1e1f
%mingw32_cflags          %{mingw32_cppflags} -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4
0c1e1f
%mingw32_cppflags        %{nil}
0c1e1f
%mingw32_ldflags         %{nil}
d9bad0
0c1e1f
%mingw32_cc              %{mingw32_target}-gcc
0c1e1f
%mingw32_cxx             %{mingw32_target}-g++
0c1e1f
%mingw32_cpp             %{mingw32_target}-gcc -E
0c1e1f
%mingw32_addr2line       %{mingw32_target}-addr2line
0c1e1f
%mingw32_ar              %{mingw32_target}-ar
0c1e1f
%mingw32_as              %{mingw32_target}-as
0c1e1f
%mingw32_dlltool         %{mingw32_target}-dlltool
0c1e1f
%mingw32_dllwrap         %{mingw32_target}-dllwrap
0c1e1f
%mingw32_gcov            %{mingw32_target}-gcov
0c1e1f
%mingw32_gprof           %{mingw32_target}-gprof
0c1e1f
%mingw32_ld              %{mingw32_target}-ld
0c1e1f
%mingw32_nm              %{mingw32_target}-nm
0c1e1f
%mingw32_objcopy         %{mingw32_target}-objcopy
0c1e1f
%mingw32_objdump         %{mingw32_target}-objdump
0c1e1f
%mingw32_ranlib          %{mingw32_target}-ranlib
0c1e1f
%mingw32_readelf         %{mingw32_target}-readelf
0c1e1f
%mingw32_size            %{mingw32_target}-size
0c1e1f
%mingw32_strings         %{mingw32_target}-strings
0c1e1f
%mingw32_strip           %{mingw32_target}-strip
0c1e1f
%mingw32_windmc          %{mingw32_target}-windmc
0c1e1f
%mingw32_windres         %{mingw32_target}-windres
66c68a
0c1e1f
%mingw32_env unset $(/usr/bin/env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1); \
0c1e1f
  if test -z "$PATH_ORIG" ; then \
0c1e1f
    PATH_ORIG="$PATH"; export PATH_ORIG; \
0c1e1f
  fi; \
0c1e1f
  PATH="%{mingw32_bindir}:$PATH_ORIG"; export PATH; \
0c1e1f
  HOST_CC=gcc; export HOST_CC; \
2e732f
  unset PKG_CONFIG_PATH; \
0c1e1f
  _PREFIX="%{_bindir}/%{mingw32_target}-"; \
c0320e
  for i in `ls -1 ${_PREFIX}* | grep -v 'gcc-'`; do \
Kalev Lember 5b66ef
    x=`echo $i|sed "s,${_PREFIX},,"|tr "a-z+-." "A-ZX__"`; \
1ea30e
    declare -x $x="$i" ; export $x; \
1ea30e
  done; \
1ea30e
  unset _PREFIX; \
0c1e1f
  CC="${MINGW32_CC:-%mingw32_cc}"; export CC; \
64394b
  CFLAGS="${MINGW32_CFLAGS-%mingw32_cflags}"; export CFLAGS; \
64394b
  CPPFLAGS="${MINGW32_CPPFLAGS-%mingw32_cppflags}"; export CPPFLAGS; \
0c1e1f
  if [ -x "%{_bindir}/%{mingw32_cxx}" ]; then \
0c1e1f
    CXX="${MINGW32_CXX:-%mingw32_cxx}"; export CXX; \
64394b
    CXXFLAGS="${MINGW32_CXXFLAGS-%mingw32_cflags}"; export CXXFLAGS; \
c0320e
  else \
c0320e
    CXX=; export CXX; \
c0320e
    ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \
c0320e
    CXXFLAGS=; export CXXFLAGS; \
c0320e
  fi; \
0c1e1f
  LDFLAGS="${MINGW32_LDFLAGS:-%mingw32_ldflags}"; export LDFLAGS; \
0c1e1f
  for i in `ls %{mingw32_bindir}/*|grep -- "-config\$"` ; do \
0cec28
    x=`basename $i|tr "a-z+-." "A-ZX_"`; \
1ea30e
    declare -x $x="$i" ; export $x; \
1ea30e
  done; \
1ea30e
  unset x i
1ea30e
0c1e1f
%mingw32_pkg_config %{mingw32_target}-pkg-config
782b10
%mingw32_pkgconfig_personalitydir %{mingw32_datadir}/pkgconfig/personality.d
0c1e1f
0c1e1f
%mingw32_configure %{mingw32_env} ; \
3f88d6
  __mingw32_topdir=.; if ! test -x configure; then __mingw32_topdir=..; fi; \\\
0c1e1f
  $__mingw32_topdir/configure \\\
0c1e1f
	--host=%{mingw32_host} \\\
03e2b3
	--build=%_build \\\
0c1e1f
	--target=%{mingw32_target} \\\
0c1e1f
	--prefix=%{mingw32_prefix} \\\
0c1e1f
	--exec-prefix=%{mingw32_exec_prefix} \\\
0c1e1f
	--bindir=%{mingw32_bindir} \\\
0c1e1f
	--sbindir=%{mingw32_sbindir} \\\
0c1e1f
	--sysconfdir=%{mingw32_sysconfdir} \\\
0c1e1f
	--datadir=%{mingw32_datadir} \\\
0c1e1f
	--includedir=%{mingw32_includedir} \\\
0c1e1f
	--libdir=%{mingw32_libdir} \\\
0c1e1f
	--libexecdir=%{mingw32_libexecdir} \\\
0c1e1f
	--localstatedir=%{mingw32_localstatedir} \\\
0c1e1f
	--sharedstatedir=%{mingw32_sharedstatedir} \\\
0c1e1f
	--mandir=%{mingw32_mandir} \\\
0c1e1f
	--infodir=%{mingw32_infodir} \\\
0c1e1f
	${MINGW_CONFIGURE_ARGS} \\\
0c1e1f
	${MINGW32_CONFIGURE_ARGS}
0c1e1f
0c1e1f
%mingw32_make %{mingw32_env} ; \
2caed6
  make \\\
0c1e1f
	prefix=%{mingw32_prefix} \\\
0c1e1f
	exec_prefix=%{mingw32_exec_prefix} \\\
0c1e1f
	bindir=%{mingw32_bindir} \\\
0c1e1f
	sbindir=%{mingw32_sbindir} \\\
0c1e1f
	sysconfdir=%{mingw32_sysconfdir} \\\
0c1e1f
	datadir=%{mingw32_datadir} \\\
0c1e1f
	includedir=%{mingw32_includedir} \\\
0c1e1f
	libdir=%{mingw32_libdir} \\\
0c1e1f
	libexecdir=%{mingw32_libexecdir} \\\
0c1e1f
	localstatedir=%{mingw32_localstatedir} \\\
0c1e1f
	sharedstatedir=%{mingw32_sharedstatedir} \\\
0c1e1f
	mandir=%{mingw32_mandir} \\\
0c1e1f
	infodir=%{mingw32_infodir}
0c1e1f
a1d54d
%mingw32_cmake_generic %{mingw32_env} ; \
6f9ecc
  PKG_CONFIG_LIBDIR="%{mingw32_libdir}/pkgconfig:%{mingw32_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \
0c1e1f
  if test -f CMakeLists.txt; then __mingw32_topdir=.; \\\
0c1e1f
  elif test -f ../CMakeLists.txt; then __mingw32_topdir=..; \\\
0c1e1f
  else __mingw32_topdir=""; fi; \\\
6e3f91
  if test "${MINGW_CMAKE_NO_VERBOSE}" == "" ; then \
6e3f91
    MINGW32_CMAKE_ARGS="${MINGW32_CMAKE_ARGS} -DCMAKE_VERBOSE_MAKEFILE=ON" \
6e3f91
  fi \
0c1e1f
  PATH=%{_prefix}/%{mingw32_target}/bin:$PATH %__cmake \\\
a1d54d
        -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw32.cmake \\\
a1d54d
        -DBUILD_SHARED_LIBS:BOOL=ON \\\
0c1e1f
        -DSYSCONF_INSTALL_DIR:PATH=%{mingw32_sysconfdir} \\\
0c1e1f
        -DSHARE_INSTALL_PREFIX:PATH=%{mingw32_datadir} \\\
0c1e1f
        -DCMAKE_INSTALL_PREFIX:PATH=%{mingw32_prefix} \\\
0c1e1f
        -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw32_libdir} \\\
0c1e1f
        ${MINGW_CMAKE_ARGS} \\\
0c1e1f
        ${MINGW32_CMAKE_ARGS} \\\
2fdaf5
        "$@" $__mingw32_topdir
7cf0ed
a1d54d
%mingw32_cmake \
a1d54d
  MINGW32_CMAKE_ARGS="${MINGW32_CMAKE_ARGS} -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}" \
a1d54d
  %mingw32_cmake_generic
a1d54d
a1d54d
%mingw32_cmake_kde4 \
a1d54d
  MINGW32_CMAKE_ARGS="${MINGW32_CMAKE_ARGS} -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}/kde4" \
a1d54d
  %mingw32_cmake_generic
a1d54d
4c049a
%mingw32_qmake_qt4 /usr/bin/mingw32-qmake-qt4
4c049a
%mingw32_qmake_qt5 /usr/bin/mingw32-qmake-qt5
7cf0ed
bd0be2
%mingw32_meson %{mingw32_env} ; \
bd0be2
  unset CC CFLAGS CPPFLAGS CXX CXXFLAGS LDFLAGS; \\\
bd0be2
  export CFLAGS="%{__global_cflags}" CXXFLAGS="%{__global_cxxflags}" LDFLAGS="%{__global_ldflags}"; \\\
bd0be2
  if test -f meson.build; then __mingw32_topdir=.; \\\
bd0be2
  elif test -f ../meson.build; then __mingw32_topdir=..; \\\
bd0be2
  else __mingw32_topdir=""; fi; \\\
bd0be2
  %__meson \\\
bd0be2
        --cross-file /usr/share/mingw/toolchain-mingw32.meson \\\
bd0be2
        --default-library shared \\\
bd0be2
        --prefix %{mingw32_prefix} \\\
bd0be2
        --bindir %{mingw32_bindir} \\\
bd0be2
        --sbindir %{mingw32_sbindir} \\\
bd0be2
        --sysconfdir %{mingw32_sysconfdir} \\\
bd0be2
        --datadir %{mingw32_datadir} \\\
bd0be2
        --includedir %{mingw32_includedir} \\\
bd0be2
        --libdir %{mingw32_libdir} \\\
bd0be2
        --libexecdir %{mingw32_libexecdir} \\\
bd0be2
        --localstatedir %{mingw32_localstatedir} \\\
bd0be2
        --sharedstatedir %{mingw32_sharedstatedir} \\\
bd0be2
        --mandir %{mingw32_mandir} \\\
bd0be2
        --infodir %{mingw32_infodir} \\\
bd0be2
        ${MINGW_MESON_ARGS} \\\
bd0be2
        ${MINGW32_MESON_ARGS} \\\
2fdaf5
        "$@" $__mingw32_topdir
bd0be2
0c1e1f
%mingw32_description This is the cross-compiled version of this library / tool.\
b8b00e
You should only install this package if you want to cross-compile programs for \
b8b00e
Win32 (32 bit Windows).
0c1e1f
0c1e1f
%mingw32_debug_package                                                   \
0c1e1f
%package -n %{mingw32_pkg_name}-debuginfo                                \
0c1e1f
Summary: Debug information for package %{mingw32_pkg_name}               \
0c1e1f
Group: Development/Debug                                                 \
0c1e1f
BuildArch: noarch                                                        \
0c1e1f
%description -n %{mingw32_pkg_name}-debuginfo                            \
0c1e1f
This package provides debug information for package %{mingw32_pkg_name}. \
0c1e1f
Debug information is useful when developing applications that use this   \
0c1e1f
package or when debugging this package.                                  \
0c1e1f
%files -n %{mingw32_pkg_name}-debuginfo -f mingw32-debugfiles.list       \
0c1e1f
%defattr(-,root,root,-)                                                  \
0c1e1f
%{nil}
0c1e1f