--- /dev/null
+# Some standard definitions %-included at the top of most
+# of the MinGW RPM spec files.
+
+%define __strip %{_mingw_strip}
+%define __objdump %{_mingw_objdump}
+%define _use_internal_dependency_generator 0
+%define __find_requires /usr/lib/rpm/mingw-find-requires.sh
+%define __find_provides /usr/lib/rpm/mingw-find-provides.sh
%define debug_package %{nil}
Name: mingw-filesystem
-Version: 2
+Version: 14
Release: 1%{?dist}
Summary: MinGW base filesystem and environment
Source1: mingw-macros.mingw
Source2: mingw.sh
Source3: mingw.csh
+Source4: mingw-find-requires.sh
+Source5: mingw-find-provides.sh
+Source6: mingw-defs
Requires: setup
Requires: rpm
+# These are actually provided by Windows itself, or Wine.
+Provides: mingw(msvcrt.dll)
+Provides: mingw(kernel32.dll)
+
%description
This package contains the base filesystem layout, RPM macros and
# /usr/i686-pc-mingw32/sys-root/mingw/doc
# but these are both packaging bugs.
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/rpm
+install -m 0755 %{SOURCE4} %{SOURCE5} $RPM_BUILD_ROOT%{_libdir}/rpm
+install -m 0644 %{SOURCE6} $RPM_BUILD_ROOT%{_libdir}/rpm
+
%clean
rm -rf $RPM_BUILD_ROOT
%config(noreplace) %{_sysconfdir}/profile.d/mingw.sh
%config(noreplace) %{_sysconfdir}/profile.d/mingw.csh
%{_prefix}/i686-pc-mingw32/
+%{_libdir}/rpm/mingw-*
%changelog
+* Mon Sep 4 2008 Richard W.M. Jones <rjones@redhat.com> - 14-1
+- Fix path to mingw-find-requires/provides scripts.
+
+* Mon Sep 4 2008 Richard W.M. Jones <rjones@redhat.com> - 12-1
+- Put CFLAGS on a single line to avoid problems in some configure scripts.
+
+* Mon Sep 4 2008 Richard W.M. Jones <rjones@redhat.com> - 10-1
+- Provides certain base Windows DLLs (not literally).
+
+* Mon Sep 4 2008 Richard W.M. Jones <rjones@redhat.com> - 9-1
+- Include RPM dependency generators and definitions.
+
+* Mon Sep 4 2008 Richard W.M. Jones <rjones@redhat.com> - 4-1
+- Add _mingw_cc/cflags/etc. and _mingw_configure macros.
+
+* Mon Sep 4 2008 Richard W.M. Jones <rjones@redhat.com> - 3-1
+- Add _mingw_host macro.
+
* Mon Sep 4 2008 Richard W.M. Jones <rjones@redhat.com> - 2-1
- Add _mingw_sysroot macro.
- Add _mingw_target macro.
--- /dev/null
+#!/bin/bash
+
+# This script reads filenames from STDIN and outputs any relevant provides
+# information that needs to be included in the package.
+
+if [ "$1" ]
+then
+ package_name="$1"
+fi
+
+[ -z "$OBJDUMP" ] && OBJDUMP=i686-pc-mingw32-objdump
+
+filelist=`sed "s/['\"]/\\\&/g"`
+
+dlls=$(echo $filelist | tr [:blank:] '\n' | grep '\.dll')
+
+for f in $dlls; do
+ basename=`basename $f | tr [:upper:] [:lower:]`
+ echo "mingw($basename)"
+done
--- /dev/null
+#!/bin/bash
+
+# This script reads filenames from STDIN and outputs any relevant provides
+# information that needs to be included in the package.
+
+if [ "$1" ]
+then
+ package_name="$1"
+fi
+
+[ -z "$OBJDUMP" ] && OBJDUMP=i686-pc-mingw32-objdump
+
+filelist=`sed "s/['\"]/\\\&/g"`
+
+dlls=$(echo $filelist | tr [:blank:] '\n' | grep '\.dll')
+
+for f in $dlls; do
+ $OBJDUMP -p $f | grep 'DLL Name' | grep -Eo '[[:alnum:]_]+\.dll' |
+ tr [:upper:] [:lower:] |
+ sed 's/\(.*\)/mingw(\1)/'
+done | sort -u
%_mingw_includedir %{_mingw_prefix}/include
# Build macros.
+%_mingw_host i686-pc-mingw32
%_mingw_target i686-pc-mingw32
+
+# Note: all flags must be on a single line.
+%_mingw_cflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -I%{_mingw_includedir}
+
+%_mingw_cc i686-pc-mingw32-gcc
+%_mingw_cpp i686-pc-mingw32-gcc -E
+%_mingw_ar i686-pc-mingw32-ar
+%_mingw_ranlib i686-pc-mingw32-ranlib
+%_mingw_strip i686-pc-mingw32-strip
+%_mingw_objdump i686-pc-mingw32-objdump
+
+%_mingw_configure \
+ CC="%{_mingw_cc}" \
+ CFLAGS="%{_mingw_cflags}" \
+ ./configure --build=%_build --host=%{_mingw_host} --target=%{_mingw_target}