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