#
# Copyright (C) 2006-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id: Makefile 10809 2008-04-13 09:45:50Z olli $

include $(TOPDIR)/rules.mk

PKG_NAME:=LPRng
PKG_VERSION:=3.8.A
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://nchc.dl.sourceforge.net/project/lprng/lprng/LPRng-3.8.A
PKG_MD5SUM:=506658be759aa0333149f8cb8be2b8bf
#PKG_MD5SUM:=3e39cb7b0bee306ad7df8e3552e15297

include $(INCLUDE_DIR)/package.mk

define Package/LPRng
  SECTION:=net
  CATEGORY:=Network
  TITLE:= An Extended Print Spooler System
  URL:=http://www.lprng.com/
  SUBMENU:=printing
endef

define Build/Compile
	$(MAKE) -C $(PKG_BUILD_DIR) \
		DESTDIR="$(PKG_INSTALL_DIR)" \
		all install
	$(MAKE) -C $(PKG_BUILD_DIR)/UTILS \
		DESTDIR="$(PKG_INSTALL_DIR)" \
		all install
endef

define Package/LPRng/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
	$(INSTALL_DIR) $(1)/usr/sbin
	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/lpd $(1)/usr/sbin/lpd
	#$(CP) $(PKG_INSTALL_DIR)/usr/sbin/checkpc $(1)/usr/sbin/checkpc
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/lpd.init $(1)/etc/init.d/lpd
	$(INSTALL_DIR) $(1)/etc
	$(INSTALL_DIR) $(1)/etc/lpd
	$(INSTALL_CONF) ./files/lpd.* $(1)/etc/lpd/
	$(INSTALL_CONF) ./files/printcap $(1)/etc/
	#$(INSTALL_DIR) $(1)/usr/bin
	#$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
	#$(INSTALL_DIR) $(1)/usr/man
	#$(CP) $(PKG_INSTALL_DIR)/usr/man/* $(1)/usr/man/
	#$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
endef

$(eval $(call BuildPackage,LPRng))
