17c478bdstevel@tonic-gate#
27c478bdstevel@tonic-gate# CDDL HEADER START
37c478bdstevel@tonic-gate#
47c478bdstevel@tonic-gate# The contents of this file are subject to the terms of the
5355b466jacobs# Common Development and Distribution License (the "License").
6355b466jacobs# You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate#
87c478bdstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate# See the License for the specific language governing permissions
117c478bdstevel@tonic-gate# and limitations under the License.
127c478bdstevel@tonic-gate#
137c478bdstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate#
197c478bdstevel@tonic-gate# CDDL HEADER END
207c478bdstevel@tonic-gate#
217c478bdstevel@tonic-gate#
2224fe0b3jmcp# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bdstevel@tonic-gate# Use is subject to license terms.
247c478bdstevel@tonic-gate#
257c478bdstevel@tonic-gate
267c478bdstevel@tonic-gateinclude			../Makefile.sp
277c478bdstevel@tonic-gate
287c478bdstevel@tonic-gateROOTPRINTLIB = 		$(ROOTLIB)/print
297c478bdstevel@tonic-gateROOTLIBLPBIN =		$(ROOTLIBLP)/bin
30c81d47aceasthaROOTVARLP =		$(ROOTVAR)/lp
31c81d47aceasthaROOTVARLPPPD =		$(ROOTVARLP)/ppd
327c478bdstevel@tonic-gate
33c81d47aceastha$(ROOTVARLP)		:= DIRMODE=0775
347c478bdstevel@tonic-gate
357c478bdstevel@tonic-gateFILEMODE =		0755
367c478bdstevel@tonic-gate
37c81d47aceasthaMSGFILES =              lpadmin ppdmgr
387c478bdstevel@tonic-gatePOFILE =                scripts.po
397c478bdstevel@tonic-gate
407c478bdstevel@tonic-gatePROG =			conv_lp conv_lpd Makefile.yp
417c478bdstevel@tonic-gateROOTLIBPRINTPROG=	$(PROG:%=$(ROOTPRINTLIB)/%)
427c478bdstevel@tonic-gate$(ROOTLIBPRINTPROG)	:= FILEMODE=0555
437c478bdstevel@tonic-gate$(ROOTPRINTLIB)/Makefile.yp		:= FILEMODE=0444
447c478bdstevel@tonic-gate
459622934jacobsUSRSBINPROG=		lpsystem ppdmgr
467c478bdstevel@tonic-gateROOTUSRSBINPROG=	$(USRSBINPROG:%=$(ROOTUSRSBIN)/%)
477c478bdstevel@tonic-gate$(ROOTUSRSBINPROG)		:= FILEMODE=555
487c478bdstevel@tonic-gate
497c478bdstevel@tonic-gatePCONF=	 		printers.conf
507c478bdstevel@tonic-gateROOTPCONF=		$(PCONF:%=$(ROOTETC)/%)
517c478bdstevel@tonic-gate$(ROOTPCONF)		:= FILEMODE=644
527c478bdstevel@tonic-gate
53c81d47aceasthaMANUFALIASES= 		manufaliases
54c81d47aceasthaROOTMANUFALIASES=	$(MANUFALIASES:%=$(ROOTVARLPPPD)/%)
55c81d47aceastha$(ROOTMANUFALIASES)	:= FILEMODE=444
56c81d47aceastha
579622934jacobsLIBLPPROGS=	 	getmakes getmodels getppdfile getppds ppdfilename2mmp \
585f58abfNorm Jacobs			lpadmin \
595f58abfNorm Jacobs			desktop-print-management \
605f58abfNorm Jacobs			desktop-print-management-applet \
615f58abfNorm Jacobs			desktop-print-management-prefs
625f58abfNorm Jacobs
639622934jacobsROOTLIBLPPROGS=		$(LIBLPPROGS:%=$(ROOTLIBLPBIN)/%)
649622934jacobs$(ROOTLIBLPPROGS)		:= FILEMODE=555
657c478bdstevel@tonic-gate
667c478bdstevel@tonic-gateLIBLINKS=		$(ROOTLIB)/lpadmin $(ROOTLIB)/lpsystem
677c478bdstevel@tonic-gate
685f58abfNorm JacobsAPPFILES =	desktop-print-management.desktop
695f58abfNorm JacobsAPPFILES +=	desktop-print-management-prefs.desktop
705f58abfNorm JacobsAUTOFILES =	desktop-print-management-applet.desktop
715f58abfNorm Jacobs
725f58abfNorm JacobsROOTAPPDIR =		$(ROOT)/usr/share/applications
735f58abfNorm JacobsROOTAUTODIR =		$(ROOT)/usr/share/gnome/autostart
745f58abfNorm JacobsROOTAPPFILES =		$(APPFILES:%=$(ROOTAPPDIR)/%)
755f58abfNorm JacobsROOTAUTOFILES =		$(AUTOFILES:%=$(ROOTAUTODIR)/%)
765f58abfNorm Jacobs
775f58abfNorm Jacobs$(ROOTAPPFILES)		:= FILEMODE = 444
785f58abfNorm Jacobs$(ROOTAUTOFILES)	:= FILEMODE = 444
795f58abfNorm Jacobs
807c478bdstevel@tonic-gate
817c478bdstevel@tonic-gate.KEEP_STATE:
827c478bdstevel@tonic-gate
837c478bdstevel@tonic-gateall :			$(PROG) 
847c478bdstevel@tonic-gate
85c81d47aceastha$(ROOTLIB)/print/%:	%
867c478bdstevel@tonic-gate	$(INS.file)
877c478bdstevel@tonic-gate
887c478bdstevel@tonic-gate$(ROOTLIBLPBIN)/%: %
897c478bdstevel@tonic-gate	$(INS.file)
907c478bdstevel@tonic-gate
91c81d47aceastha$(ROOTVARLPPPD)/%: %
92c81d47aceastha	$(INS.file)
93c81d47aceastha
945f58abfNorm Jacobs$(ROOTAPPDIR)/%:	%
955f58abfNorm Jacobs	$(INS.file)
965f58abfNorm Jacobs
975f58abfNorm Jacobs$(ROOTAUTODIR)/%:	%
985f58abfNorm Jacobs	$(INS.file)
995f58abfNorm Jacobs
100c81d47aceastha$(ROOTUSRSBIN) $(ROOTVARSPOOLPRINT) $(ROOTVARLP) $(ROOTVARLPPPD):
1017c478bdstevel@tonic-gate	$(INS.dir)
1027c478bdstevel@tonic-gate
1037c478bdstevel@tonic-gate$(ROOTLIB)/lpadmin:
1047c478bdstevel@tonic-gate	$(RM) $@; $(SYMLINK) ../sbin/lpadmin $@
1057c478bdstevel@tonic-gate
1067c478bdstevel@tonic-gate$(ROOTLIB)/lpsystem:
1077c478bdstevel@tonic-gate	$(RM) $@; $(SYMLINK) ../sbin/lpsystem $@
1087c478bdstevel@tonic-gate
1097c478bdstevel@tonic-gate$(ROOTLNKPROGS) :	$(ROOTSTARTPROG)
1107c478bdstevel@tonic-gate			$(RM) $@; $(LN) $(ROOTSTARTPROG) $@
1117c478bdstevel@tonic-gate
1127c478bdstevel@tonic-gate_msg:   $(POFILE)
1137c478bdstevel@tonic-gate
1147c478bdstevel@tonic-gate$(POFILE): $(MSGFILES)
1157c478bdstevel@tonic-gate	grep gettext $(MSGFILES) | tr '`' ' ' | sed -e "s/gettext \"/gettext \(\"/" | sed -e "s/$$/);/"  > $(POFILE).i
1167c478bdstevel@tonic-gate	$(XGETTEXT) -s $(POFILE).i
1177c478bdstevel@tonic-gate	$(RM) $@ $(POFILE).i
1187c478bdstevel@tonic-gate	mv messages.po $(POFILE)
1197c478bdstevel@tonic-gate
1207c478bdstevel@tonic-gate#
1217c478bdstevel@tonic-gate# Create a message file to test with
1227c478bdstevel@tonic-gate#
1237c478bdstevel@tonic-gate_msg_test:
1247c478bdstevel@tonic-gate	grep gettext $(MSGFILES) | tr '`' ' ' | sed -e "s/gettext \"/gettext \(\"/" | sed -e "s/$$/);/"  > $(POFILE).i
1257c478bdstevel@tonic-gate	$(XGETTEXT) -s -m "xxx" $(POFILE).i
1267c478bdstevel@tonic-gate	$(RM) $@ $(POFILE).i
1277c478bdstevel@tonic-gate	mv messages.po $(POFILE)
1287c478bdstevel@tonic-gate
129c81d47aceasthainstall:		$(ROOTLNKPROGS) \
1307c478bdstevel@tonic-gate			$(ROOTLIBPRINTPROG) $(ROOTSTARTPROG) \
1317c478bdstevel@tonic-gate			$(ROOTUSRSBIN) $(ROOTUSRSBINPROG) \
1327c478bdstevel@tonic-gate			$(ROOTVARSPOOLPRINT) $(ROOTPCONF) \
1339622934jacobs			$(ROOTLIBLPPROGS) $(LIBLINKS) \
134c81d47aceastha			$(ROOTVARLP) $(ROOTVARLPPPD) \
1355f58abfNorm Jacobs			$(ROOTMANUFALIASES) \
1365f58abfNorm Jacobs			$(ROOTAPPFILES) $(ROOTAUTOFILES)
1377c478bdstevel@tonic-gate
1387c478bdstevel@tonic-gate$(SYMLINKS1):
1397c478bdstevel@tonic-gate	$(RM) $@; $(SYMLINK) ../sbin/$(SBINPROG1) $@
1407c478bdstevel@tonic-gate
1417c478bdstevel@tonic-gate$(SYMLINKS2):
1427c478bdstevel@tonic-gate	$(RM) $@; $(SYMLINK) ../sbin/$(SBINPROG2) $@
1437c478bdstevel@tonic-gate
1447c478bdstevel@tonic-gateclean:
1457c478bdstevel@tonic-gate	$(RM) $(POFILE)
1467c478bdstevel@tonic-gate
1477c478bdstevel@tonic-gateclobber: clean
1487c478bdstevel@tonic-gate
1497c478bdstevel@tonic-gatestrip lint:
150