+#
+# Conditional build:
+%bcond_without php # build PHP Binding
+
%include /usr/lib/rpm/macros.perl
Summary: Ming - an SWF output library
Summary(pl.UTF-8): Ming - biblioteka do produkcji plików SWF
Name: ming
-Version: 0.3.0
-Release: 5
+Version: 0.4.5
+Release: 4
License: LGPL
Group: Libraries
-Source0: http://dl.sourceforge.net/ming/%{name}-%{version}.tar.gz
-# Source0-md5: 56b29eeb4fdd0b98c9ee62e25d14841d
-Source1: http://dl.sourceforge.net/ming/%{name}-perl-%{version}.tar.gz
-# Source1-md5: 506acca9ca42066a97fc0b6abad6d57a
-Source2: http://dl.sourceforge.net/ming/%{name}-py-%{version}.tar.gz
-# Source2-md5: 96d3f42f13d020d907287a640b39ec46
-Patch0: %{name}-DESTDIR.patch
-Patch1: %{name}-build.patch
-Patch2: %{name}-perl-shared.patch
+Source0: http://downloads.sourceforge.net/ming/%{name}-%{version}.tar.gz
+# Source0-md5: a35735a1c4f51681b96bcbfba58db2a0
+Patch0: %{name}-perl-shared.patch
+Patch1: am.patch
+Patch2: %{name}-giflib.patch
URL: http://ming.sourceforge.net/
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: bison
+BuildRequires: flex
+BuildRequires: freetype-devel
BuildRequires: giflib-devel
+BuildRequires: libpng-devel
+BuildRequires: libstdc++-devel
+BuildRequires: libtool
BuildRequires: python-devel >= 1:2.4
BuildRequires: rpm-perlprov >= 4.0.2-24
BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.344
+BuildRequires: swig
+BuildRequires: swig-tcl
+BuildRequires: tcl
+BuildRequires: tcl-devel
BuildRequires: zlib-devel
+%if %{with php}
+BuildRequires: %{php_name}-cli
+BuildRequires: %{php_name}-devel >= 4:5.3
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
- swftophp - próbuje zrobić skrypt php/ming z pliku swf
%package -n perl-ming
-Summary: Ming perl module
-Summary(pl.UTF-8): Moduł perla Ming
+Summary: Ming Perl module
+Summary(pl.UTF-8): Moduł Perla Ming
Group: Development/Languages/Perl
Requires: %{name} = %{version}-%{release}
Obsoletes: ming-perl
%description -n perl-ming -l pl.UTF-8
Moduł perla Ming - perlowy wrapper do biblioteki Ming.
+%package -n %{php_name}-ming
+Summary: Ming module for PHP
+Summary(pl.UTF-8): Moduł Ming dla PHP
+Group: Development/Languages/PHP
+Requires: %{name} = %{version}-%{release}
+%{?requires_php_extension}
+
+%description -n %{php_name}-ming
+PHP interface to Ming SWF generating library.
+
+%description -n %{php_name}-ming -l pl.UTF-8
+Interfejs PHP do biblioteki Ming generującej pliki SWF.
+
%package -n python-ming
Summary: Ming Python module
Summary(pl.UTF-8): Moduł biblioteki Ming dla języka Python
Group: Development/Languages/Perl
Requires: %{name} = %{version}-%{release}
-%pyrequires_eq python-libs
+Requires: python-libs
%description -n python-ming
Ming Python module.
%description -n python-ming -l pl.UTF-8
Moduł biblioteki Ming dla języka Python.
+%package -n tcl-ming
+Summary: Ming module for Tcl
+Summary(pl.UTF-8): Moduł Ming dla Tcl-a
+Group: Development/Languages/Tcl
+Requires: %{name} = %{version}-%{release}
+Requires: tcl
+
+%description -n tcl-ming
+Tcl interface to Ming SWF generating library.
+
+%description -n tcl-ming -l pl.UTF-8
+Interfejs Tcl do biblioteki Ming generującej pliki SWF.
+
%prep
-%setup -q -b1 -b2
+%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
-ln -s src/ming.h
-
%build
-%configure
-%{__make} -j1
-
-cd perl_ext
-%{__perl} Makefile.PL \
- INSTALLDIRS=vendor
-%{__make} \
- CC="%{__cc}" \
- OPTIMIZE="%{rpmcflags}"
-cd ..
-
-%{__make} -C py_ext \
- CC="%{__cc}" \
- CFLAGS="%{rpmcflags}" \
- PYINCDIR=%{py_incdir}
+%{__libtoolize}
+%{__aclocal} -I macros
+%{__autoconf}
+%{__automake}
+%configure \
+ --enable-perl \
+ %{?with_php:--enable-php} \
+ --enable-python \
+ --enable-tcl \
+ --disable-silent-rules
+
+%{__make} -j1 \
+ mingc_ladir=%{_libdir}/tclming
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_libdir}
-
%{__make} install \
- DESTDIR=$RPM_BUILD_ROOT
-chmod +x $RPM_BUILD_ROOT%{_libdir}/libming.so.0.3.0
-
-%{__make} -C perl_ext pure_install \
- DESTDIR=$RPM_BUILD_ROOT
-
-%{__make} -C py_ext install \
- PREFIX="--optimize=2 --root=$RPM_BUILD_ROOT"
+ DESTDIR=$RPM_BUILD_ROOT \
+ mingc_ladir=%{_libdir}/tclming
+
+%if %{with php}
+install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
+cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/ming.ini
+; Enable ming extension module
+extension=ming.so
+EOF
+%endif
-rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/SWF/.cvsignore
-rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/SWF/.packlist
-rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/SWF/include/libming.a
-rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/SWF/include/ming.h
-rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/SWF/include/perl_swf.h
-rm -f $RPM_BUILD_ROOT%{py_sitedir}/ming*.py
+%{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/SWF/.packlist
+%{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/ming*.py
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/tclming/*.{la,a}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc CREDITS README TODO
+%doc README TODO
%attr(755,root,root) %{_libdir}/libming.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libming.so.0
+%attr(755,root,root) %ghost %{_libdir}/libming.so.1
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libming.so
+%{_libdir}/libming.la
%{_includedir}/ming.h
%{_includedir}/mingpp.h
-%{_includedir}/ming_config.h
+%{_pkgconfigdir}/libming.pc
%files static
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/makeswf
%attr(755,root,root) %{_bindir}/ming-config
%attr(755,root,root) %{_bindir}/png2dbl
-%attr(755,root,root) %{_bindir}/png2swf
%attr(755,root,root) %{_bindir}/raw2adpcm
+%attr(755,root,root) %{_bindir}/swftocxx
%attr(755,root,root) %{_bindir}/swftoperl
%attr(755,root,root) %{_bindir}/swftophp
%attr(755,root,root) %{_bindir}/swftopython
-%{_mandir}/man1/makeswf.1*
+%attr(755,root,root) %{_bindir}/swftotcl
%files -n perl-ming
%defattr(644,root,root,755)
%{perl_vendorarch}/SWF.pm
%{perl_vendorarch}/SWF
%dir %{perl_vendorarch}/auto/SWF
-%{perl_vendorarch}/auto/SWF/SWF.bs
%attr(755,root,root) %{perl_vendorarch}/auto/SWF/SWF.so
%{_mandir}/man3/SWF*
+%if %{with php}
+%files -n %{php_name}-ming
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/ming.ini
+%attr(755,root,root) %{php_extensiondir}/ming.so
+%endif
+
%files -n python-ming
%defattr(644,root,root,755)
%doc py_ext/{README,TODO}
%if "%{py_ver}" > "2.4"
%{py_sitedir}/mingc-*.egg-info
%endif
+
+%files -n tcl-ming
+%defattr(644,root,root,755)
+%doc tcl_ext/README
+%dir %{_libdir}/tclming
+%attr(755,root,root) %{_libdir}/tclming/mingc.so