InstallDev should be using (1) and not (STAGING_DIR)
[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.1.23
13 PKG_RELEASE:=1
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:=4ce09b1dce09b6b9398af0daae9adf63
21 PKG_CAT:=bzcat
22
23 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
24 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
25
26 PKG_BUILD_DEPENDS:=zlib
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/cups
31   SECTION:=net
32   CATEGORY:=Network
33   DEPENDS:=+zlib
34   TITLE:=Common UNIX Printing System
35   DESCRIPTION:=\
36         A printer spooling system for devices with USB or LP support.
37   URL:=http://www.cups.org/
38 endef
39
40 define Package/cups/conffiles
41 /etc/cups/classes.conf
42 /etc/cups/client.conf
43 /etc/cups/cupsd.conf
44 /etc/cups/printers.conf
45 endef
46
47 define Build/Configure
48         $(call Build/Configure/Default, \
49                 --with-cups-user=root \
50                 --with-cups-group=root \
51                 --without-perl \
52                 --without-python \
53                 --without-php \
54                 --enable-shared \
55                 --disable-pam \
56                 --disable-slp \
57                 --disable-gnutls \
58                 --disable-openssl \
59                 --disable-cdsassl \
60                 --disable-ssl \
61                 --disable-slp, \
62                 UNAME="Linux" \
63         )
64 endef
65
66 define Build/Compile
67         rm -rf $(PKG_INSTALL_DIR)
68         mkdir -p $(PKG_INSTALL_DIR)
69         $(MAKE) -C $(PKG_BUILD_DIR) \
70                 $(TARGET_CONFIGURE_OPTS) \
71                 DSTROOT="$(PKG_INSTALL_DIR)" \
72                 STRIP="/bin/true" \
73                 all install
74 endef
75
76 define Package/cups/install
77         rm -rf $(1)/etc/cups
78         $(INSTALL_DIR) $(1)/etc/cups
79         $(CP) $(PKG_INSTALL_DIR)/etc/cups/* $(1)/etc/cups/
80         rm -rf $(1)/etc/cups/certs
81         ln -sf /tmp $(1)/etc/cups/certs
82         $(INSTALL_DIR) $(1)/usr/bin
83         $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
84         rm -f $(1)/usr/bin/cups-config
85         $(INSTALL_DIR) $(1)/usr/lib
86         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcups.so.* $(1)/usr/lib/
87         $(CP) $(PKG_INSTALL_DIR)/usr/lib/cups $(1)/usr/lib/
88         $(INSTALL_DIR) $(1)/usr/share/cups/templates
89         $(CP) $(PKG_INSTALL_DIR)/usr/share/cups/templates/*.tmpl $(1)/usr/share/cups/templates/
90         $(INSTALL_DIR) $(1)/usr/share/doc/cups
91         $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/cups/index.html $(1)/usr/share/doc/cups/
92         $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/cups/images $(1)/usr/share/doc/cups/
93         $(INSTALL_DIR) $(1)/usr/sbin
94         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
95         # overwrite default config with our own
96         $(CP) ./files/etc/cups/* $(1)/etc/cups/
97         # install initscript with priority 60
98         $(INSTALL_DIR) $(1)/etc/init.d
99         $(INSTALL_BIN) ./files/cupsd.init $(1)/etc/init.d/cupsd
100 endef
101
102 define Build/InstallDev
103         mkdir -p $(1)/usr/bin
104         $(CP) $(PKG_INSTALL_DIR)/usr/bin/cups-config $(1)/usr/bin/
105         mkdir -p $(1)/usr/include
106         $(CP) $(PKG_INSTALL_DIR)/usr/include/cups $(1)/usr/include/
107         mkdir -p $(1)/usr/lib
108         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcups.{a,so*} $(1)/usr/lib/
109 endef
110
111 define Build/UninstallDev
112         rm -rf \
113                 $(STAGING_DIR)/usr/bin/cups-config \
114                 $(STAGING_DIR)/usr/include/cups \
115                 $(STAGING_DIR)/usr/lib/libcups.{a,so*}
116 endef
117
118 $(eval $(call BuildPackage,cups))