File: releaseprep

package info (click to toggle)
eggdrop 1.6.18-1etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 5,260 kB
  • ctags: 5,135
  • sloc: ansic: 55,311; sh: 4,101; tcl: 2,423; makefile: 1,505
file content (134 lines) | stat: -rwxr-xr-x 3,682 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#! /bin/sh
#
# releaseprep - prepares the tree for release
#
# Copyright (C) 2004 - 2006 Eggheads Development Team
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
#
# $Id: releaseprep,v 1.14 2006-03-28 02:35:49 wcc Exp $

show_usage() {
	echo "Usage: `basename $0` [-h|-r <#>]"
	echo ""
	echo "  patchname  - Name of last patch added."
	echo "  unixtime   - Some unixtime number or 'now'. Default is 'now'."
	echo ""
	echo "  -h, --help - Print this help and exit."
	echo "  -r, --rc   - Prepare to release Release Candidate '#'."
	exit 1
}

change_default_make() {
	cat configure | sed 's/DEFAULT_MAKE="debug"/DEFAULT_MAKE="eggdrop"/g' > configure_
	cat aclocal.m4 | sed 's/DEFAULT_MAKE="debug"/DEFAULT_MAKE="eggdrop"/g' > aclocal.m4_
	mv configure_ configure
	mv aclocal.m4_ aclocal.m4
	chmod +x configure
}

fix_patch_h() {
	if test $do_rc -eq 1; then
		misc/addpatch RC${rc_number} >/dev/null
		cat src/patch.h | sed 's/^patch.*CVS.*CVS version \*\//patch("PRE-RELEASE");           \/* RC version *\//g' > src/patch.h_
	else
		cat src/patch.h | sed 's/^patch.*/\/* PATCH GOES HERE *\//g' > src/patch.h_
	fi
	mv src/patch.h_ src/patch.h
}

create_default_makefile() {
	cat << '_EOF' > Makefile
all:
	@echo ""
	@echo "Before you can compile your bot you have to configure it."
	@echo "Please start the configure script now:"
	@echo ""
	@echo " % ./configure"
	@echo ""

_EOF
}

if test "x${1}" = "x-h" || test "x${1}" = "x--help"; then
	show_usage
fi

do_rc=0
if test "x${1}" = "x-r" || test "x${1}" = "x--rc"; then
	do_rc=1
	if test "x${2}" = "x"; then
		show_usage
	fi
	rc_number=$2
fi

if test ! -f src/main.c; then
	echo "You are not in the Eggdrop root directory."
	exit 1
fi

# Change default make from "debug" to "eggdrop"...
echo -n "Changing default make..."
change_default_make
echo " done."

# Fix patch.h...
echo -n "Fixing patch.h..."
fix_patch_h
echo " done."

# Remove CVS dirs.
echo -n "Removing CVS and autom4te.cache directories..."
find ./ -type d -name "autom4te.cache" -print | xargs rm -rf
find ./ -type d -name "CVS" -print | xargs rm -rf
echo " done."

# Remove .cvsignores.
echo -n "Removing .cvsignore files..."
find ./ -name ".cvsignore" -print | xargs rm -f
echo " done."

# Remove doc/web_docs/ and doc/html/chat/
if test -d ./doc/web_docs; then
	echo -n "Removing doc/web_docs/..."
	rm -rf doc/web_docs
	echo " done."
fi
if test -d ./doc/html/chat; then
        echo -n "Removing doc/html/chat/..."
        rm -rf doc/html/chat
        echo " done."
fi

# make distclean
echo ""
echo "Running make distclean."
sh configure >/dev/null && make distclean >/dev/null
echo ""

# Create Makefile.
echo -n "Creating Makefile..."
create_default_makefile
echo " done."

echo Current patch: `misc/addpatch -s`
echo "Complete."
echo ""