Work on build-packages for deb pkg. Update config/deb/ files. Add util/log-entires.

This commit is contained in:
Daniel Nichter
2011-07-19 12:24:19 -06:00
parent 8caaad5d8e
commit 39984204f8
6 changed files with 143 additions and 61 deletions

View File

@@ -1,2 +1 @@
5

View File

@@ -1,21 +1,18 @@
Source: maatkit
Source: percona-toolkit
Section: utils
Priority: optional
Maintainer: Baron Schwartz <baron.schwartz@gmail.com>
Uploaders: Norbert Tretkowski <nobse@debian.org>
Maintainer: Percona Toolkit Developers <toolkit-dev@percona.com>
Build-Depends: debhelper (>= 4.2)
Build-Depends-Indep: perl (>= 5.6.0-16), libdbi-perl (>= 1.13), libdbd-mysql-perl (>= 1.0), libterm-readkey-perl (>=2.10)
Standards-Version: 3.7.2
Homepage: http://code.google.com/p/maatkit/
Vcs-Browser: http://code.google.com/p/maatkit/source/browse/
Vcs-Svn: http://code.google.com/p/maatkit/source/browse/
Homepage: http://www.percona.com/software/percona-toolkit/
Vcs-Browser: http://bazaar.launchpad.net/~percona-toolkit-dev/percona-toolkit/0.9/files
Vcs-Bzr: bzr+ssh://bazaar.launchpad.net/~percona-toolkit-ddev/percona-toolkit/0.9/
Package: maatkit
Package: percona-toolkit
Architecture: all
Replaces: mysqltoolkit
Depends: ${perl:Depends}, libdbi-perl (>= 1.13), libdbd-mysql-perl | libdbd-mysql-5.1-perl, libterm-readkey-perl (>=2.10)
Description: Command-line utilities for MySQL
Contains utilities to check replication slaves for consistency with the
master, efficiently synchronize remote tables, archive rows from OLTP
servers, log deadlocks, find duplicate indexes and foreign keys, profile
queries, and perform other essential tasks.
Description: Advanced MySQL and system command-line tools used by Percona
Percona Toolkit is a collection of advanced command-line tools used by
Percona (http://www.percona.com/) support staff to perform a variety of
MySQL and system tasks that are too difficult or complex to perform manually.

View File

@@ -1,15 +1,18 @@
This package was debianized by Baron Schwartz <baron.schwartz@gmail.com> on
Sun, 10 Jun 2007 22:30:36 -0500
This package was debianized by Percona Toolkit Developers
<toolkit-dev@percona.com> on Sun, 10 Jun 2007 22:30:36 -0500
It was downloaded from http://code.google.com/p/maatkit/
It was downloaded from http://www.percona.com/downloads/
Debian Sponsor: Norbert Tretkowski <nobse@debian.org>
Upstream Author:
Upstream Author: Baron Schwartz <baron.schwartz@gmail.com>
Percona Toolkit Developers <toolkit-dev@percona.com>
Copyright: "Copyright(c) 2006-2007 Baron Schwartz"
Copyright:
Copyright 2011 Percona Inc.
License:
This software is dual licensed, either GPL version 2 or Artistic License.
This package is free software; you can redistribute it and/or modify
@@ -25,8 +28,8 @@ License:
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU General Public License version 2
can be found in `/usr/share/common-licenses/GPL-2'.
On Debian systems, the complete text of the GNU General Public License version
2 can be found in `/usr/share/common-licenses/GPL-2'.
On Debian systems, the complete text of the Artistic License can
be found in `/usr/share/common-licenses/Artistic'.
On Debian systems, the complete text of the Artistic License can be found in
`/usr/share/common-licenses/Artistic'.

View File

@@ -1,3 +0,0 @@
version=3
http://code.google.com/p/maatkit/downloads/list \
http://maatkit.googlecode.com/files/maatkit-(.*)\.tar\.gz debian

View File

@@ -37,10 +37,10 @@ fi
# Paths
# ############################################################################
DOCS=$BRANCH/docs
DEB=$BRANCH/config/deb
RPM=$BRANCH/config/rpm
RELEASE=$BRANCH/release
DOCS_DIR=$BRANCH/docs
DEB_CONFIG_DIR=$BRANCH/config/deb
RPM_CONFIG_DIR=$BRANCH/config/rpm
RELEASE_DIR=$BRANCH/release
# ############################################################################
# Programs and their options
@@ -71,6 +71,19 @@ check_version() {
echo "OK"
}
check_changelog() {
echo -n "Checking Changelog: "
cd $BRANCH
first_line=$(head -n 3 Changelog | tail -n 1)
if [ $(expr "$first_line" : "v[0-9]") -gt 0 ]; then
die "No changes since $first_line"
fi
if [ -n "$(grep "^v$VERSION" Changelog)" ]; then
die "Entries for v$VERSION already exist"
fi
echo "OK"
}
update_version() {
echo -n "Updating version in tools... "
cd $BRANCH/bin
@@ -119,7 +132,7 @@ update_copyright_year() {
echo "OK"
echo -n "Updating copyright year in percona-toolkit.pod..."
local pod=$DOCS/percona-toolkit.pod
local pod=$DOCS_DIR/percona-toolkit.pod
local copyright=$(grep "[0-9] Percona Inc." $pod)
local new_copyright=$(../util/new-copyright-year $YEAR "$copyright")
if [ $? -ne 0 ]; then
@@ -148,7 +161,7 @@ update_manifest() {
update_percona_toolkit_pod() {
echo -n "Updating TOOLS section in percona-toolkit.pod: "
cd $BRANCH/bin
local pod=$DOCS/percona-toolkit.pod
local pod=$DOCS_DIR/percona-toolkit.pod
local tool_list=/tmp/percona-tool-list.pod
echo "=head1 TOOLS
@@ -183,34 +196,59 @@ L<http://www.percona.com/software/>.
echo "OK"
}
update_changelog() {
echo -n "Updating Changelog: "
cd $BRANCH
head -n 2 Changelog > /tmp/changelog.tmp
echo "v$VERSION released $DATE" >> /tmp/changelog.tmp
echo >> /tmp/changelog.tmp
n_lines=$(wc -l Changelog | awk '{print $1}')
tail -n $((n_lines - 2)) Changelog >> /tmp/changelog.tmp
mv /tmp/changelog.tmp $BRANCH/Changelog
echo "OK"
echo -n "Updating Debian changelog: "
cd $DEB_CONFIG_DIR
echo "percona-toolkit ($VERSION) unstable; urgency=low
" > /tmp/changelog.tmp
cat $BRANCH/Changelog | $BRANCH/util/log-entries -v version="$VERSION" >> /tmp/changelog.tmp
echo >> /tmp/changelog.tmp
echo " -- Percona Toolkit Developers <toolkit-dev@percona.com> $DEB_DATE
" >> /tmp/changelog.tmp
cat changelog >> /tmp/changelog.tmp
mv /tmp/changelog.tmp changelog
echo "OK"
}
prep_release_dir() {
echo -n "Preparing release directory: "
cd $BRANCH
if [ ! -d $RELEASE ]; then
mkdir $RELEASE
elif [ -d $RELEASE/$PKG ]; then
rm -rf $RELEASE/$PKG
if [ ! -d $RELEASE_DIR ]; then
mkdir $RELEASE_DIR
elif [ -d $RELEASE_DIR/$PKG ]; then
rm -rf $RELEASE_DIR/$PKG
fi
(
cd $RELEASE
cd $RELEASE_DIR
mkdir -p $PKG $PKG/bin $PKG/docs $PKG/lib
)
for file in `cat MANIFEST`; do
cp $file $RELEASE/$PKG/$file
cp $file $RELEASE_DIR/$PKG/$file
done
echo "OK"
}
build_tar() {
echo -n "Building $PKG.tar.gz: "
cd $RELEASE
cd $RELEASE_DIR
$TAR czf "$PKG.tar.gz" $PKG
echo "OK"
}
build_rpm() {
echo -n "Building $PKG-1.noarch.rpm: "
cd $RELEASE
cd $RELEASE_DIR
if [ ! -f "$PKG.tar.gz" ]; then
die "Cannot build RPM because $PKG.tar.gz does not exist"
fi
@@ -220,24 +258,43 @@ build_rpm() {
local topdir=`pwd`
# Build RPM package from the tarball.
rpmbuild -bb --clean $BRANCH/config/rpm/percona-toolkit.spec \
rpmbuild -bb --clean $RPM_CONFIG_DIR/percona-toolkit.spec \
--quiet \
--define "_topdir $PWD" \
--define "_sourcedir $RELEASE" \
--define "_sourcedir $RELEASE_DIR" \
--define "version $VERSION" \
--define "release 1"
if [ ! -f "RPMS/noarch/$PKG-1.noarch.rpm" ]; then
die "RPMS/noarch/$PKG-1.noarch.rpm did not build"
fi
mv "RPMS/noarch/$PKG-1.noarch.rpm" $RELEASE
rm -rf $RELEASE/rpm
mv "RPMS/noarch/$PKG-1.noarch.rpm" $RELEASE_DIR
rm -rf $RELEASE_DIR/rpm
echo "OK"
}
build_deb() {
:
local deb_pkg="percona-toolkit_$VERSION-1_all.deb"
echo -n "Building $deb_pkg: "
cd $RELEASE_DIR
if [ ! -f "$PKG.tar.gz" ]; then
die "Cannot build RPM because $PKG.tar.gz does not exist"
fi
# Copy debian pkg files.
if [ ! -d "$RELEASE_DIR/$PKG/debian" ]; then
mkdir $RELEASE_DIR/$PKG/debian
fi
cp $BRANCH/config/deb/* $RELEASE_DIR/$PKG/debian/
# Build Debian source and binary packages
cd $RELEASE_DIR/$PKG
debuild -S -sa -us -uc
debuild -b -us -uc
echo "OK"
}
# ############################################################################
@@ -248,8 +305,14 @@ if [ $# -eq 0 ]; then
die "Usage: $0 VERSION"
fi
# My machine's language is not English. This affects DEB_DATE because
# date %a is language-sensitive. We want abbreviated day names in English.
# Setting LANG as such works for me; hopefully it works for you, too.
LANG='en_US.UTF-8'
YEAR=$(date -u +'%Y') # for updating copyright year
DATE=$(date -u +'%F') # for updating release date
DEB_DATE=$(date -u +'%a, %d %m %Y %T %z') # for updating deb/changelog
VERSION=$1 # for PKG
PKG="percona-toolkit-$VERSION" # what we're building
@@ -260,6 +323,7 @@ CHECK=${CHECK:-1}
if [ $CHECK -eq 1 ]; then
check_branch
check_version
check_changelog
fi
# These items need to be updated automatically for each release.
@@ -269,6 +333,7 @@ if [ $UPDATE -eq 1 ]; then
update_copyright_year
update_manifest
update_percona_toolkit_pod
update_changelog
fi
# Now that those ^ items are updated, you need to commit and push one more

21
util/log-entries Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/awk -f
BEGIN {
if ( version == "" ) {
print "Usage: log-entries VERSION"
exit
}
start = "^v" version
}
$0 ~ start {
while ( getline ) {
if ( $0 ~ /^v[0-9]/ )
exit
if ( $0 ~ /^$/ )
continue
print
}
}