diff --git a/.gitignore b/.gitignore index e69de29..2bed6e7 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +dlfcn-win32-r11.tar.bz2 diff --git a/dlfcn-fix-cplusplus-linkage.patch b/dlfcn-fix-cplusplus-linkage.patch new file mode 100644 index 0000000..05684a9 --- /dev/null +++ b/dlfcn-fix-cplusplus-linkage.patch @@ -0,0 +1,20 @@ +--- dlfcn.h.orig 2009-10-30 15:36:35.357902913 +0100 ++++ dlfcn.h 2009-10-30 15:39:51.126664184 +0100 +@@ -37,9 +37,17 @@ + #define RTLD_DEFAULT 0 + #define RTLD_NEXT 0 + ++#ifdef __cplusplus ++extern "C" { ++#endif ++ + void *dlopen ( const char *file, int mode ); + int dlclose( void *handle ); + void *dlsym ( void *handle, const char *name ); + char *dlerror( void ); + ++#ifdef __cplusplus ++} ++#endif ++ + #endif /* DLFCN_H */ diff --git a/dlfcn-fix-static-lib.patch b/dlfcn-fix-static-lib.patch new file mode 100644 index 0000000..28b9ca4 --- /dev/null +++ b/dlfcn-fix-static-lib.patch @@ -0,0 +1,13 @@ +--- Makefile.orig 2012-02-16 14:38:27.110914820 +0100 ++++ Makefile 2012-02-16 14:38:56.615439410 +0100 +@@ -31,8 +31,8 @@ + $(CC) -o dlfcn.o -c dlfcn.c -Wall -O3 -fomit-frame-pointer + + libdl.a: dlfcn.o +- ar cru libdl.a dlfcn.o +- ranlib libdl.a ++ i686-w64-mingw32-ar cru libdl.a dlfcn.o ++ i686-w64-mingw32-ranlib libdl.a + + libdl.dll: dlfcn.o + $(CC) $(SHFLAGS) -shared -o libdl.dll dlfcn.o diff --git a/dlfcn_configure.patch b/dlfcn_configure.patch new file mode 100644 index 0000000..2bfb062 --- /dev/null +++ b/dlfcn_configure.patch @@ -0,0 +1,62 @@ +diff -ruNp dlfcn-win32-r11/config.mak dlfcn-win32-r11.new/config.mak +--- dlfcn-win32-r11/config.mak 1969-12-31 21:00:00.000000000 -0300 ++++ dlfcn-win32-r11.new/config.mak 2009-01-02 12:08:15.000000000 -0200 +@@ -0,0 +1,9 @@ ++# Automatically generated by configure ++PREFIX=/usr/i686-w64-mingw32/sys-root/mingw ++libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib ++incdir=/usr/i686-w64-mingw32/sys-root/mingw/include ++CC=i686-w64-mingw32-gcc ++BUILD_SHARED=yes ++BUILD_STATIC=yes ++BUILD_MSVC=no ++DO_STRIP=yes +diff -ruNp dlfcn-win32-r11/configure dlfcn-win32-r11.new/configure +--- dlfcn-win32-r11/configure 2009-01-02 11:54:38.000000000 -0200 ++++ dlfcn-win32-r11.new/configure 2009-01-02 12:35:30.000000000 -0200 +@@ -97,6 +97,45 @@ for opt do + --make=*) + make="$optval" + ;; ++ --enable-shared=*) ++ shared="$optval" ++ ;; ++ --enable-static=*) ++ static="$optval" ++ ;; ++ --enable-strip=*) ++ strip="$optval" ++ ;; ++ --cache-file=*) ++ ;; ++ --host=*) ++ ;; ++ --build=*) ++ ;; ++ --target=*) ++ ;; ++ --exec-prefix=*) ++ ;; ++ --bindir=*) ++ ;; ++ --sbindir=*) ++ ;; ++ --sysconfdir=*) ++ ;; ++ --datadir=*) ++ ;; ++ --includedir=*) ++ ;; ++ --libexecdir=*) ++ ;; ++ --localstatedir=*) ++ ;; ++ --sharedstatedir=*) ++ ;; ++ --mandir=*) ++ ;; ++ --infodir=*) ++ ;; + --enable-?*|--disable-?*) + eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` + echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt diff --git a/mingw32-dlfcn.spec b/mingw32-dlfcn.spec new file mode 100644 index 0000000..55c6deb --- /dev/null +++ b/mingw32-dlfcn.spec @@ -0,0 +1,129 @@ +%global __strip %{_mingw32_strip} +%global __objdump %{_mingw32_objdump} +%define __debug_install_post %{_mingw32_debug_install_post} + +%global realname dlfcn-win32 + +%global alphatag r11 + +Name: mingw32-dlfcn +Version: 0 +Release: 0.11.%{alphatag}%{?dist} +Summary: Implements a wrapper for dlfcn (dlopen dlclose dlsym dlerror) + +License: LGPLv2+ +Group: Development/Libraries +URL: http://code.google.com/p/dlfcn-win32/ +Source0: http://dlfcn-win32.googlecode.com/files/%{realname}-%{alphatag}.tar.bz2 + +BuildArch: noarch + +BuildRequires: mingw32-filesystem >= 68 +BuildRequires: mingw32-gcc +BuildRequires: mingw32-binutils +#BuildRequires: dos2unix + +Patch1: dlfcn_configure.patch +Patch2: dlfcn-fix-cplusplus-linkage.patch +Patch3: dlfcn-fix-static-lib.patch + + +%description +This library implements a wrapper for dlfcn, as specified in POSIX and SUS, +around the dynamic link library functions found in the Windows API. + + +%package static +Summary: Static version of the MinGW Windows dlfcn library +Requires: %{name} = %{version}-%{release} +Group: Development/Libraries + +%description static +Static version of the MinGW Windows dlfcn library. + + +%{?_mingw32_debug_package} + + +%prep +%setup -q -n %{realname}-%{alphatag} + +%{__sed} -i 's/\r//' configure +%{__sed} -i 's/\r//' README +%{__sed} -i 's/\r//' COPYING + +%patch1 -p1 +%patch2 -p0 +%patch3 -p0 + + +%build +%{_mingw32_configure} \ + --incdir=%{_mingw32_includedir} \ + --cc=i686-w64-mingw32-gcc \ + --enable-shared=yes \ + --enable-static=yes \ + --enable-strip=i686-w64-mingw32-strip +make %{?_smp_mflags} + + +%install +make DESTDIR=$RPM_BUILD_ROOT install + + +%files +%doc README COPYING +%{_mingw32_bindir}/libdl.dll +%{_mingw32_libdir}/libdl.dll.a +%{_mingw32_includedir}/dlfcn.h + +%files static +%{_mingw32_libdir}/libdl.a + + +%changelog +* Mon Feb 27 2012 Erik van Pienbroek - 0-0.11.r11 +- Rebuild against the mingw-w64 toolchain + +* Thu Feb 16 2012 Erik van Pienbroek - 0-0.10.r11 +- Make sure the static lib is compiled correctly (RHBZ #791191) +- Various cleanups + +* Fri Jan 13 2012 Fedora Release Engineering - 0-0.9.r11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 0-0.8.r11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Oct 30 2009 Erik van Pienbroek - 0-0.7.r11 +- Use %%global instead of %%define +- Automatically generate debuginfo subpackage +- Fixed %%defattr line +- Added -static subpackage +- Fixed linker error with C++ applications + +* Sat Jul 25 2009 Fedora Release Engineering - 0-0.6.r11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 0-0.5.r11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Feb 20 2009 Richard W.M. Jones - 0-0.4.r11 +- Rebuild for mingw32-gcc 4.4 + +* Wed Jan 14 2009 Richard W.M. Jones - 0-0.3.r11 +- Use Version 0 + (https://www.redhat.com/archives/fedora-packaging/2009-January/msg00064.html) +- Revert use of dos2unix for now + (https://www.redhat.com/archives/fedora-packaging/2009-January/msg00066.html) +- Use _smp_mflags. + +* Tue Jan 13 2009 Richard W.M. Jones - 0.1-0.2.r11 +- Import into fedora-mingw temporary repository because there are packages + which will depend on this. +- Fix the version/release according to packaging guidelines. +- Tidy up the spec file. +- Use dos2unix and keep the timestamps. + +* Fri Jan 02 2009 Itamar Reis Peixoto - r11-1 +- Initial RPM release. diff --git a/sources b/sources index e69de29..547b454 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +728d2c79edaf09ee3c309860499502eb dlfcn-win32-r11.tar.bz2