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