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