1%define name	gocr
2%define version	0.52
3%define release	1
4
5%define prefix		%{_prefix}
6%define _xprefix	/usr
7%define _xbindir	%{_xprefix}/bin
8
9Summary:	Gocr is an OCR (Optical Character Recognition) program.
10Name:		%{name}
11Version:	%{version}
12Release:	%{release}
13URL:		http://www-e.uni-magdeburg.de/jschulen/ocr/
14License:	GPL
15Group:		Graphics
16Source0:	http://www-e.uni-magdeburg.de/jschulen/ocr/%{name}-%{version}.tar.gz
17#Source1:	%{name}-16x16.xpm.bz2
18#Source2:	%{name}-32x32.xpm.bz2
19#Patch0:         %{name}-DESTDIR.patch.bz2
20#Patch1:         %{name}-paths.patch.bz2
21#following packages are not really needed, but recommended
22#BuildRequires:  libnetpbm1-devel
23#BuildRequires:  gtk+-devel >= 1.2.8
24#BuildRequires:  transfig
25# set RPM_BUILD_ROOT to /var/tmp/gocr-buildroot , overwritten by .rpmmacros
26BuildRoot:	%{_tmppath}/%{name}-buildroot
27
28%description
29GOCR is an optical character recognition program.
30It reads images in many formats  and outputs a text file.
31Possible image formats are pnm, pbm, pgm, ppm, some pcx and
32tga image files. Other formats like pnm.gz, pnm.bz2, png, jpg, tiff, gif,
33bmp will be automatically converted using the netpbm-progs, gzip and bzip2
34via unix pipe.
35A simple graphical frontend written in tcl/tk and some
36sample files (you need transfig for the sample files) are included.
37Gocr is also able to recognize and translate barcodes.
38You do not have to train the program or store large font bases.
39Simply call gocr from the command line and get your results.
40
41
42#%package -n %{name}-devel
43#Summary:	Development tools for gocr.
44#Group:		Development/C
45
46#%description -n %{name}-devel
47#GOCR is an optical character recognition program.
48#If you want to develop programs which will manipulate gocr, you should
49#install gocr-devel.  You'll also need to install the gocr package.
50
51
52# not tested, what about gocr.tcl ???
53# switched off because gtk-devel was not available on my PC (joerg Aug06)
54# and you dont need it to get gocr working
55#%package -n %{name}-gtk
56#Summary:	Gtk+ frontend for gocr
57#Group: 		Graphics
58#Requires:	%{name} = %{version}
59#BuildRequires:  gtk-devel >= 1.2.8
60
61#% description -n %{name}-gtk
62#Gtk-gocr is a graphical frontend to GOCR the
63#optical character recognition program.
64#
65#Gtk+-based frontend for gocr.
66
67# rpmbuild -bp: unpacking sources and applaying patches
68%prep
69rm -rf $RPM_BUILD_ROOT
70
71%setup -q
72#%patch0 -p1
73#%patch1 -p1
74
75# rpmbuild -bc: build, after prep, invokes make
76# please help
77%build
78%configure --with-netpbm=no
79%{__make} DESTDIR=$RPM_BUILD_ROOT
80echo "build end"
81
82# [ -e config.cache ] && rm -f config.cache
83# % configure --with-netpbm=no --prefix=%{_xprefix} --bindir=%{_xbindir}
84# % {__make}
85
86# rpmbuild -bi: install-stage
87%install
88
89%{__make} install DESTDIR=$RPM_BUILD_ROOT
90
91# not needed anymore
92# % post -n %name-gtk
93# % {update_menus}
94#
95# % postun -n %name-gtk
96# % {clean_menus}
97echo "install end"
98
99%clean
100rm -rf $RPM_BUILD_ROOT
101echo "clean end"
102
103# rpmbuild -bl: list check, check that every file exists
104%files -n %{name}
105%defattr(-, root, root)
106%doc AUTHORS BUGS CREDITS HISTORY README REMARK.txt TODO
107%doc doc/{examples.txt,gocr.html,unicode.txt}
108%doc examples/{ex.fig,font2.fig,ocr-a.png,ocr-b.png}
109%{_mandir}/man1/*
110%attr(755,root,root) %{_bindir}/*
111
112#%files -n %{name}-devel
113#%defattr(-, root, root)
114#%doc AUTHORS REVIEW
115#%{_libdir}/libPgm2asc.a
116#%{_includedir}/gocr.h
117
118#%files -n %{name}-gtk
119#%defattr(-, root, root)
120#%doc frontend/gnome/{AUTHORS,README,TODO}
121##%{_menudir}/*
122##%{_iconsdir}/*
123#%attr(755,root,root) %{_xbindir}/*
124
125%changelog
126* Tue Feb  5 2008 Joerg Schulenburg, 0.46
127- remove devel part (for simplicity)
128
129* Wed Aug 30 2006 Joerg Schulenburg, 0.41
130- remove gtk-part (dont work on my PC)
131
132* Sat Dec 27 2003 Nick Urbanik <nicku(at)vtc.edu.hk> 0.38-1.1nu
133- Change %make to %{__make}
134- check config.cache exists before trying to delete it
135- Fix the files list for documentation.
136- add back the gtk frontend
137- Added the correct build require for gtk frontend
138- various other fixes to get it to build.
139
140* Tue Jan 29 2001 Joerg Schulenburg <jschulen-at-gmx.de-NOSPAM> 0.3.6-1
141- gocr.spec taken krom  Marcel Pol <mpol(at)gmx.net>
142
143# check: rpmbuild -ba --nobuild gocr.spec
144