3 # Purpose: generate tarball for using grml2usb on non-Debian systems
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ################################################################################
11 VERSION="$(awk '/^PROG_VERSION/ { print $3}' grml2usb | tr -d \")"
13 DIR="grml2usb-${VERSION}"
14 [ -d "$DIR" ] || mkdir "$DIR"
16 cat > "${DIR}"/README << EOF
20 grml2usb installs grml ISO(s) on usb device for booting.
22 This tarball provides all the necessary files for running grml2usb.
23 Execute the script install.sh with root permissions to install the
24 files provided by the tarball in the filesystem.
26 Updating is possible via downloading the most recent tarball and
27 executing install.sh again.
29 If you want to remove grml2usb from your system just execute
30 the provided uninstall.sh script with root permissions.
34 If you are using Debian (or a Debian based system like grml, Ubuntu,...)
35 consider using the provided grml2usb Debian package:
36 http://deb.grml.org/ => http://deb.grml.org/pool/main/g/grml2usb/
38 Please report bugs and feedback to Michael Prokop <mika@grml.org>.
41 cat > "${DIR}"/install.sh << EOF
46 if [ \$(id -u) != 0 ] ; then
47 echo "Error: become root before starting \$0" >& 2
51 BASE="\$(dirname \$0)"
53 printf "Installing files:\n"
55 printf " - /usr/sbin/grml2usb\n"
56 install -m 755 \${BASE}/grml2usb /usr/sbin/grml2usb
58 printf " - /usr/sbin/grml2usb-compat\n"
59 install -m 755 \${BASE}/grml2usb-compat /usr/sbin/grml2usb-compat
61 printf " - /usr/sbin/grml2iso\n"
62 install -m 755 \${BASE}/grml2iso /usr/sbin/grml2iso
64 [ -d /usr/share/grml2usb/grub ] || mkdir -p /usr/share/grml2usb/grub
65 printf " - /usr/share/grml2usb/grub/splash.xpm.gz\n"
66 install -m 644 \${BASE}/splash.xpm.gz /usr/share/grml2usb/grub/splash.xpm.gz
67 printf " - /usr/share/grml2usb/grub/grml.png\n"
68 install -m 644 \${BASE}/grml.png /usr/share/grml2usb/grub/grml.png
70 [ -d /usr/share/grml2usb/mbr ] || mkdir -p /usr/share/grml2usb/mbr
71 printf " - /usr/share/grml2usb/mbr/mbrmgr\n"
72 install -m 644 \${BASE}/mbrmgr /usr/share/grml2usb/mbr/mbrmgr
73 printf " - /usr/share/grml2usb/mbr/mbrldr\n"
74 install -m 644 \${BASE}/mbrldr /usr/share/grml2usb/mbr/mbrldr
76 [ -d /usr/share/man/man8/ ] || mkdir -p /usr/share/man/man8
77 printf " - /usr/share/man/man8/grml2usb.8.gz\n"
78 install -m 644 \${BASE}/grml2usb.8.gz /usr/share/man/man8/grml2usb.8.gz
80 printf "Finished installation.\n"
83 chmod 755 "${DIR}"/install.sh
85 cat > "${DIR}"/uninstall.sh << EOF
90 if [ \$(id -u) != 0 ] ; then
91 echo "Error: become root before starting \$0" >& 2
97 /usr/sbin/grml2usb-compat \\
99 /usr/share/grml2usb/grub/splash.xpm.gz \\
100 /usr/share/grml2usb/grub/grml.png \\
101 /usr/share/grml2usb/mbr/mbrmgr \\
102 /usr/share/grml2usb/mbr/mbrldr \\
103 /usr/share/man/man8/grml2usb.8.gz \\
105 printf "Removing \$file: "
106 rm -f \$file && printf "done\n" || printf "failed\n"
110 chmod 755 "${DIR}"/uninstall.sh
112 fakeroot debian/rules build
115 cp grml2usb.8.txt grml2usb-$VERSION/
116 cp grml2iso.8.txt grml2usb-$VERSION/
117 gzip -9 --to-stdout grml2usb-$VERSION/grml2usb.8.txt > grml2usb-$VERSION/grml2usb.8.gz
118 gzip -9 --to-stdout grml2usb-$VERSION/grml2iso.8.txt > grml2usb-$VERSION/grml2iso.8.gz
119 rm grml2usb-$VERSION/grml2usb.8.txt
120 rm grml2usb-$VERSION/grml2iso.8.txt
123 cp grml2usb grml2usb-compat grml2iso mbr/mbrldr mbr/mbrmgr grub/* grml2usb-$VERSION/
125 tar zcf grml2usb.tgz "${DIR}"
128 md5sum grml2usb.tgz > grml2usb.tgz.md5
129 gpg --clearsign grml2usb.tgz.md5
131 echo "Generated grml2usb.tgz and grml2usb.tgz.md5.asc of grml2usb $VERSION"
133 ## END OF FILE #################################################################