Makefile - Gocr an OCR (Optical Character Recognition) program

$ cat OpenWRT/feeds/packages/utils/gocr/Makefile
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=gocr
PKG_VERSION:=0.52
PKG_RELEASE:=1

PKG_SOURCE_URL:=http://www-e.uni-magdeburg.de/jschulen/ocr/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_HASH:=df906463105f5f4273becc2404570f187d4ea52bd5769d33a7a8661a747b8686

PKG_MAINTAINER:=Joerg Schulenburg <jschulen at gmxNOSPAM.de> (remove NOSPAM)
PKG_LICENSE:=GPL
PKG_LICENSE_FILES:=LICENSE

include $(INCLUDE_DIR)/package.mk

define Package/gocr/Default
  SECTION:=utils
  CATEGORY:=Utilities
  URL:=https://www-e.ovgu.de/jschulen/ocr/
endef

define Package/gocr
  $(call Package/gocr/Default)
  TITLE:=Gocr is an OCR (Optical Character Recognition) program
  #DEPENDS:=+make +gcc
endef

define Package/gocr/description
 GOCR is an optical character recognition program. 
 It reads images in many formats  and outputs a text file.
 Possible image formats are pnm, pbm, pgm, ppm, some pcx and
 tga image files. Other formats like pnm.gz, pnm.bz2, png, jpg, tiff, gif,
 bmp will be automatically converted using the netpbm-progs, gzip and bzip2
 via unix pipe.
 A simple graphical frontend written in tcl/tk and some
 sample files (you need transfig for the sample files) are included.
 Gocr is also able to recognize and translate barcodes.
 You do not have to train the program or store large font bases.
 Simply call gocr from the command line and get your results.
endef

define Build/Prepare
	rm -rf $(PKG_BUILD_DIR)/
	mkdir -p $(PKG_BUILD_DIR)/
	$(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
endef

define Package/gocr/install
	$(INSTALL_DIR) $(1)/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/gocr $(1)/bin/
endef

$(eval $(call BuildPackage,gocr))
1 Like