| 1 | #!/bin/bash |
| 2 | # generate the ChangeLog.txt and create the tarball |
| 3 | |
| 4 | # Settings |
| 5 | PKG="drbl" |
| 6 | FILES_DIRS="Makefile drbl.spec sbin bin doc lang pkg scripts themes conf image pki setup prerun postrun" |
| 7 | # SPEC_FILE="$PKG.spec" |
| 8 | |
| 9 | set -e |
| 10 | # |
| 11 | VER="$(LC_ALL=C head -n 1 debian/changelog | grep -i "^${PKG}" | grep -E -o "\(.*\)" | sed -r -e "s/\(//g" -e "s/\)//g" | cut -d"-" -f1)" |
| 12 | [ -z "$VER" ] && echo "No version found in debian/changelog! Program terminated!" |
| 13 | echo "VER: $VER" |
| 14 | # RPM_VER=`grep ^Version $SPEC_FILE |sed -e "s/\t/ /g" -e "s/ \+/ /g" |cut -d":" -f2 |tr -d " "` |
| 15 | # echo "RPM VER: $RPM_VER" |
| 16 | # if [ "$VER" != "$RPM_VER" ]; then |
| 17 | # echo "Versions do not match!" |
| 18 | # echo "Program terminated!" |
| 19 | # exit 1 |
| 20 | # fi |
| 21 | |
| 22 | # Create the ChangeLog file |
| 23 | cat <<EOF > doc/ChangeLog.txt |
| 24 | DRBL project. |
| 25 | Authors: Steven Shiau <steven _at_ clonezilla org>, Blake, Kuo-Lien Huang (klhaung _at_ gmail com), Ceasar Sun (ceasar _at_ nchc org tw), Jazz Wang (jazz _at_ nchc org tw) and Thomas Tsai (thomas _at_ nchc org tw) |
| 26 | License: GPL |
| 27 | http://drbl.org |
| 28 | http://drbl.sourceforge.net |
| 29 | http://drbl.nchc.org.tw |
| 30 | |
| 31 | EOF |
| 32 | |
| 33 | cat debian/changelog >> doc/ChangeLog.txt |
| 34 | |
| 35 | td="${PKG}-${VER}" |
| 36 | |
| 37 | # |
| 38 | [ -d "$td" ] && rm -rf $td |
| 39 | mkdir -p $td |
| 40 | # Clean stale files in debian |
| 41 | cp -ar $FILES_DIRS $td/ |
| 42 | |
| 43 | echo $VER > $td/doc/VERSION |
| 44 | tar cJf $td.tar.xz --owner=root --group=root $td |
| 45 | rm -rf $td |