[mingw-dlfcn: 6/16] - Use %global instead of %define - Automatically generate debuginfo subpackage (F-12+) - Fixed %defa

epienbro epienbro at fedoraproject.org
Wed Mar 7 16:46:56 UTC 2012


commit 0d62afb13ead0db36452054a7312c2059e949775
Author: epienbro <epienbro at fedoraproject.org>
Date:   Fri Oct 30 14:44:03 2009 +0000

    - Use %global instead of %define
    - Automatically generate debuginfo subpackage (F-12+)
    - Fixed %defattr line
    - Added -static subpackage
    - Fixed linker error with C++ applications

 dlfcn-fix-cplusplus-linkage.patch |   20 +++++++++++++++
 mingw32-dlfcn.spec                |   48 ++++++++++++++++++++++++++++--------
 2 files changed, 57 insertions(+), 11 deletions(-)
---
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/mingw32-dlfcn.spec b/mingw32-dlfcn.spec
index 951f313..896587b 100644
--- a/mingw32-dlfcn.spec
+++ b/mingw32-dlfcn.spec
@@ -1,16 +1,17 @@
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
+%global __strip %{_mingw32_strip}
+%global __objdump %{_mingw32_objdump}
+%global _use_internal_dependency_generator 0
+%global __find_requires %{_mingw32_findrequires}
+%global __find_provides %{_mingw32_findprovides}
+%define __debug_install_post %{_mingw32_debug_install_post}
 
-%define realname dlfcn-win32
+%global realname dlfcn-win32
 
-%define alphatag r11
+%global alphatag r11
 
 Name:          mingw32-dlfcn
 Version:       0
-Release:       0.6.%{alphatag}%{?dist}
+Release:       0.7.%{alphatag}%{?dist}
 Summary:       Implements a wrapper for dlfcn (dlopen dlclose dlsym dlerror)
 
 License:       LGPLv2+
@@ -21,12 +22,13 @@ BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:     noarch
 
-BuildRequires:  mingw32-filesystem >= 49
+BuildRequires: mingw32-filesystem >= 52
 BuildRequires: mingw32-gcc
 BuildRequires: mingw32-binutils
 #BuildRequires: dos2unix
 
 Patch1:        dlfcn_configure.patch
+Patch2:        dlfcn-fix-cplusplus-linkage.patch
 
 
 %description
@@ -34,6 +36,18 @@ 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}
 
@@ -42,6 +56,7 @@ around the dynamic link library functions found in the Windows API.
 %{__sed} -i 's/\r//' COPYING
 
 %patch1 -p1
+%patch2 -p0
 
 
 %build
@@ -49,7 +64,7 @@ around the dynamic link library functions found in the Windows API.
   --incdir=%{_mingw32_includedir} \
   --cc=i686-pc-mingw32-gcc \
   --enable-shared=yes \
-  --enable-static=no \
+  --enable-static=yes \
   --enable-strip=i686-pc-mingw32-strip
 make %{?_smp_mflags}
 
@@ -64,14 +79,25 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %files
-%defattr(-,root,root)
+%defattr(-,root,root,-)
 %doc README COPYING
 %{_mingw32_bindir}/libdl.dll
 %{_mingw32_libdir}/libdl.dll.a
 %{_mingw32_includedir}/dlfcn.h
 
+%files static
+%defattr(-,root,root,-)
+%{_mingw32_libdir}/libdl.a
+
 
 %changelog
+* Fri Oct 30 2009 Erik van Pienbroek <epienbro at fedoraproject.org> - 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 <rel-eng at lists.fedoraproject.org> - 0-0.6.r11
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 


More information about the scm-commits mailing list