hi,
after my original mail "future of mingw" now i put together the first
version what i like to see.
i attached an example libogg spec file the old (current svn and my
rewrite) to show how i like to clear the spec file. imho it's cleaner
easier and better to maintain.

a short description:

i can't solve this f***n debug define so it's always have to add to the
spec file:
----------------------------
%define __debug_install_post %{mingw_debug_install_post}
----------------------------

the magic is hidden into mingwtool which generate the rest of the spec
file with this two lines:
----------------------------
%global mingwtool sh /usr/lib/rpm/mingwtool
%{expand:%(%{mingwtool} --br "gcc" --doc "AUTHORS CHANGES COPYING
README" 2>/dev/null)}
----------------------------

the useful parameters for the shell script are:
--enable-* (or --with-*) and --disable-* (or --without-*)
which can turn on and off some feature which are:
- mingw32 to generate mingw32 subpackages default: on
- mingw64 to generate mingw64 subpackages default: on
- darwinx to generate darwinx subpackages default: off
- static  to generate static  subpackages default: on
- debug   to generate debug   subpackages default: on

--br BuildRequires mingw32/64 packages
--doc additional documentation files to the main package
not yet implemented:
--req Requires for mingw32/64 packages for the subpackage
--prov Provides for mingw32/64 packages for the subpackage
--obs Obsoletes for mingw32/64 packages for the subpackage

eg:
%{expand:%(%{mingwtool} --disable-mingw64 --disable-static --br "gcc
gcc-c++" --doc "AUTHORS CHANGES COPYING README" 2>/dev/null)}
- don't build mingw64 and static subpackages
- add BuildRequires: mingw32-gcc mingw32-gcc-c++
- add the above files to mingw32-libogg %doc section

i write separate mails about the rewritten scripts.

-- 
  Levente                               "Si vis pacem para bellum!"
Name:           mingw-libogg
Version:        1.2.2
Release:        2%{?dist}
Summary:        Cross compiled Ogg bitstream library
Group:          System Environment/Libraries
License:        BSD
URL:            http://www.xiph.org/
Source:         http://downloads.xiph.org/releases/ogg/libogg-%{version}.tar.gz
Requires:       pkgconfig

%define __debug_install_post %{mingw_debug_install_post}
# Magic hidden here.
%global mingwtool sh /home/lfarkas/rpm/SPECS/mingwtool
%{expand:%(%{mingwtool} --disable-mingw64 --br "gcc" --doc "AUTHORS CHANGES 
COPYING README" 2>/dev/null)}


%description
Libogg is a library for manipulating Ogg bitstream file formats.
Libogg supports both making Ogg bitstreams and getting packets from
Ogg bitstreams.

%prep
%setup -q -n libogg-%{version}

%build
%mingw_configure
%mingw_make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
%mingw_make_install DESTDIR=$RPM_BUILD_ROOT
# zap docs, redundant with native package
rm -rf $RPM_BUILD_ROOT%{mingw32_docdir} $RPM_BUILD_ROOT%{mingw64_docdir}

%mingw_find_files

%changelog
* Tue Jun 28 2011 Levente Farkas <[email protected]> 1.2.2-2
- Update to the new mingwtool

* Fri May 13 2011 - Marc-André Lureau <[email protected]> - 1.2.2-1
- Updated to 1.2.2
- Updated to newer mingw instructions (with mingw64 support)

* Tue Feb 08 2011 Fedora Release Engineering <[email protected]> 
- 1.1.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Jul 13 2010 Gerd Hoffmann <[email protected]> - 1.1.4-2
- Remove documentation.

* Mon Jul 12 2010 Gerd Hoffmann <[email protected]> - 1.1.4-1
- Initial package.
%global __strip %{mingw_strip}
%global __objdump %{mingw_objdump}
%global _use_internal_dependency_generator 0
%global __find_requires %{mingw_findrequires}
%global __find_provides %{mingw_findprovides}
%define __debug_install_post %{mingw_debug_install_post}

%global mingw_pkg_name libogg
%global mingw_build_win32 1
%global mingw_build_win64 1

Name:           mingw-libogg
Version:        1.2.2
Release:        1%{?dist}
Summary:        Cross compiled Ogg bitstream library
Group:          System Environment/Libraries
License:        BSD
URL:            http://www.xiph.org/
Source:         http://downloads.xiph.org/releases/ogg/libogg-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch

BuildRequires:  mingw32-filesystem >= 65
BuildRequires:  mingw64-filesystem >= 65
BuildRequires:  mingw32-gcc
BuildRequires:  mingw64-gcc
BuildRequires:  mingw32-binutils
BuildRequires:  mingw64-binutils
Requires:       pkgconfig

%{?mingw_debug_package}

%description
Libogg is a library for manipulating Ogg bitstream file formats.
Libogg supports both making Ogg bitstreams and getting packets from
Ogg bitstreams.

# Mingw32
%package -n mingw32-%{mingw_pkg_name}
Summary:        %{summary}

%description -n mingw32-%{mingw_pkg_name}
Libogg is a library for manipulating Ogg bitstream file formats.
Libogg supports both making Ogg bitstreams and getting packets from
Ogg bitstreams.

# Mingw64
%package -n mingw64-%{mingw_pkg_name}
Summary:        %{summary}

%description -n mingw64-%{mingw_pkg_name}
Libogg is a library for manipulating Ogg bitstream file formats.
Libogg supports both making Ogg bitstreams and getting packets from
Ogg bitstreams.


%prep
%setup -q -n libogg-%{version}

%build
%mingw_configure "--disable-static"
%mingw_make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
%mingw_make_install DESTDIR=$RPM_BUILD_ROOT
# zap docs, redundant with native package
rm -rf $RPM_BUILD_ROOT%{mingw32_docdir} $RPM_BUILD_ROOT%{mingw64_docdir}

%clean
rm -rf $RPM_BUILD_ROOT

# Mingw32
%files -n mingw32-%{mingw_pkg_name}
%defattr(-,root,root)
%doc AUTHORS CHANGES COPYING README
%{mingw32_bindir}/libogg*
%{mingw32_libdir}/libogg*
%{mingw32_libdir}/pkgconfig/ogg.pc
%dir %{mingw32_includedir}/ogg
%{mingw32_includedir}/ogg/ogg.h
%{mingw32_includedir}/ogg/os_types.h
%{mingw32_includedir}/ogg/config_types.h
%{mingw32_datadir}/aclocal/ogg.m4

# Mingw64
%files -n mingw64-%{mingw_pkg_name}
%defattr(-,root,root)
%doc AUTHORS CHANGES COPYING README
%{mingw64_bindir}/libogg*
%{mingw64_libdir}/libogg*
%{mingw64_libdir}/pkgconfig/ogg.pc
%dir %{mingw64_includedir}/ogg
%{mingw64_includedir}/ogg/ogg.h
%{mingw64_includedir}/ogg/os_types.h
%{mingw64_includedir}/ogg/config_types.h
%{mingw64_datadir}/aclocal/ogg.m4

%changelog
* Fri May 13 2011 - Marc-André Lureau <[email protected]> - 1.2.2-1
- Updated to 1.2.2
- Updated to newer mingw instructions (with mingw64 support)

* Tue Feb 08 2011 Fedora Release Engineering <[email protected]> 
- 1.1.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Jul 13 2010 Gerd Hoffmann <[email protected]> - 1.1.4-2
- Remove documentation.

* Mon Jul 12 2010 Gerd Hoffmann <[email protected]> - 1.1.4-1
- Initial package.
_______________________________________________
mingw mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/mingw

Reply via email to