From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Thu, 4 Sep 2008 18:03:19 +0000 (+0100) Subject: Automatic dependency generation and lots more goodness. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=88677fd681a60a565fb236aabeabaf13435c3639;p=fedora-mingw.git dependency generation and lots more goodness. --- diff --git a/filesystem/mingw-defs b/filesystem/mingw-defs new file mode 100644 index 0000000..b5e8cf2 --- /dev/null +++ b/filesystem/mingw-defs @@ -0,0 +1,8 @@ +# 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 diff --git a/filesystem/mingw-filesystem.spec b/filesystem/mingw-filesystem.spec index c91e5a9..a3839ed 100644 --- a/filesystem/mingw-filesystem.spec +++ b/filesystem/mingw-filesystem.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: mingw-filesystem -Version: 2 +Version: 14 Release: 1%{?dist} Summary: MinGW base filesystem and environment @@ -15,10 +15,17 @@ Source0: mingw-COPYING 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 @@ -76,6 +83,10 @@ mkdir -p $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/sys-root/mingw/share/man/man{ # /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 @@ -88,9 +99,28 @@ 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 - 14-1 +- Fix path to mingw-find-requires/provides scripts. + +* Mon Sep 4 2008 Richard W.M. Jones - 12-1 +- Put CFLAGS on a single line to avoid problems in some configure scripts. + +* Mon Sep 4 2008 Richard W.M. Jones - 10-1 +- Provides certain base Windows DLLs (not literally). + +* Mon Sep 4 2008 Richard W.M. Jones - 9-1 +- Include RPM dependency generators and definitions. + +* Mon Sep 4 2008 Richard W.M. Jones - 4-1 +- Add _mingw_cc/cflags/etc. and _mingw_configure macros. + +* Mon Sep 4 2008 Richard W.M. Jones - 3-1 +- Add _mingw_host macro. + * Mon Sep 4 2008 Richard W.M. Jones - 2-1 - Add _mingw_sysroot macro. - Add _mingw_target macro. diff --git a/filesystem/mingw-find-provides.sh b/filesystem/mingw-find-provides.sh new file mode 100755 index 0000000..2815896 --- /dev/null +++ b/filesystem/mingw-find-provides.sh @@ -0,0 +1,20 @@ +#!/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 diff --git a/filesystem/mingw-find-requires.sh b/filesystem/mingw-find-requires.sh new file mode 100755 index 0000000..1a63fc3 --- /dev/null +++ b/filesystem/mingw-find-requires.sh @@ -0,0 +1,21 @@ +#!/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 diff --git a/filesystem/mingw-macros.mingw b/filesystem/mingw-macros.mingw index 58c133e..2f8947e 100644 --- a/filesystem/mingw-macros.mingw +++ b/filesystem/mingw-macros.mingw @@ -14,4 +14,20 @@ %_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}