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 # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 22 # Use is subject to license terms. 23 # 24 25 MACH:sh = uname -p 26 27 KSH=/usr/bin/ksh 28 PYTHON = /usr/bin/python 29 30 ROOT = ../proto/root_${MACH} 31 ROOT_DATA = ../proto/data_root_${MACH} 32 ROOT_DATASHARE = $(ROOT_DATA)/share/package-manager 33 ROOT_DATASHAREDATA = $(ROOT_DATASHARE)/data 34 ROOT_DATAPIXMAPS = $(ROOT_DATASHAREDATA)/pixmaps 35 ROOT_L10N = ../proto/l10n_root_${MACH} 36 37 ROOTUSRBIN = $(ROOT)/bin 38 ROOTUSRLIB = $(ROOT)/lib 39 ROOTSHARE = $(ROOT)/share/package-manager 40 ROOTDESKTOPSHARE = $(ROOT)/share/applications 41 ROOTDATASHARE = $(ROOTSHARE)/data 42 ROOTPYTHON = $(ROOTUSRLIB)/python2.4 43 ROOTPYTHONVENDOR = $(ROOTPYTHON)/vendor-packages 44 ROOTPYTHONPKG = $(ROOTPYTHONVENDOR)/pkg/gui 45 ROOTICONSHARE = $(ROOT)/share/icons/package-manager 46 47 LINKPYTHONPKG = /usr/lib/python2.4/vendor-packages/pkg/gui 48 49 ROOTDIRS = \ 50 $(ROOT) \ 51 $(ROOTUSRBIN) \ 52 $(ROOTUSRLIB) \ 53 $(ROOTPYTHONPKG) \ 54 $(ROOTSHARE) \ 55 $(ROOTICONSHARE) \ 56 $(ROOTDATASHARE) \ 57 $(ROOTDESKTOPSHARE) 58 59 DATA_ROOTDIRS = \ 60 $(ROOT_DATA) \ 61 $(ROOT_DATASHARE) \ 62 $(ROOT_DATASHAREDATA) \ 63 $(ROOT_DATAPIXMAPS) 64 65 PROGS = packagemanager 66 67 ROOTPROGS = \ 68 $(ROOT)/bin/packagemanager 69 70 PYMODS = \ 71 gui/__init__.py \ 72 gui/imageinfo.py \ 73 gui/installupdate.py \ 74 gui/remove.py \ 75 gui/enumerations.py \ 76 gui/filelist.py \ 77 gui/thread.py \ 78 gui/userrights.py 79 PYCMODS = $(PYMODS:%.py=%.pyc) 80 81 ICONS = \ 82 data/images/new_update.png 83 84 PIXMAPS = \ 85 86 87 CATALOG = \ 88 data/opensolaris.org \ 89 data/opensolaris.org.sections 90 91 DESKTOP = \ 92 data/packagemanager.desktop 93 94 ROOTPYMODS = $(PYMODS:gui/%=$(ROOTPYTHONPKG)/%) 95 96 ROOTICONS = $(ICONS:data/images/%=$(ROOTICONSHARE)/%) 97 98 ROOTDESKTOP = $(DESKTOP:data/%=$(ROOTDESKTOPSHARE)/%) 99 100 ROOTCATALOG = $(CATALOG:data/%=$(ROOT_DATASHAREDATA)/%) 101 102 ROOTPIXMAPS = $(PIXMAPS:data/pixmaps/%=$(ROOT_DATAPIXMAPS)/%) 103 104 ROOTPYGLADE = $(ROOTSHARE)/packagemanager.glade 105 106 ROOTPYCALLMODS = \ 107 $(ROOTPYMODS:%.py=%.pyc) 108 109 110 ROOTCOMPONENTS = \ 111 $(ROOTDIRS) \ 112 $(ROOTPROGS) \ 113 $(ROOTPYMODS) \ 114 $(ROOTPYCALLMODS) \ 115 $(ROOTPYGLADE) \ 116 $(ROOTICONS) \ 117 $(ROOTDESKTOP) 118 119 120 DATAROOTCOMPONENTS = \ 121 $(DATA_ROOTDIRS) \ 122 $(ROOTCATALOG) \ 123 $(ROOTPIXMAPS) 124 125 all := TARGET = all 126 install := TARGET = install 127 128 all: $(PROGS) 129 cd data; pwd;\ 130 LC_ALL=C intltool-merge -d -u -c ../po/.intltool-merge-cache ../po packagemanager.desktop.in packagemanager.desktop 131 132 install: all $(ROOTCOMPONENTS) $(DATAROOTCOMPONENTS) 133 @cd po; pwd;\ 134 mkdir -p ../$(ROOT_L10N); \ 135 for PO in *.po; do \ 136 LING=`basename $$PO .po`; \ 137 MO=$$LING.mo; \ 138 msgfmt -o $$MO $$PO; \ 139 mkdir -p ../$(ROOT_L10N)/share/locale/$$LING/LC_MESSAGES; \ 140 cp $$MO ../$(ROOT_L10N)/share/locale/$$LING/LC_MESSAGES/packagemanager.mo; \ 141 done; 142 @cd pkgdefs; pwd; $(MAKE) $(TARGET) 143 144 gui/%.pyc: gui/%.py 145 python -m compileall -l $(@D) 146 147 PWD:sh = pwd 148 149 proto: $(ROOT) $(ROOT_DATA) 150 151 $(ROOT): 152 mkdir -p $(ROOTDIRS) 153 154 $(ROOT_DATA): 155 mkdir -p $(DATA_ROOTDIRS) 156 157 $(ROOT_DATAPIXMAPS)/%: data/pixmaps/% 158 rm -f $@; install -f $(ROOT_DATAPIXMAPS) -m 0444 $< 159 160 $(ROOT_DATASHAREDATA)/%: data/% 161 rm -f $@; install -f $(ROOT_DATASHAREDATA) -m 0444 $< 162 163 $(ROOTUSRBIN)/%: % 164 rm -f $@; install -f $(ROOTUSRBIN) -m 0555 $< 165 166 $(ROOTUSRLIB)/%: % 167 rm -f $@; install -f $(ROOT)/lib -m 0555 $< 168 169 $(ROOTPYTHONPKG)/%: gui/% 170 rm -f $@; install -f $(ROOTPYTHONPKG) -m 0444 $< 171 172 $(ROOTICONSHARE)/%: data/images/% 173 rm -f $@; install -f $(ROOTICONSHARE) -m 0444 $< 174 175 $(ROOTDESKTOPSHARE)/%: data/% 176 rm -f $@; install -f $(ROOTDESKTOPSHARE) -m 0644 $< 177 178 $(ROOTSHARE)/%: % 179 rm -f $@; install -f $(ROOTSHARE) -m 0444 $< 180 181 packagemanager: packagemanager.py 182 cp packagemanager.py packagemanager 183 184 185