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 INSTALL = /usr/sbin/install
  30 
  31 ROOT = ../../proto/root_${MACH}/usr
  32 ROOTUSRLIB = $(ROOT)/lib
  33 ROOTSHARE = $(ROOT)/share/package-manager
  34 ROOTHELPSHARE = $(ROOT)/share/gnome/help/package-manager/C
  35 ROOTDESKTOPSHARE = $(ROOT)/share/applications
  36 ROOTDATASHARE = $(ROOTSHARE)/data
  37 ROOTPYTHON = $(ROOTUSRLIB)/python2.4
  38 ROOTPYTHONVENDOR = $(ROOTPYTHON)/vendor-packages
  39 ROOTPYTHONPKG = $(ROOTPYTHONVENDOR)/pkg/gui
  40 ROOTICONSHARE = $(ROOT)/share/icons/package-manager
  41 
  42 ROOTDIRS = \
  43    $(ROOTPYTHONPKG) \
  44    $(ROOTSHARE) \
  45    $(ROOTICONSHARE) \
  46    $(ROOTDATASHARE) \
  47    $(ROOTDESKTOPSHARE) \
  48    $(ROOTHELPSHARE)
  49 
  50 PYMODS = \
  51    modules/__init__.py \
  52    modules/imageinfo.py \
  53    modules/installupdate.py \
  54    modules/repository.py \
  55    modules/enumerations.py \
  56    modules/beadmin.py
  57 PYCMODS = $(PYMODS:%.py=%.pyc)
  58 
  59 ICONS = \
  60    data/icons/status_checkmark.png \
  61    data/icons/status_installed.png \
  62    data/icons/status_newupdate.png 
  63 
  64 HELP = \
  65    data/package-manager.xml \
  66    data/legal.xml 
  67 
  68 GLADEICONS = \
  69    data/PM_app_48x.png \
  70    data/PM_package_36x.png \
  71    data/update_all24x.png \
  72    data/remove24x.png \
  73    data/reload24x.png \
  74    data/install_update24x.png
  75 
  76 CATALOG = \
  77    data/opensolaris.org \
  78    data/opensolaris.org.sections
  79 
  80 DESKTOP = \
  81    data/packagemanager.desktop
  82 
  83 ROOTPYMODS = $(PYMODS:modules/%=$(ROOTPYTHONPKG)/%)
  84 
  85 ROOTICONS = $(ICONS:data/icons/%=$(ROOTICONSHARE)/%)
  86 
  87 ROOTDESKTOP = $(DESKTOP:data/%=$(ROOTDESKTOPSHARE)/%)
  88 
  89 ROOTCATALOG = $(CATALOG:data/%=$(ROOTDATASHARE)/%)
  90 
  91 ROOTGLADEICONS = $(GLADEICONS:data/%=$(ROOTSHARE)/%)
  92 
  93 ROOTHELP = $(HELP:data/%=$(ROOTHELPSHARE)/%)
  94 
  95 ROOTPYGLADE = $(ROOTSHARE)/packagemanager.glade
  96 
  97 ROOTPYCALLMODS = \
  98         $(ROOTPYMODS:%.py=%.pyc)
  99 
 100 ROOTCOMPONENTS = \
 101    $(ROOTDIRS) \
 102    $(ROOTPROGS) \
 103    $(ROOTPYMODS) \
 104    $(ROOTPYCALLMODS) \
 105    $(ROOTCATALOG) \
 106    $(ROOTPYGLADE) \
 107    $(ROOTGLADEICONS) \
 108    $(ROOTHELP) \
 109    $(ROOTICONS) \
 110    $(ROOTDESKTOP) \
 111 
 112 all := TARGET = all
 113 install := TARGET = install
 114 clean := TARGET = clean
 115 clobber := TARGET = clobber
 116 link := TARGET = link
 117 link-clean := TARGET = link-clean
 118 
 119 all: data/packagemanager.desktop
 120         cd po; pwd; $(MAKE) $(TARGET)
 121 
 122 install: all $(ROOTCOMPONENTS)
 123         cd po; pwd; $(MAKE) $(TARGET)
 124 
 125 clean clobber:
 126         cd po; pwd; $(MAKE) $(TARGET)
 127         rm -f $(PYCMODS)
 128         rm -f $(DESKTOP)
 129         rm -f po/.intltool-merge-cache
 130    
 131 modules/%.pyc: modules/%.py
 132         python -m compileall -l $(@D)
 133 
 134 data/packagemanager.desktop: data/packagemanager.desktop.in
 135         cd data; pwd; \
 136           LC_ALL=C intltool-merge -d -u -c ../po/.intltool-merge-cache ../po packagemanager.desktop.in packagemanager.desktop
 137 
 138 PWD:sh = pwd
 139 
 140 #This will not link l10n files
 141 link:
 142         mkdir -p /usr/share/lib/package-manager/data
 143         ln -sf $(PWD)/../packagemanager.py /usr/bin/packagemanager
 144         ln -sf $(PWD)/data/packagemanager.glade /usr/share/package-manager/packagemanager.glade
 145         ln -sf $(PWD)/data/opensolaris.org /usr/share/package-manager/data/opensolaris.org
 146         ln -sf $(PWD)/data/opensolaris.org.sections /usr/share/package-manager/data/opensolaris.org.sections
 147         ln -sf $(PWD)/data/packagemanager.desktop /usr/share/applications/packagemanager.desktop
 148         ln -sf $(PWD)/data/icons /usr/share/icons/package-manager
 149         ln -sf $(PWD)/modules /usr/lib/python2.4/vendor-packages/pkg/gui
 150 
 151 link-clean:
 152         rm -rf /usr/share/lib/package-manager
 153         rm -rf /usr/lib/python2.4/vendor-packages/pkg/gui
 154         rm -f /usr/share/applications/packagemanager.desktop
 155         rm -f /usr/bin/packagemanager
 156 
 157 proto: $(ROOT)
 158 
 159 $(ROOTDIRS):
 160         mkdir -m 0755 -p $@
 161 
 162 $(ROOTHELPSHARE)/%: data/%
 163         rm -f $@; $(INSTALL) -f $(ROOTHELPSHARE) -m 0644 $<
 164 
 165 $(ROOTDATASHARE)/%: data/%
 166         rm -f $@; $(INSTALL) -f $(ROOTDATASHARE) -m 0644 $<
 167 
 168 $(ROOTPYTHONPKG)/%: modules/%
 169         rm -f $@; $(INSTALL) -f $(ROOTPYTHONPKG) -m 0644 $<
 170 
 171 $(ROOTICONSHARE)/%: data/icons/%
 172         rm -f $@; $(INSTALL) -f $(ROOTICONSHARE) -m 0644 $<
 173 
 174 $(ROOTDESKTOPSHARE)/%: data/%
 175         rm -f $@; $(INSTALL) -f $(ROOTDESKTOPSHARE) -m 0644 $<
 176 
 177 $(ROOTSHARE)/%: data/%
 178         rm -f $@; $(INSTALL) -f $(ROOTSHARE) -m 0644 $<
 179