21238d418bdf2b52818229178e196a7bdefbffd2
[packages.git] / net / cups / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=cups
12 PKG_VERSION:=1.3.7
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.tar.bz2
16 PKG_SOURCE_URL:= \
17         http://ftp.rz.tu-bs.de/pub/mirror/ftp.easysw.com/ftp/pub/cups/$(PKG_VERSION) \
18         ftp://ftp.easysw.com/pub/cups/$(PKG_VERSION) \
19         ftp://ftp3.easysw.com/pub/cups/$(PKG_VERSION)
20 PKG_MD5SUM:=db4a45a17104f10f3ee599d88267c9e5
21
22 PKG_BUILD_DEPENDS:=zlib
23
24 TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/cups
29   SECTION:=net
30   CATEGORY:=Network
31   DEPENDS:=+zlib +libpthread +libpng +libjpeg
32   TITLE:=Common UNIX Printing System
33   URL:=http://www.cups.org/
34   SUBMENU:=printing
35 endef
36
37 define Package/cups/description
38         A printer spooling system for devices with USB or LP support.
39 endef
40
41 define Package/cups/conffiles
42 /etc/cups/classes.conf
43 /etc/cups/client.conf
44 /etc/cups/cupsd.conf
45 /etc/cups/printers.conf
46 endef
47
48 define Build/Configure
49         $(call Build/Configure/Default, \
50                 --with-cups-user=root \
51                 --with-cups-group=root \
52                 --without-perl \
53                 --without-python \
54                 --without-php \
55                 --enable-shared \
56                 --disable-dbus \
57                 --disable-pam \
58                 --disable-slp \
59                 --disable-gnutls \
60                 --disable-openssl \
61                 --disable-cdsassl \
62                 --disable-ssl \
63                 --disable-gssapi \
64                 --disable-slp, \
65                 UNAME="Linux" \
66                 LIBS="-L$(STAGING_DIR)/usr/lib -lz -lpng -ljpeg" \
67         )
68 endef
69
70 define Build/Compile
71         rm -rf $(PKG_INSTALL_DIR)
72         mkdir -p $(PKG_INSTALL_DIR)
73         $(MAKE) -C $(PKG_BUILD_DIR) \
74                 $(TARGET_CONFIGURE_OPTS) \
75                 DSTROOT="$(PKG_INSTALL_DIR)" \
76                 STRIP="/bin/true" \
77                 all install
78 endef
79
80 define Package/cups/install
81         rm -rf $(1)/etc/cups
82         $(INSTALL_DIR) $(1)/etc/cups
83         $(CP) $(PKG_INSTALL_DIR)/etc/cups/* $(1)/etc/cups/
84         rm -rf $(1)/etc/cups/certs
85         ln -sf /tmp $(1)/etc/cups/certs
86         $(INSTALL_DIR) $(1)/usr/bin
87         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
88         rm -f $(1)/usr/bin/cups-config
89         $(INSTALL_DIR) $(1)/usr/lib
90         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcups.so* $(1)/usr/lib/
91         $(CP) $(PKG_INSTALL_DIR)/usr/lib/cups $(1)/usr/lib/
92         $(INSTALL_DIR) $(1)/usr/share/cups/templates
93         $(CP) $(PKG_INSTALL_DIR)/usr/share/cups/templates/*.tmpl $(1)/usr/share/cups/templates/
94         $(INSTALL_DIR) $(1)/usr/share/doc/cups
95         $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/cups/index.html $(1)/usr/share/doc/cups/
96         $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/cups/*.css $(1)/usr/share/doc/cups/
97         $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/cups/images $(1)/usr/share/doc/cups/
98         $(INSTALL_DIR) $(1)/usr/sbin
99         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
100         # overwrite default config with our own
101         $(CP) ./files/etc/cups/* $(1)/etc/cups/
102         # install initscript with priority 60
103         $(INSTALL_DIR) $(1)/etc/init.d
104         $(INSTALL_BIN) ./files/cupsd.init $(1)/etc/init.d/cupsd
105 endef
106
107 define Build/InstallDev
108         $(INSTALL_DIR) $(2)/bin
109         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cups-config $(2)/bin/
110         $(INSTALL_DIR) $(1)/usr/include
111         $(CP) $(PKG_INSTALL_DIR)/usr/include/cups $(1)/usr/include/
112         $(INSTALL_DIR) $(1)/usr/lib
113         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcups.so* $(1)/usr/lib/
114 endef
115
116 $(eval $(call BuildPackage,cups))