| 1 | #!/usr/bin/make -f |
|---|
| 2 | |
|---|
| 3 | DEB_PYTHON_SYSTEM = pysupport |
|---|
| 4 | |
|---|
| 5 | include /usr/share/cdbs/1/rules/debhelper.mk |
|---|
| 6 | include /usr/share/cdbs/1/class/python-distutils.mk |
|---|
| 7 | include /usr/share/cdbs/1/rules/simple-patchsys.mk |
|---|
| 8 | include /usr/share/cdbs/1/rules/utils.mk |
|---|
| 9 | |
|---|
| 10 | DEB_DH_INSTALL_ARGS = --sourcedir=debian/tmp |
|---|
| 11 | DEB_UPDATE_RCD_PARAMS := multiuser |
|---|
| 12 | DEB_INSTALL_MANPAGES_kde-guidance := debian/displayconfig.1 debian/mountconfig.1 debian/serviceconfig.1 debian/userconfig.1 |
|---|
| 13 | PYSUPPORT_PATH = $(DEB_DESTDIR)/usr/share/python-support |
|---|
| 14 | |
|---|
| 15 | install/kde-guidance:: |
|---|
| 16 | # install icons to right place |
|---|
| 17 | install -D -p -m0644 $(DEB_DESTDIR)/usr/share/apps/guidance/pics/hi32-app-daemons.png \ |
|---|
| 18 | $(DEB_DESTDIR)/usr/share/icons/crystalsvg/32x32/apps/daemons.png |
|---|
| 19 | install -D -p -m0644 $(DEB_DESTDIR)/usr/share/apps/guidance/pics/kcmpartitions.png \ |
|---|
| 20 | $(DEB_DESTDIR)/usr/share/icons/crystalsvg/32x32/apps/disksfilesystems.png |
|---|
| 21 | install -D -p -m0644 $(DEB_DESTDIR)/usr/share/apps/guidance/pics/hi32-user.png \ |
|---|
| 22 | $(DEB_DESTDIR)/usr/share/icons/crystalsvg/32x32/apps/userconfig.png |
|---|
| 23 | install -D -p -m0644 $(DEB_DESTDIR)/usr/share/apps/guidance/pics/hi32-display.png \ |
|---|
| 24 | $(DEB_DESTDIR)/usr/share/icons/crystalsvg/32x32/apps/displayconfig.png |
|---|
| 25 | install -D -p -m0644 $(DEB_DESTDIR)/usr/share/apps/guidance/pics/32-wine.png \ |
|---|
| 26 | $(DEB_DESTDIR)/usr/share/icons/crystalsvg/32x32/apps/wineconfig.png |
|---|
| 27 | install -D -p -m0644 kde/wineconfig/pics/16x16/wineconfig.png \ |
|---|
| 28 | $(DEB_DESTDIR)/usr/share/icons/crystalsvg/16x16/apps/wineconfig.png |
|---|
| 29 | |
|---|
| 30 | # install lintian overrides |
|---|
| 31 | install -D -p -m0644 debian/kde-guidance.lintian-overrides \ |
|---|
| 32 | $(DEB_DESTDIR)/usr/share/lintian/overrides/kde-guidance |
|---|
| 33 | |
|---|
| 34 | # fix binary-or-shlib-defines-rpath |
|---|
| 35 | chrpath -d $(DEB_DESTDIR)/usr/lib/kde3/kcm_*.so.* |
|---|
| 36 | |
|---|
| 37 | # fix executable-not-elf-or-script |
|---|
| 38 | chmod 0644 $(DEB_DESTDIR)/usr/share/apps/guidance/pics/kdewinewizard.png |
|---|
| 39 | |
|---|
| 40 | # fix the link properly |
|---|
| 41 | mkdir -p debian/kde-guidance/usr/bin |
|---|
| 42 | (cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/displayconfig.py displayconfig) |
|---|
| 43 | (cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/mountconfig.py mountconfig) |
|---|
| 44 | (cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/serviceconfig.py serviceconfig) |
|---|
| 45 | (cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/userconfig.py userconfig) |
|---|
| 46 | (cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/wineconfig.py wineconfig) |
|---|
| 47 | # (cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/grubconfig.py grubconfig) |
|---|
| 48 | |
|---|
| 49 | # put this here since gnome people probably don't want it by default |
|---|
| 50 | (cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/guidance-backends/displayconfig-restore.py displayconfig-restore) |
|---|
| 51 | |
|---|
| 52 | # move python modules in PYSUPPORT_PATH |
|---|
| 53 | mkdir -p $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 54 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/SMBShareSelectDialog.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 55 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/SimpleCommandRunner.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 56 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/displayconfig.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 57 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/displayconfigwidgets.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 58 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/fuser.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 59 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/fuser_ui.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 60 | # cp $(DEB_DESTDIR)/usr/share/apps/guidance/grubconfig.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 61 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/ktimerdialog.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 62 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/mountconfig.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 63 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/servertestdialog.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 64 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/serviceconfig.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 65 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/sizeview.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 66 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/unixauthdb.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 67 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/userconfig.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 68 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/wineconfig.py $(PYSUPPORT_PATH)/kde-guidance |
|---|
| 69 | |
|---|
| 70 | # fix script-not-executable |
|---|
| 71 | chmod 0755 $(PYSUPPORT_PATH)/kde-guidance/fuser.py |
|---|
| 72 | # chmod 0755 $(PYSUPPORT_PATH)/kde-guidance/grubconfig.py |
|---|
| 73 | |
|---|
| 74 | : # Replace all '#!' calls to python with /usr/bin/python |
|---|
| 75 | : # and make them executable |
|---|
| 76 | for i in `find debian/kde-guidance -type f`; do \ |
|---|
| 77 | sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1,' \ |
|---|
| 78 | $$i > $$i.temp; \ |
|---|
| 79 | if cmp --quiet $$i $$i.temp; then \ |
|---|
| 80 | rm -f $$i.temp; \ |
|---|
| 81 | else \ |
|---|
| 82 | mv -f $$i.temp $$i; \ |
|---|
| 83 | chmod 755 $$i; \ |
|---|
| 84 | echo "fixed interpreter: $$i"; \ |
|---|
| 85 | fi; \ |
|---|
| 86 | done |
|---|
| 87 | |
|---|
| 88 | install/guidance-backends:: |
|---|
| 89 | # install displayconfig-hwprobe.py script |
|---|
| 90 | install -D -p -m0755 displayconfig/displayconfig-hwprobe.py \ |
|---|
| 91 | $(PYSUPPORT_PATH)/guidance-backends/displayconfig-hwprobe.py |
|---|
| 92 | |
|---|
| 93 | cp $(DEB_DESTDIR)/usr/lib/python2.5/site-packages/xf86misc.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 94 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/MicroHAL.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 95 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/ScanPCI.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 96 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/infimport.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 97 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/displayconfigabstraction.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 98 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/displayconfig-restore.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 99 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/drivedetect.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 100 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/execwithcapture.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 101 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/wineread.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 102 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/winewrite.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 103 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/xorgconfig.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 104 | |
|---|
| 105 | install/kde-guidance-powermanager:: |
|---|
| 106 | # install icon to right place |
|---|
| 107 | install -D -p -m0644 kde/powermanager/pics/battery-charging-100.png \ |
|---|
| 108 | $(DEB_DESTDIR)/usr/share/icons/hicolor/22x22/apps/power-manager.png |
|---|
| 109 | install -D -p -m0644 kde/powermanager/pics/*.png \ |
|---|
| 110 | $(DEB_DESTDIR)/usr/share/apps/guidance/pics/ |
|---|
| 111 | |
|---|
| 112 | # install desktop file |
|---|
| 113 | install -D -p -m0644 powermanager/guidance-power-manager.desktop \ |
|---|
| 114 | $(DEB_DESTDIR)/usr/share/autostart/guidance-power-manager.desktop |
|---|
| 115 | |
|---|
| 116 | # copy python modules in PYSUPPORT_PATH |
|---|
| 117 | mkdir -p $(PYSUPPORT_PATH)/kde-guidance-powermanager |
|---|
| 118 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/MicroHAL.py $(PYSUPPORT_PATH)/guidance-backends |
|---|
| 119 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/guidance-power-manager.py $(PYSUPPORT_PATH)/kde-guidance-powermanager |
|---|
| 120 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/powermanage.py $(PYSUPPORT_PATH)/kde-guidance-powermanager |
|---|
| 121 | cp $(DEB_DESTDIR)/usr/share/apps/guidance/powermanager_ui.py $(PYSUPPORT_PATH)/kde-guidance-powermanager |
|---|
| 122 | cp powermanager/guidance_power_manager_ui.py $(PYSUPPORT_PATH)/kde-guidance-powermanager |
|---|
| 123 | cp powermanager/notify.py $(PYSUPPORT_PATH)/kde-guidance-powermanager |
|---|
| 124 | cp powermanager/tooltip.py $(PYSUPPORT_PATH)/kde-guidance-powermanager |
|---|
| 125 | |
|---|
| 126 | # generate guidance-power-manager script |
|---|
| 127 | echo "#!/bin/sh" > $(DEB_DESTDIR)/usr/bin/guidance-power-manager |
|---|
| 128 | echo "/usr/share/python-support/kde-guidance-powermanager/guidance-power-manager.py &" >> $(DEB_DESTDIR)/usr/bin/guidance-power-manager |
|---|
| 129 | chmod +x $(DEB_DESTDIR)/usr/bin/guidance-power-manager |
|---|
| 130 | |
|---|
| 131 | # fix script-not-executable |
|---|
| 132 | chmod 0755 $(PYSUPPORT_PATH)/kde-guidance-powermanager/powermanage.py |
|---|
| 133 | |
|---|
| 134 | : # Replace all '#!' calls to python with /usr/bin/python |
|---|
| 135 | : # and make them executable |
|---|
| 136 | for i in `find debian/kde-guidance-powermanager -type f`; do \ |
|---|
| 137 | sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1,' \ |
|---|
| 138 | $$i > $$i.temp; \ |
|---|
| 139 | if cmp --quiet $$i $$i.temp; then \ |
|---|
| 140 | rm -f $$i.temp; \ |
|---|
| 141 | else \ |
|---|
| 142 | mv -f $$i.temp $$i; \ |
|---|
| 143 | chmod 755 $$i; \ |
|---|
| 144 | echo "fixed interpreter: $$i"; \ |
|---|
| 145 | fi; \ |
|---|
| 146 | done |
|---|
| 147 | |
|---|
| 148 | clean:: |
|---|
| 149 | rm -rf build |
|---|
| 150 | |
|---|
| 151 | rm -rf doc/en/*html doc/en/*bz2 |
|---|
| 152 | rm -f serviceconfig/kcm_serviceconfig.cpp |
|---|
| 153 | rm -f mountconfig/kcm_mountconfig.cpp |
|---|
| 154 | rm -f displayconfig/kcm_displayconfig.cpp |
|---|
| 155 | rm -f userconfig/kcm_userconfig.cpp |
|---|
| 156 | rm -f install_log.txt |
|---|
| 157 | rm -f po/*.gmo |
|---|
| 158 | rm -f po/*.pot |
|---|
| 159 | |
|---|
| 160 | # clean up edited .desktop etc files |
|---|
| 161 | if [ -f /usr/lib/kubuntu-desktop-i18n/createdesktop.pl ]; then \ |
|---|
| 162 | sh /usr/lib/kubuntu-desktop-i18n/findfiles LIST; \ |
|---|
| 163 | for file in `cat LIST`; do \ |
|---|
| 164 | sed -i '/X-Ubuntu-Gettext-Domain=/d' $${file}; \ |
|---|
| 165 | done; \ |
|---|
| 166 | rm -f LIST; \ |
|---|
| 167 | fi |
|---|
| 168 | |
|---|
| 169 | common-install-prehook-impl:: |
|---|
| 170 | # generate form implementation using pykde user interface compiler |
|---|
| 171 | (cd powermanager; kdepyuic --usekdei18n guidance_power_manager_ui.ui) |
|---|
| 172 | (cd powermanager; kdepyuic --usekdei18n tooltip.ui) |
|---|
| 173 | (cd powermanager; kdepyuic --usekdei18n notify.ui) |
|---|
| 174 | |
|---|
| 175 | mkdir -p po |
|---|
| 176 | touch list |
|---|
| 177 | find -name "*.py" >> list |
|---|
| 178 | xgettext -ki18n -LPython -flist -o po/guidance.pot |
|---|
| 179 | rm list |
|---|
| 180 | |
|---|
| 181 | for file in po/*pot; do \ |
|---|
| 182 | sed "s/charset=CHARSET/charset=UTF-8/" -i $$file; \ |
|---|
| 183 | done |
|---|
| 184 | |
|---|
| 185 | # generate .po files for .desktop etc files |
|---|
| 186 | if [ -z $${KUBUNTU_DESKTOP_POT} ]; then \ |
|---|
| 187 | KUBUNTU_DESKTOP_POT=$(DEB_SOURCE_PACKAGE); \ |
|---|
| 188 | fi; \ |
|---|
| 189 | echo KUBUNTU_DESKTOP_POT: $${KUBUNTU_DESKTOP_POT}; \ |
|---|
| 190 | if [ -f /usr/lib/kubuntu-desktop-i18n/createdesktop.pl ]; then \ |
|---|
| 191 | sh /usr/lib/kubuntu-desktop-i18n/findfiles LIST; \ |
|---|
| 192 | cat LIST; \ |
|---|
| 193 | perl /usr/lib/kubuntu-desktop-i18n/createdesktop.pl --file-list=LIST --base-dir=. > desktop.$${KUBUNTU_DESKTOP_POT}.tmp; \ |
|---|
| 194 | msguniq --to-code=UTF-8 --no-wrap -o desktop.$${KUBUNTU_DESKTOP_POT} desktop.$${KUBUNTU_DESKTOP_POT}.tmp 2>/dev/null; \ |
|---|
| 195 | python /usr/lib/kubuntu-desktop-i18n/msgsplit desktop.$${KUBUNTU_DESKTOP_POT}; \ |
|---|
| 196 | mv desktop.$${KUBUNTU_DESKTOP_POT} po/desktop_$${KUBUNTU_DESKTOP_POT}.pot; \ |
|---|
| 197 | rm -f desktop.$${KUBUNTU_DESKTOP_POT} desktop.$${KUBUNTU_DESKTOP_POT}.tmp; \ |
|---|
| 198 | # add translation domain to files \ |
|---|
| 199 | for file in `cat LIST`; do \ |
|---|
| 200 | echo X-Ubuntu-Gettext-Domain=desktop_$${KUBUNTU_DESKTOP_POT} >> $${file}; \ |
|---|
| 201 | done; \ |
|---|
| 202 | rm -f LIST; \ |
|---|
| 203 | fi |
|---|
| 204 | |
|---|
| 205 | rm -f kde-guidance/usr/share/python-support/kde-guidance/.version |
|---|
| 206 | rm -f kde-guidance/usr/share/python-support/kde-guidance-powermanager/.version |
|---|
| 207 | |
|---|
| 208 | get-orig-source: |
|---|
| 209 | @@dh_testdir |
|---|
| 210 | @@[ -d ../tarballs/. ] |
|---|
| 211 | @@dpatch-get-origtargz ../tarballs |
|---|
| 212 | |
|---|