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=$(dpkg-parsechangelog | awk '/Version: / { print $2 }')
12 DIR="grml2usb-${VERSION}"
13 [ -d "$DIR" ] || mkdir "$DIR"
15 cat > "${DIR}"/README << EOF
19 grml2usb installs grml ISO(s) on usb device for booting.
21 This tarball provides all the necessary files for running grml2usb.
22 Execute the script install.sh with root permissions to install the
23 files provided by the tarball in the filesystem.
25 Updating is possible via downloading the most recent tarball and
26 executing install.sh again.
28 If you want to remove grml2usb from your system just execute
29 the provided uninstall.sh script with root permissions.
33 If you are using Debian (or a Debian based system like grml, Ubuntu,...)
34 consider using the provided grml2usb Debian package:
35 http://deb.grml.org/ => http://deb.grml.org/pool/main/g/grml2usb/
37 Please report bugs and feedback to Michael Prokop <mika@grml.org>.
40 cat > "${DIR}"/install.sh << EOF
45 if [ \$(id -u) != 0 ] ; then
46 echo "Error: become root before starting \$0" >& 2
50 BASE="\$(dirname \$0)"
52 printf "Installing files:\n"
54 printf " - /usr/sbin/grml2usb\n"
55 install -m 755 \${BASE}/grml2usb /usr/sbin/grml2usb
57 printf " - /usr/sbin/grml2iso\n"
58 install -m 755 \${BASE}/grml2iso /usr/sbin/grml2iso
60 [ -d /usr/share/grml2usb/grub ] || mkdir -p /usr/share/grml2usb/grub
61 printf " - /usr/share/grml2usb/grub/splash.xpm.gz\n"
62 install -m 644 \${BASE}/splash.xpm.gz /usr/share/grml2usb/grub/splash.xpm.gz
63 printf " - /usr/share/grml2usb/grub/grml.png\n"
64 install -m 644 \${BASE}/grml.png /usr/share/grml2usb/grub/grml.png
66 [ -d /usr/share/grml2usb/mbr ] || mkdir -p /usr/share/grml2usb/mbr
67 printf " - /usr/share/grml2usb/mbr/mbrmgr\n"
68 install -m 644 \${BASE}/mbrmgr /usr/share/grml2usb/mbr/mbrmgr
69 printf " - /usr/share/grml2usb/mbr/mbrldr\n"
70 install -m 644 \${BASE}/mbrldr /usr/share/grml2usb/mbr/mbrldr
72 [ -d /usr/share/man/man8/ ] || mkdir -p /usr/share/man/man8
73 printf " - /usr/share/man/man8/grml2usb.8.gz\n"
74 install -m 644 \${BASE}/grml2usb.8.gz /usr/share/man/man8/grml2usb.8.gz
76 printf "Finished installation.\n"
79 chmod 755 "${DIR}"/install.sh
81 cat > "${DIR}"/uninstall.sh << EOF
86 if [ \$(id -u) != 0 ] ; then
87 echo "Error: become root before starting \$0" >& 2
94 /usr/share/grml2usb/grub/splash.xpm.gz \\
95 /usr/share/grml2usb/grub/grml.png \\
96 /usr/share/grml2usb/mbr/mbrmgr \\
97 /usr/share/grml2usb/mbr/mbrldr \\
98 /usr/share/man/man8/grml2usb.8.gz \\
100 printf "Removing \$file: "
101 rm -f \$file && printf "done\n" || printf "failed\n"
105 chmod 755 "${DIR}"/uninstall.sh
107 fakeroot debian/rules build
110 cp grml2usb.8.txt grml2usb-$VERSION/
111 cp grml2iso.8.txt grml2usb-$VERSION/
112 gzip -9 --to-stdout grml2usb-$VERSION/grml2usb.8.txt > grml2usb-$VERSION/grml2usb.8.gz
113 gzip -9 --to-stdout grml2usb-$VERSION/grml2iso.8.txt > grml2usb-$VERSION/grml2iso.8.gz
114 rm grml2usb-$VERSION/grml2usb.8.txt
115 rm grml2usb-$VERSION/grml2iso.8.txt
118 cp grml2usb grml2iso mbr/mbrldr mbr/mbrmgr grub/* grml2usb-$VERSION/
119 sed -i -e "s/PROG_VERSION='\*\*\*UNKNOWN\*\*\*'/PROG_VERSION='${VERSION}'/" grml2usb-$VERSION/grml2usb
121 tar zcf grml2usb.tgz "${DIR}"
124 md5sum grml2usb.tgz > grml2usb.tgz.md5
128 echo "Not signing grml2usb.tgz.md5 as requested via --no-gpg."
129 echo "Do not forget to run gpg --clearsign grml2usb.tgz.md5 before uploading."
132 gpg --clearsign grml2usb.tgz.md5
134 echo "Generated grml2usb.tgz and grml2usb.tgz.md5.asc of grml2usb $VERSION"
138 ## END OF FILE #################################################################