Home | History | Annotate | Download | only in cups
      1 #
      2 #
      3 # CDDL HEADER START
      4 #
      5 # The contents of this file are subject to the terms of the
      6 # Common Development and Distribution License (the "License").
      7 # You may not use this file except in compliance with the License.
      8 #
      9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10 # or http://www.opensolaris.org/os/licensing.
     11 # See the License for the specific language governing permissions
     12 # and limitations under the License.
     13 #
     14 # When distributing Covered Code, include this CDDL HEADER in each
     15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16 # If applicable, add the following below this CDDL HEADER, with the
     17 # fields enclosed by brackets "[]" replaced with your own identifying
     18 # information: Portions Copyright [yyyy] [name of copyright owner]
     19 #
     20 # CDDL HEADER END
     21 #
     22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 # 
     25 #ident	"@(#)Makefile.sfw	1.9	09/10/23 SMI"
     26 #
     27 
     28 include ../Makefile.cmd
     29 
     30 VER =		$(COMPONENT_NAME:sh)-$(COMPONENT_VERSION:sh)
     31 TARBALL=	$(VER)-source.tar.bz2
     32 PATCHES:sh =	echo Patches/[0-9]*.patch
     33 
     34 CCC	 	+=	-norunpath
     35 
     36 #	configure(1) options to use
     37 # a default --prefix and --mandir are set in Makefile.master
     38 CONFIGURE_OPTIONS +=	--localedir=$(CFGLOCALE)
     39 CONFIGURE_OPTIONS +=	--sysconfdir=$(CFGETC)
     40 CONFIGURE_OPTIONS +=	--localstatedir=/var
     41 CONFIGURE_OPTIONS +=	--with-fontpath=/usr/openwin/lib
     42 CONFIGURE_OPTIONS +=	--with-logdir=/var/log/cups
     43 CONFIGURE_OPTIONS +=	--with-domainsocket=/var/run/cups-socket
     44 CONFIGURE_OPTIONS +=	--with-smfmanifestdir=/var/svc/manifest/application
     45 CONFIGURE_OPTIONS +=	--with-printcap=/etc/printers.conf
     46 CONFIGURE_OPTIONS +=	--with-cups-user=lp
     47 CONFIGURE_OPTIONS +=	--with-cups-group=lp
     48 CONFIGURE_OPTIONS +=	--disable-static
     49 CONFIGURE_OPTIONS +=	--disable-gnutls
     50 CONFIGURE_OPTIONS +=	--disable-libusb
     51 CONFIGURE_OPTIONS +=	--enable-openssl
     52 CONFIGURE_OPTIONS +=	--enable-dbus
     53 CONFIGURE_OPTIONS +=	--enable-threads
     54 CONFIGURE_OPTIONS +=	--enable-64bit
     55 
     56 TARGET_ENV +=	CC="$(CC)"
     57 TARGET_ENV += 	CXX="$(CCC)"
     58 TARGET_ENV += 	CPPFLAGS="$(CPPFLAGS)"
     59 TARGET_ENV += 	LD_OPTIONS="$(LDLIBS)"
     60 TARGET_ENV += 	DSO64FLAGS="$(LDLIBS) -G"
     61 TARGET_ENV += 	PATH="$(SFW_PATH)"
     62 TARGET_ENV += 	MAKE="$(CCSMAKE)"
     63 
     64 all:=		TARGET = all
     65 install:=	TARGET = install
     66 install:=	TARGET_ENV +=	ROOT="$(ROOT)"
     67 install:=	TARGET_ENV +=	DSTROOT="$(ROOT)"
     68 install:=	TARGET_ENV +=	MAN1EXT="1cups"
     69 install:=	TARGET_ENV +=	MAN8EXT="1cups"
     70 install:=	TARGET_ENV +=	MAN8DIR="1cups"
     71 install:=	TARGET_ENV +=	INSTALL="$(INSTALL_PROTO)"
     72 install:=	TARGET_ENV +=	MANSCRIPT="$(COMPONENT_TOP)/sunman-stability"
     73 install:=	TARGET_ENV += 	PATH="$(SRC)/tools:$(SFW_PATH)"
     74 install:=	TARGET_ENV += 	MAKE="$(CCSMAKE)"
     75 
     76 #
     77 #  Hopefully you will not need to make changes below this point
     78 #
     79 
     80 all:	$(VER)/config.status
     81 	(cd $(VER) ; env $(TARGET_ENV) $(CCSMAKE) $(TARGET))
     82 
     83 install:	install-protofix
     84 
     85 install-target:		all
     86 	# fix to not conflict with JDS
     87 	$(MKDIR) -p $(ROOT)/$(CFGLOCALE)/zh_CN
     88 	$(RM) -r $(ROOT)/$(CFGLOCALE)/zh
     89 	$(SYMLINK) zh_CN $(ROOT)/$(CFGLOCALE)/zh
     90 	# install the bits in the proto area
     91 	(cd $(VER) ; env $(TARGET_ENV) $(CCSMAKE) $(TARGET))
     92 	# install the default config file
     93 	$(MV) $(ROOT)/etc/cups/cupsd.conf.default $(ROOT)/etc/cups/cupsd.conf
     94 	touch $(ROOT)/etc/cups/command.types
     95 	# move the conflicting commands to /usr/lib/cups/bin
     96 	$(MKDIR) -p $(ROOT)/usr/lib/cups/bin
     97 	for file in cancel lp lpr lpstat lpq lprm ; do \
     98 		$(MV) $(ROOT)/usr/bin/$$file $(ROOT)/usr/lib/cups/bin ; \
     99 	done
    100 	for file in cupsaccept cupsreject accept cupsdisable lpc lpmove cupsenable lpadmin reject ; do \
    101 		$(MV) $(ROOT)/usr/sbin/$$file $(ROOT)/usr/lib/cups/bin ; \
    102 	done
    103 	# install the smf help
    104 	$(MKDIR) -p $(ROOT)/usr/lib/help/auths/locale/C
    105 	$(INSTALL_PROTO) -m 0444 ManageCUPS.html $(ROOT)/usr/lib/help/auths/locale/C/ManageCUPS.html
    106 	# install the desktop menu related bits
    107 	$(INSTALL_PROTO) -m 0555 desktop-print-management $(ROOT)/usr/lib/cups/bin/desktop-print-management
    108 	$(INSTALL_PROTO) -m 0555 desktop-print-management-applet $(ROOT)/usr/lib/cups/bin/desktop-print-management-applet
    109 	$(INSTALL_PROTO) -m 0555 smb $(ROOT)/usr/lib/cups/backend/smb
    110 	# install the service to set up CUPS as the default print service
    111 	$(INSTALL_PROTO) -m 0555 Solaris/print-service-selector $(ROOT)/lib/svc/method/print-service-selector
    112 	$(MKDIR) -p $(ROOT)/var/svc/manifest/application/print
    113 	$(INSTALL_PROTO) -m 0444 Solaris/service-selector.xml $(ROOT)/var/svc/manifest/application/print/service-selector.xml
    114 	# clean up the turds
    115 	$(RM) $(ROOT)/etc/cups/snmp.conf.N $(ROOT)/etc/cups/cupsd.conf.N
    116 	$(RM) $(ROOT)/usr/share/cups/mime/mime.convs.O $(ROOT)/usr/share/cups/mime/mime.types.O
    117 	$(RM) $(ROOT)/usr/share/applications/cups.desktop
    118 	rmdir $(ROOT)/var/run/cups/certs $(ROOT)/var/run/cups
    119 
    120 install-protofix:	install-target
    121 	# apply the file attributes from the packaging
    122 	for pkg in $(COMPONENT_PACKAGES:sh) ; do \
    123 		$(SRC)/tools/protofix --pkg $$pkg --perm ; \
    124 	done
    125 
    126 $(VER)/config.status:	$(VER)/configure
    127 	(cd $(VER) ; env $(TARGET_ENV) ./configure $(CONFIGURE_OPTIONS))
    128 
    129 $(VER)/configure:	$(VER)/configure.in
    130 	(cd $(VER) ; autoconf )
    131 
    132 $(VER)/configure.in:	$(VER)/.patched
    133 	touch $@
    134 
    135 clean:
    136 	-rm -rf $(VER)
    137 
    138 include ../Makefile.targ
    139 
    140 FRC:
    141