wok-4.x annotate slitaz-tools/receipt @ rev 1098
slitaz-tools: backup/restore config files (avoid reconfig for HD install)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Jul 17 23:28:01 2008 +0200 (2008-07-17) |
parents | 4ae1b641e09a |
children | 534023d6e005 |
rev | line source |
---|---|
pankso@11 | 1 # SliTaz package receipt. |
pankso@11 | 2 |
pankso@11 | 3 PACKAGE="slitaz-tools" |
pankso@1082 | 4 VERSION="2.6" |
pankso@194 | 5 CATEGORY="system-tools" |
pankso@79 | 6 SHORT_DESC="SliTaz tools provide installer and Tinyutils." |
pankso@11 | 7 MAINTAINER="pankso@slitaz.org" |
pankso@11 | 8 DEPENDS="slitaz-boot-scripts dialog" |
pankso@11 | 9 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pankso@11 | 10 WEB_SITE="http://www.slitaz.org/" |
pankso@11 | 11 WGET_URL="http://download.tuxfamily.org/slitaz/sources/tools/$TARBALL" |
pankso@11 | 12 |
pankso@11 | 13 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@11 | 14 # |
pankso@11 | 15 # This package is all build by genpkg, it provide /usr/share/examples tree, |
pankso@11 | 16 # tazlito, tinyutils, licenses, documentation and artwork. This package |
pankso@11 | 17 # provide also the Firewall deamon/config (/etc/firewall.conf). |
pankso@11 | 18 # |
pankso@11 | 19 genpkg_rules() |
pankso@11 | 20 { |
pankso@659 | 21 mkdir -p \ |
pankso@659 | 22 $fs/sbin \ |
pankso@659 | 23 $fs/usr/bin \ |
pankso@659 | 24 $fs/usr/sbin \ |
pankso@892 | 25 $fs/etc/X11 \ |
pankso@659 | 26 $fs/var/spool/cron/crontabs \ |
pankso@766 | 27 $fs/usr/lib/slitaz \ |
pankso@776 | 28 $fs/usr/share/doc/slitaz-tools \ |
pankso@776 | 29 $fs/usr/share/slitaz-tools/glade \ |
pankso@659 | 30 $fs/usr/share/slitaz-tools/installer |
pankso@775 | 31 |
pankso@892 | 32 # /rootfs/*. Firewall exemples, licenses, pixmaps and desktop files. |
pankso@11 | 33 cp -a $src/rootfs/* $fs |
pankso@11 | 34 |
pankso@11 | 35 # Tinyutils. |
pankso@11 | 36 cp -a $src/tinyutils/tazlocale $fs/sbin |
pascal@847 | 37 touch $fs/etc/locale.conf |
pascal@847 | 38 touch $fs/etc/motd |
pankso@716 | 39 cp -a $src/tinyutils/tazkeymap $fs/sbin |
pascal@847 | 40 touch $fs/etc/keymap.conf |
pascal@847 | 41 touch $fs/etc/TZ |
pankso@11 | 42 cp -a $src/tinyutils/gztazmod.sh $fs/sbin |
pankso@11 | 43 cp -a $src/tinyutils/tazx $fs/usr/bin |
pascal@847 | 44 touch $fs/etc/X11/screen.conf |
pankso@11 | 45 cp -a $src/tinyutils/startx $fs/usr/bin |
pankso@354 | 46 cp -a $src/tinyutils/history $fs/usr/bin |
pankso@805 | 47 cp -a $src/tinyutils/tazdialog $fs/usr/bin |
pankso@766 | 48 # Sound config |
pankso@766 | 49 cp -a $src/tinyutils/soundconf $fs/usr/sbin |
pankso@761 | 50 cp -a $src/tinyutils/setmixer $fs/usr/sbin |
pankso@775 | 51 |
pankso@138 | 52 # Gtkdialog boxes |
pankso@659 | 53 cp -a $src/tinyutils/bootfloppybox $fs/usr/bin |
pankso@138 | 54 cp -a $src/tinyutils/burnbox $fs/usr/bin |
pankso@11 | 55 cp -a $src/tinyutils/mountbox $fs/usr/bin |
pankso@138 | 56 cp -a $src/tinyutils/netbox $fs/usr/bin |
pankso@138 | 57 cp -a $src/tinyutils/scpbox $fs/usr/bin |
pankso@138 | 58 cp -a $src/tinyutils/subox $fs/usr/bin |
pankso@660 | 59 cp -a $src/tinyutils/torrentbox $fs/usr/bin |
pankso@761 | 60 cp -a $src/tinyutils/desktopbox $fs/usr/bin |
pankso@805 | 61 |
pankso@892 | 62 # Libs and Glade XML files. |
pankso@766 | 63 cp -a $src/lib/[a-z]* $fs/usr/lib/slitaz |
pankso@805 | 64 cp -a $src/glade/*.glade $fs/usr/share/slitaz-tools/glade |
pankso@775 | 65 |
pankso@266 | 66 # Installer's |
pankso@266 | 67 cp -a $src/installer/slitaz-installer $fs/usr/bin |
pankso@659 | 68 cp -a $src/installer/*.msg $fs/usr/share/slitaz-tools/installer |
pankso@775 | 69 |
pankso@11 | 70 # Tools doc in /usr/share/doc/slitaz-tools |
pankso@892 | 71 cp $src/doc/* $fs/usr/share/doc/slitaz-tools |
pankso@775 | 72 |
pankso@425 | 73 # Gksu fake for pcmanfm |
pankso@425 | 74 cd $fs/usr/bin |
pankso@425 | 75 ln -s subox gksu |
pankso@426 | 76 cd $WOK/$PACKAGE |
pankso@775 | 77 |
pankso@401 | 78 chown -R root.root $fs |
pankso@401 | 79 chmod -R 755 $fs/usr/bin |
pankso@401 | 80 chmod -R 755 $fs/sbin |
pankso@11 | 81 } |
pascal@1062 | 82 |
pankso@1098 | 83 # Pre install commands. |
pankso@1098 | 84 pre_install() |
pankso@1098 | 85 { |
pankso@1098 | 86 local root |
pankso@1098 | 87 root=$1 |
pankso@1098 | 88 # Backup file to restore with post install |
pankso@1098 | 89 echo "Creating backups of configs..." |
pankso@1098 | 90 cp $root/etc/TZ $root/etc/TZ.bak 2>/dev/null |
pankso@1098 | 91 cp $root/etc/keymap.conf $root/etc/keymap.conf.bak 2>/dev/null |
pankso@1098 | 92 cp $root/etc/X11/screen.conf $root/etc/X11/screen.conf.bak 2>/dev/null |
pankso@1098 | 93 cp $root/etc/locale.conf $root/etc/locale.conf.bak 2>/dev/null |
pankso@1098 | 94 cp $root/etc/firewall.conf $root/etc/firewall.conf.bak 2>/dev/null |
pankso@1098 | 95 } |
pankso@1098 | 96 |
pankso@1098 | 97 # Post install |
pascal@1062 | 98 post_install() |
pascal@1062 | 99 { |
pascal@1084 | 100 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \ |
pascal@1062 | 101 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT |
pascal@1062 | 102 etc/TZ |
pascal@1062 | 103 etc/motd |
pascal@1062 | 104 etc/keymap.conf |
pascal@1062 | 105 etc/X11/screen.conf |
pascal@1062 | 106 etc/locale.conf |
pascal@1062 | 107 etc/firewall.conf |
pascal@1062 | 108 EOT |
pankso@1098 | 109 echo "Restoring configs backups..." |
pankso@1098 | 110 mv -f $root/etc/TZ.bak $root/etc/TZ 2>/dev/null |
pankso@1098 | 111 mv -f $root/etc/keymap.conf.bak $root/etc/keymap.conf 2>/dev/null |
pankso@1098 | 112 mv -f $root/etc/X11/screen.conf.bak $root/etc/X11/screen.conf 2>/dev/null |
pankso@1098 | 113 mv -f $root/etc/locale.conf.bak $root/etc/locale.conf 2>/dev/null |
pankso@1098 | 114 mv -f $root/etc/firewall.conf.bak $root/etc/firewall.conf 2>/dev/null |
pascal@1062 | 115 } |
pascal@1062 | 116 |
pascal@1062 | 117 repack_cleanup() |
pascal@1062 | 118 { |
pascal@1062 | 119 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id ) |
pascal@1062 | 120 } |