]> git.pld-linux.org Git - packages/zinnia.git/commitdiff
- initial revision auto/th/zinnia-0_06-1
authorJan Rękorajski <baggins@pld-linux.org>
Thu, 21 Jul 2011 20:53:43 +0000 (20:53 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    Makefile.tomoe -> 1.1
    tomoe2s.pl -> 1.1
    zinnia-gcc.patch -> 1.1
    zinnia.spec -> 1.1

Makefile.tomoe [new file with mode: 0644]
tomoe2s.pl [new file with mode: 0644]
zinnia-gcc.patch [new file with mode: 0644]
zinnia.spec [new file with mode: 0644]

diff --git a/Makefile.tomoe b/Makefile.tomoe
new file mode 100644 (file)
index 0000000..b5a9728
--- /dev/null
@@ -0,0 +1,20 @@
+TOMOE_MODEL_PATH = /usr/share/tomoe/recognizer/
+
+build: handwriting-ja.model handwriting-zh_CN.model tomoe2s.pl
+
+handwriting-ja.model: $(TOMOE_MODEL_PATH)/handwriting-ja.xml
+       perl tomoe2s.pl $(TOMOE_MODEL_PATH)/handwriting-ja.xml > handwriting-ja.s
+       LD_LIBRARY_PATH=.libs/ ./zinnia_learn handwriting-ja.s handwriting-ja.model
+       LD_LIBRARY_PATH=.libs/ ./zinnia_convert handwriting-ja.model.txt handwriting-ja.model
+
+handwriting-zh_CN.model: $(TOMOE_MODEL_PATH)/handwriting-zh_CN.xml
+       perl tomoe2s.pl $(TOMOE_MODEL_PATH)/handwriting-zh_CN.xml > handwriting-zh_CN.s
+       LD_LIBRARY_PATH=.libs/ ./zinnia_learn handwriting-zh_CN.s handwriting-zh_CN.model
+       LD_LIBRARY_PATH=.libs/ ./zinnia_convert handwriting-zh_CN.model.txt handwriting-zh_CN.model
+
+
+install: build
+       install -d  $(DESTDIR)/usr/share/zinnia//model/tomoe
+       install -m 0644 -p handwriting-ja.model handwriting-zh_CN.model $(DESTDIR)/usr/share/zinnia//model/tomoe
+
+
diff --git a/tomoe2s.pl b/tomoe2s.pl
new file mode 100644 (file)
index 0000000..2400cc8
--- /dev/null
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+
+use utf8;
+my $value;
+my $stroke;
+my $strokes;
+
+while (<>) {
+    if (/<character>/) {
+       while (<>) {
+           if (/<utf8>([^<]+)<\/utf8>/) {
+               $value = $1;
+               $value =~ s/^&#x//;
+               $value = pack("U", hex($value));
+               utf8::encode($value);
+               $stroke = "";
+               $strokes = "";
+           } elsif (/<point x=\"(\d+)\" y=\"(\d+)\"/) {
+               my $x = $1;
+               my $y = $2;
+#              print "$x $y\n";
+               $stroke .= "($x $y)";
+           } elsif (/<\/stroke>/) {
+               $strokes .= "($stroke)";
+               $stroke = "";
+           } elsif (/<\/character>/) {
+                if ($value !~ /[\(\)]/) {
+                    print "(character (value $value)(width 1000)(height 1000)(strokes $strokes))\n";
+                }
+               $value = "";
+               last;
+           }
+       }
+    }
+}
diff --git a/zinnia-gcc.patch b/zinnia-gcc.patch
new file mode 100644 (file)
index 0000000..eb125ee
--- /dev/null
@@ -0,0 +1,36 @@
+diff -p -up zinnia-0.05/perl/Makefile.PL.bindings zinnia-0.05/perl/Makefile.PL
+--- zinnia-0.05/perl/Makefile.PL.bindings      2008-09-13 18:59:36.000000000 +0200
++++ zinnia-0.05/perl/Makefile.PL       2009-11-19 14:17:39.000000000 +0100
+@@ -3,8 +3,8 @@ WriteMakefile(
+     'NAME'            => 'zinnia',
+     'CC'                => 'c++',
+     'LD'                => 'c++',
+-    'INC'               => '',
+-    'LIBS'              => '-lzinnia',
++    'INC'               => '-I../',
++    'LIBS'              => '-L../.libs -lzinnia',
+ #    'VERSION'                => '0.1',
+     'OBJECT'            => 'zinnia_wrap.o' 
+ );
+diff -p -up zinnia-0.05/perl/zinnia_wrap.cxx.bindings zinnia-0.05/perl/zinnia_wrap.cxx
+--- zinnia-0.05/perl/zinnia_wrap.cxx.bindings  2009-05-31 06:39:39.000000000 +0200
++++ zinnia-0.05/perl/zinnia_wrap.cxx   2009-11-19 14:18:46.000000000 +0100
+@@ -11,6 +11,7 @@
+ #define SWIGPERL
+ #define SWIG_CASTRANK_MODE
++#include <cstring>
+ #ifdef __cplusplus
+ /* SwigValueWrapper is described in swig.swg */
+diff -p -up zinnia-0.05/python/zinnia_wrap.cxx.bindings zinnia-0.05/python/zinnia_wrap.cxx
+--- zinnia-0.05/python/zinnia_wrap.cxx.bindings        2009-05-31 06:39:41.000000000 +0200
++++ zinnia-0.05/python/zinnia_wrap.cxx 2009-11-19 14:19:10.000000000 +0100
+@@ -11,6 +11,7 @@
+ #define SWIGPYTHON
+ #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
++#include <cstring>
+ #ifdef __cplusplus
+ /* SwigValueWrapper is described in swig.swg */
diff --git a/zinnia.spec b/zinnia.spec
new file mode 100644 (file)
index 0000000..3958cec
--- /dev/null
@@ -0,0 +1,211 @@
+#
+# Conditional build:
+%bcond_without static_libs     # don't build static libraries
+#
+%include       /usr/lib/rpm/macros.perl
+Summary:       Online handwriting recognition system with machine learning
+Name:          zinnia
+Version:       0.06
+Release:       1
+License:       BSD
+Group:         Libraries
+Source0:       http://downloads.sourceforge.net/zinnia/%{name}-%{version}.tar.gz
+# Source0-md5: 5ed6213e2b879465783087a0cf6d5fa0
+# http://zinnia.svn.sourceforge.net/viewvc/zinnia/zinnia/tomoe2s.pl
+Source1:       tomoe2s.pl
+Source2:       Makefile.tomoe
+Patch0:                %{name}-gcc.patch
+URL:           http://zinnia.sourceforge.net/
+BuildRequires: db-devel
+BuildRequires: perl(ExtUtils::MakeMaker)
+BuildRequires: perl-devel >= 1:5.8.0
+BuildRequires: python-devel
+BuildRequires: rpm-perlprov >= 4.1-13
+BuildRequires: tomoe
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Zinnia provides a simple, customizable, and portable dynamic OCR
+system for hand-written input, based on Support Vector Machines.
+
+Zinnia simply receives user pen strokes as coordinate data and outputs
+the best matching characters sorted by SVM confidence. To maintain
+portability, it has no rendering functionality. In addition to
+recognition, Zinnia provides a training module capable of creating
+highly efficient handwriting recognition models.
+
+This package contains the shared libraries.
+
+%package devel
+Summary:       Development files for zinnia
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description devel
+This package contains libraries and header files for developing
+applications that use zinnia.
+
+%package utils
+Summary:       Utils for the zinnia library
+Group:         Applications/System
+Requires:      %{name} = %{version}-%{release}
+
+%description utils
+This package provides utilities for zinnia library that use zinnia.
+
+%package static
+Summary:       Static zinnia library
+Summary(pl.UTF-8):     Statyczna biblioteka zinnia
+Group:         Development/Libraries
+Requires:      %{name}-devel = %{version}-%{release}
+
+%description static
+Static zinnia library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka zinnia.
+
+%package doc
+Summary:       Documents for the zinnia library
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description doc
+This package provide documents for zinnia library that use zinnia.
+
+%package -n perl-zinnia
+Summary:       Perl bindings for zinnia
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description -n perl-zinnia
+This package contains perl bindings for zinnia.
+
+%package -n python-zinnia
+Summary:       Python bindings for zinnia
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description -n python-zinnia
+This package contains python bindings for zinnia.
+
+%package tomoe
+Summary:       Tomoe model file for zinnia
+Group:         Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description tomoe
+This package contains tomoe model files for zinnia.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%{__rm} python/zinnia.pyc
+
+cp %{SOURCE1} .
+cp %{SOURCE2} .
+
+iconv -f latin1 -t utf8 doc/zinnia.css > doc/zinnia.css.utf8
+mv -f doc/zinnia.css.utf8 doc/zinnia.css
+
+%build
+%configure
+
+%{__make} \
+       CFLAGS="%{rpmcflags}" \
+       CXXFLAGS="%{rpmcxxflags}" \
+       LDFLAGS="%{rpmldflags}"
+
+%{__make} -f Makefile.tomoe build
+
+cd perl
+%{__perl} Makefile.PL \
+       INSTALLDIRS=vendor
+
+%{__make} \
+       CC="%{__cc}"
+       OPTIMIZE="%{rpmcflags}"
+cd ..
+
+cd python
+CC="%{__cc}" \
+CFLAGS="-I../ %{rpmcflags}" \
+LDFLAGS="-L../.libs %{rpmldflags}" \
+%{__python} setup.py build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+%{__make} -f Makefile.tomoe install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+cd perl
+%{__make} pure_install \
+       DESTDIR=$RPM_BUILD_ROOT
+cd ..
+
+cd python
+%{__python} setup.py install \
+       --skip-build \
+       --optimize=2 \
+       --root=$RPM_BUILD_ROOT
+
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc README
+%attr(755,root,root) %{_libdir}/libzinnia.so.*.*.*
+%attr(755,root,root) %{_libdir}/libzinnia.so.[0-9]
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libzinnia.so
+%{_includedir}/zinnia*
+%{_pkgconfigdir}/zinnia.pc
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libzinnia.a
+%endif
+
+%files utils
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/zinnia
+%attr(755,root,root) %{_bindir}/zinnia_convert
+%attr(755,root,root) %{_bindir}/zinnia_learn
+
+%files doc
+%defattr(644,root,root,755)
+%doc doc/*
+
+%files -n perl-zinnia
+%defattr(644,root,root,755)
+%dir %{perl_vendorarch}/auto/zinnia
+%attr(755,root,root) %{perl_vendorarch}/auto/zinnia/zinnia.so
+%{perl_vendorarch}/zinnia.pm
+
+%files -n python-zinnia
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/_zinnia.so
+%{py_sitedir}/zinnia.py*
+%{py_sitedir}/zinnia*.egg-info
+
+%files tomoe
+%defattr(644,root,root,755)
+%dir %{_datadir}/zinnia
+%dir %{_datadir}/zinnia/model
+%dir %{_datadir}/zinnia/model/tomoe
+%{_datadir}/zinnia/model/tomoe/handwriting-ja.model
+%{_datadir}/zinnia/model/tomoe/handwriting-zh_CN.model
This page took 0.117701 seconds and 4 git commands to generate.