mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 18:30:16 +00:00
Work on build-packages for deb pkg. Update config/deb/ files. Add util/log-entires.
This commit is contained in:
@@ -1,2 +1 @@
|
|||||||
5
|
5
|
||||||
|
|
||||||
|
@@ -1,21 +1,18 @@
|
|||||||
Source: maatkit
|
Source: percona-toolkit
|
||||||
Section: utils
|
Section: utils
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Baron Schwartz <baron.schwartz@gmail.com>
|
Maintainer: Percona Toolkit Developers <toolkit-dev@percona.com>
|
||||||
Uploaders: Norbert Tretkowski <nobse@debian.org>
|
|
||||||
Build-Depends: debhelper (>= 4.2)
|
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)
|
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
|
Standards-Version: 3.7.2
|
||||||
Homepage: http://code.google.com/p/maatkit/
|
Homepage: http://www.percona.com/software/percona-toolkit/
|
||||||
Vcs-Browser: http://code.google.com/p/maatkit/source/browse/
|
Vcs-Browser: http://bazaar.launchpad.net/~percona-toolkit-dev/percona-toolkit/0.9/files
|
||||||
Vcs-Svn: http://code.google.com/p/maatkit/source/browse/
|
Vcs-Bzr: bzr+ssh://bazaar.launchpad.net/~percona-toolkit-ddev/percona-toolkit/0.9/
|
||||||
|
|
||||||
Package: maatkit
|
Package: percona-toolkit
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Replaces: mysqltoolkit
|
|
||||||
Depends: ${perl:Depends}, libdbi-perl (>= 1.13), libdbd-mysql-perl | libdbd-mysql-5.1-perl, libterm-readkey-perl (>=2.10)
|
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
|
Description: Advanced MySQL and system command-line tools used by Percona
|
||||||
Contains utilities to check replication slaves for consistency with the
|
Percona Toolkit is a collection of advanced command-line tools used by
|
||||||
master, efficiently synchronize remote tables, archive rows from OLTP
|
Percona (http://www.percona.com/) support staff to perform a variety of
|
||||||
servers, log deadlocks, find duplicate indexes and foreign keys, profile
|
MySQL and system tasks that are too difficult or complex to perform manually.
|
||||||
queries, and perform other essential tasks.
|
|
||||||
|
@@ -1,32 +1,35 @@
|
|||||||
This package was debianized by Baron Schwartz <baron.schwartz@gmail.com> on
|
This package was debianized by Percona Toolkit Developers
|
||||||
Sun, 10 Jun 2007 22:30:36 -0500
|
<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:
|
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
|
This software is dual licensed, either GPL version 2 or Artistic License.
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, version 2; OR the Perl Artistic License.
|
|
||||||
|
|
||||||
This package is distributed in the hope that it will be useful,
|
This package is free software; you can redistribute it and/or modify
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
it under the terms of the GNU General Public License as published by
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
the Free Software Foundation, version 2; OR the Perl Artistic License.
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
This package is distributed in the hope that it will be useful,
|
||||||
along with this package; if not, write to the Free Software
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
On Debian systems, the complete text of the GNU General Public License version 2
|
You should have received a copy of the GNU General Public License
|
||||||
can be found in `/usr/share/common-licenses/GPL-2'.
|
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 Artistic License can
|
On Debian systems, the complete text of the GNU General Public License version
|
||||||
be found in `/usr/share/common-licenses/Artistic'.
|
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'.
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
version=3
|
|
||||||
http://code.google.com/p/maatkit/downloads/list \
|
|
||||||
http://maatkit.googlecode.com/files/maatkit-(.*)\.tar\.gz debian
|
|
@@ -37,10 +37,10 @@ fi
|
|||||||
# Paths
|
# Paths
|
||||||
# ############################################################################
|
# ############################################################################
|
||||||
|
|
||||||
DOCS=$BRANCH/docs
|
DOCS_DIR=$BRANCH/docs
|
||||||
DEB=$BRANCH/config/deb
|
DEB_CONFIG_DIR=$BRANCH/config/deb
|
||||||
RPM=$BRANCH/config/rpm
|
RPM_CONFIG_DIR=$BRANCH/config/rpm
|
||||||
RELEASE=$BRANCH/release
|
RELEASE_DIR=$BRANCH/release
|
||||||
|
|
||||||
# ############################################################################
|
# ############################################################################
|
||||||
# Programs and their options
|
# Programs and their options
|
||||||
@@ -71,6 +71,19 @@ check_version() {
|
|||||||
echo "OK"
|
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() {
|
update_version() {
|
||||||
echo -n "Updating version in tools... "
|
echo -n "Updating version in tools... "
|
||||||
cd $BRANCH/bin
|
cd $BRANCH/bin
|
||||||
@@ -119,7 +132,7 @@ update_copyright_year() {
|
|||||||
echo "OK"
|
echo "OK"
|
||||||
|
|
||||||
echo -n "Updating copyright year in percona-toolkit.pod..."
|
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 copyright=$(grep "[0-9] Percona Inc." $pod)
|
||||||
local new_copyright=$(../util/new-copyright-year $YEAR "$copyright")
|
local new_copyright=$(../util/new-copyright-year $YEAR "$copyright")
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@@ -148,7 +161,7 @@ update_manifest() {
|
|||||||
update_percona_toolkit_pod() {
|
update_percona_toolkit_pod() {
|
||||||
echo -n "Updating TOOLS section in percona-toolkit.pod: "
|
echo -n "Updating TOOLS section in percona-toolkit.pod: "
|
||||||
cd $BRANCH/bin
|
cd $BRANCH/bin
|
||||||
local pod=$DOCS/percona-toolkit.pod
|
local pod=$DOCS_DIR/percona-toolkit.pod
|
||||||
local tool_list=/tmp/percona-tool-list.pod
|
local tool_list=/tmp/percona-tool-list.pod
|
||||||
|
|
||||||
echo "=head1 TOOLS
|
echo "=head1 TOOLS
|
||||||
@@ -183,34 +196,59 @@ L<http://www.percona.com/software/>.
|
|||||||
echo "OK"
|
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() {
|
prep_release_dir() {
|
||||||
echo -n "Preparing release directory: "
|
echo -n "Preparing release directory: "
|
||||||
cd $BRANCH
|
cd $BRANCH
|
||||||
if [ ! -d $RELEASE ]; then
|
if [ ! -d $RELEASE_DIR ]; then
|
||||||
mkdir $RELEASE
|
mkdir $RELEASE_DIR
|
||||||
elif [ -d $RELEASE/$PKG ]; then
|
elif [ -d $RELEASE_DIR/$PKG ]; then
|
||||||
rm -rf $RELEASE/$PKG
|
rm -rf $RELEASE_DIR/$PKG
|
||||||
fi
|
fi
|
||||||
(
|
(
|
||||||
cd $RELEASE
|
cd $RELEASE_DIR
|
||||||
mkdir -p $PKG $PKG/bin $PKG/docs $PKG/lib
|
mkdir -p $PKG $PKG/bin $PKG/docs $PKG/lib
|
||||||
)
|
)
|
||||||
for file in `cat MANIFEST`; do
|
for file in `cat MANIFEST`; do
|
||||||
cp $file $RELEASE/$PKG/$file
|
cp $file $RELEASE_DIR/$PKG/$file
|
||||||
done
|
done
|
||||||
echo "OK"
|
echo "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_tar() {
|
build_tar() {
|
||||||
echo -n "Building $PKG.tar.gz: "
|
echo -n "Building $PKG.tar.gz: "
|
||||||
cd $RELEASE
|
cd $RELEASE_DIR
|
||||||
$TAR czf "$PKG.tar.gz" $PKG
|
$TAR czf "$PKG.tar.gz" $PKG
|
||||||
echo "OK"
|
echo "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_rpm() {
|
build_rpm() {
|
||||||
echo -n "Building $PKG-1.noarch.rpm: "
|
echo -n "Building $PKG-1.noarch.rpm: "
|
||||||
cd $RELEASE
|
cd $RELEASE_DIR
|
||||||
if [ ! -f "$PKG.tar.gz" ]; then
|
if [ ! -f "$PKG.tar.gz" ]; then
|
||||||
die "Cannot build RPM because $PKG.tar.gz does not exist"
|
die "Cannot build RPM because $PKG.tar.gz does not exist"
|
||||||
fi
|
fi
|
||||||
@@ -220,24 +258,43 @@ build_rpm() {
|
|||||||
local topdir=`pwd`
|
local topdir=`pwd`
|
||||||
|
|
||||||
# Build RPM package from the tarball.
|
# 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 \
|
--quiet \
|
||||||
--define "_topdir $PWD" \
|
--define "_topdir $PWD" \
|
||||||
--define "_sourcedir $RELEASE" \
|
--define "_sourcedir $RELEASE_DIR" \
|
||||||
--define "version $VERSION" \
|
--define "version $VERSION" \
|
||||||
--define "release 1"
|
--define "release 1"
|
||||||
|
|
||||||
if [ ! -f "RPMS/noarch/$PKG-1.noarch.rpm" ]; then
|
if [ ! -f "RPMS/noarch/$PKG-1.noarch.rpm" ]; then
|
||||||
die "RPMS/noarch/$PKG-1.noarch.rpm did not build"
|
die "RPMS/noarch/$PKG-1.noarch.rpm did not build"
|
||||||
fi
|
fi
|
||||||
mv "RPMS/noarch/$PKG-1.noarch.rpm" $RELEASE
|
mv "RPMS/noarch/$PKG-1.noarch.rpm" $RELEASE_DIR
|
||||||
rm -rf $RELEASE/rpm
|
rm -rf $RELEASE_DIR/rpm
|
||||||
|
|
||||||
echo "OK"
|
echo "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_deb() {
|
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,10 +305,16 @@ if [ $# -eq 0 ]; then
|
|||||||
die "Usage: $0 VERSION"
|
die "Usage: $0 VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
YEAR=$(date -u +'%Y') # for updating copyright year
|
# My machine's language is not English. This affects DEB_DATE because
|
||||||
DATE=$(date -u +'%F') # for updating release date
|
# date %a is language-sensitive. We want abbreviated day names in English.
|
||||||
VERSION=$1 # for PKG
|
# Setting LANG as such works for me; hopefully it works for you, too.
|
||||||
PKG="percona-toolkit-$VERSION" # what we're building
|
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
|
||||||
|
|
||||||
# This script does not check that you've done pre-release tasks like running
|
# This script does not check that you've done pre-release tasks like running
|
||||||
# the test suite, updating Changelog entries, etc. You're responsible for
|
# the test suite, updating Changelog entries, etc. You're responsible for
|
||||||
@@ -260,6 +323,7 @@ CHECK=${CHECK:-1}
|
|||||||
if [ $CHECK -eq 1 ]; then
|
if [ $CHECK -eq 1 ]; then
|
||||||
check_branch
|
check_branch
|
||||||
check_version
|
check_version
|
||||||
|
check_changelog
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# These items need to be updated automatically for each release.
|
# These items need to be updated automatically for each release.
|
||||||
@@ -269,6 +333,7 @@ if [ $UPDATE -eq 1 ]; then
|
|||||||
update_copyright_year
|
update_copyright_year
|
||||||
update_manifest
|
update_manifest
|
||||||
update_percona_toolkit_pod
|
update_percona_toolkit_pod
|
||||||
|
update_changelog
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Now that those ^ items are updated, you need to commit and push one more
|
# Now that those ^ items are updated, you need to commit and push one more
|
||||||
|
21
util/log-entries
Executable file
21
util/log-entries
Executable 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
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user