xref: /illumos-gate/usr/src/cmd/print/scripts/Makefile (revision 8226594fdd4479be135127f43632f1f995074654)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26include			../Makefile.sp
27
28ROOTPRINTLIB =		$(ROOTLIB)/print
29ROOTLIBLPBIN =		$(ROOTLIBLP)/bin
30ROOTVARLP =		$(ROOTVAR)/lp
31ROOTVARLPPPD =		$(ROOTVARLP)/ppd
32
33$(ROOTVARLP)		:= DIRMODE=0775
34
35FILEMODE =		0755
36
37MSGFILES =              lpadmin ppdmgr
38POFILE =                scripts.po
39
40PROG =			conv_lp conv_lpd Makefile.yp
41ROOTLIBPRINTPROG=	$(PROG:%=$(ROOTPRINTLIB)/%)
42$(ROOTLIBPRINTPROG)	:= FILEMODE=0555
43$(ROOTPRINTLIB)/Makefile.yp		:= FILEMODE=0444
44
45USRSBINPROG=		lpsystem ppdmgr
46ROOTUSRSBINPROG=	$(USRSBINPROG:%=$(ROOTUSRSBIN)/%)
47$(ROOTUSRSBINPROG)		:= FILEMODE=555
48
49PCONF=			printers.conf
50ROOTPCONF=		$(PCONF:%=$(ROOTETC)/%)
51$(ROOTPCONF)		:= FILEMODE=644
52
53MANUFALIASES=		manufaliases
54ROOTMANUFALIASES=	$(MANUFALIASES:%=$(ROOTVARLPPPD)/%)
55$(ROOTMANUFALIASES)	:= FILEMODE=444
56
57LIBLPPROGS=		lpadmin \
58			desktop-print-management \
59			desktop-print-management-applet \
60			desktop-print-management-prefs
61
62ROOTLIBLPPROGS=		$(LIBLPPROGS:%=$(ROOTLIBLPBIN)/%)
63$(ROOTLIBLPPROGS)		:= FILEMODE=555
64
65LIBLINKS=		$(ROOTLIB)/lpadmin $(ROOTLIB)/lpsystem
66
67APPFILES =	desktop-print-management.desktop
68APPFILES +=	desktop-print-management-prefs.desktop
69AUTOFILES =	desktop-print-management-applet.desktop
70
71ROOTAPPDIR =		$(ROOT)/usr/share/applications
72ROOTAUTODIR =		$(ROOT)/usr/share/gnome/autostart
73ROOTAPPFILES =		$(APPFILES:%=$(ROOTAPPDIR)/%)
74ROOTAUTOFILES =		$(AUTOFILES:%=$(ROOTAUTODIR)/%)
75
76$(ROOTAPPFILES)		:= FILEMODE = 444
77$(ROOTAUTOFILES)	:= FILEMODE = 444
78
79
80.KEEP_STATE:
81
82all :			$(PROG)
83
84$(ROOTLIB)/print/%:	%
85	$(INS.file)
86
87$(ROOTLIBLPBIN)/%: %
88	$(INS.file)
89
90$(ROOTVARLPPPD)/%: %
91	$(INS.file)
92
93$(ROOTAPPDIR)/%:	%
94	$(INS.file)
95
96$(ROOTAUTODIR)/%:	%
97	$(INS.file)
98
99$(ROOTUSRSBIN) $(ROOTVARSPOOLPRINT) $(ROOTVARLP) $(ROOTVARLPPPD):
100	$(INS.dir)
101
102$(ROOTLIB)/lpadmin:
103	$(RM) $@; $(SYMLINK) ../sbin/lpadmin $@
104
105$(ROOTLIB)/lpsystem:
106	$(RM) $@; $(SYMLINK) ../sbin/lpsystem $@
107
108$(ROOTLNKPROGS) :	$(ROOTSTARTPROG)
109			$(RM) $@; $(LN) $(ROOTSTARTPROG) $@
110
111_msg:   $(POFILE)
112
113$(POFILE): $(MSGFILES)
114	grep gettext $(MSGFILES) | tr '`' ' ' | sed -e "s/gettext \"/gettext \(\"/" | sed -e "s/$$/);/"  > $(POFILE).i
115	$(XGETTEXT) -s $(POFILE).i
116	$(RM) $@ $(POFILE).i
117	mv messages.po $(POFILE)
118
119#
120# Create a message file to test with
121#
122_msg_test:
123	grep gettext $(MSGFILES) | tr '`' ' ' | sed -e "s/gettext \"/gettext \(\"/" | sed -e "s/$$/);/"  > $(POFILE).i
124	$(XGETTEXT) -s -m "xxx" $(POFILE).i
125	$(RM) $@ $(POFILE).i
126	mv messages.po $(POFILE)
127
128install:		$(ROOTLNKPROGS) \
129			$(ROOTLIBPRINTPROG) $(ROOTSTARTPROG) \
130			$(ROOTUSRSBIN) $(ROOTUSRSBINPROG) \
131			$(ROOTVARSPOOLPRINT) $(ROOTPCONF) \
132			$(ROOTLIBLPPROGS) $(LIBLINKS) \
133			$(ROOTVARLP) $(ROOTVARLPPPD) \
134			$(ROOTMANUFALIASES) \
135			$(ROOTAPPFILES) $(ROOTAUTOFILES)
136
137$(SYMLINKS1):
138	$(RM) $@; $(SYMLINK) ../sbin/$(SBINPROG1) $@
139
140$(SYMLINKS2):
141	$(RM) $@; $(SYMLINK) ../sbin/$(SBINPROG2) $@
142
143clean:
144	$(RM) $(POFILE)
145
146clobber: clean
147
148strip lint:
149