diff options
author | csilvers <csilvers@6b5cf1ce-ec42-a296-1ba9-69fdba395a50> | 2007-03-22 03:00:33 +0000 |
---|---|---|
committer | csilvers <csilvers@6b5cf1ce-ec42-a296-1ba9-69fdba395a50> | 2007-03-22 03:00:33 +0000 |
commit | 51b4875f8ade3e0930eed2dc2a842ec607a94a2c (patch) | |
tree | c58b2304b9f7127fc21f0591b4b8d1de7770b93c /packages | |
parent | e3a8513447d1141f083d4aaced0b240a6e161f47 (diff) | |
download | gperftools-51b4875f8ade3e0930eed2dc2a842ec607a94a2c.tar.gz |
Tue Feb 8 09:57:17 2005 El Goog <opensource@google.com>
* google-perftools: initial release:
The google-perftools package contains some utilities to improve
and analyze the performance of C++ programs. This includes an
optimized thread-caching malloc() and cpu and heap profiling
utilities.
git-svn-id: http://gperftools.googlecode.com/svn/trunk@9 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/deb.sh | 70 | ||||
-rw-r--r-- | packages/deb/README | 7 | ||||
-rw-r--r-- | packages/deb/changelog | 5 | ||||
-rw-r--r-- | packages/deb/compat | 1 | ||||
-rw-r--r-- | packages/deb/control | 25 | ||||
-rw-r--r-- | packages/deb/copyright | 35 | ||||
-rw-r--r-- | packages/deb/files | 0 | ||||
-rw-r--r-- | packages/deb/libgoogle-perftools-dev.dirs | 3 | ||||
-rw-r--r-- | packages/deb/libgoogle-perftools-dev.install | 4 | ||||
-rw-r--r-- | packages/deb/libgoogle-perftools0.dirs | 2 | ||||
-rw-r--r-- | packages/deb/libgoogle-perftools0.install | 2 | ||||
-rw-r--r-- | packages/deb/libgoogle-perftools0.manpages | 1 | ||||
-rwxr-xr-x | packages/deb/rules | 117 | ||||
-rwxr-xr-x | packages/rpm.sh | 74 | ||||
-rw-r--r-- | packages/rpm/rpm.spec | 89 |
15 files changed, 435 insertions, 0 deletions
diff --git a/packages/deb.sh b/packages/deb.sh new file mode 100755 index 0000000..ced98fa --- /dev/null +++ b/packages/deb.sh @@ -0,0 +1,70 @@ +#!/bin/bash -e + +# This takes one commandline argument, the name of the package. If no +# name is given, then we'll end up just using the name associated with +# an arbitrary .tar.gz file in the rootdir. That's fine: there's probably +# only one. +# +# Run this from the 'packages' directory, just under rootdir + +## Set LIB to lib if exporting a library, empty-string else +LIB= +#LIB=lib + +PACKAGE="$1" + +# We can only build Debian packages, if the Debian build tools are installed +if [ \! -x /usr/bin/debuild ]; then + echo "Cannot find /usr/bin/debuild. Not building Debian packages." 1>&2 + exit 0 +fi + +# Double-check we're in the packages directory, just under rootdir +if [ \! -r ../Makefile -a \! -r ../INSTALL ]; then + echo "Must run $0 in the 'packages' directory, under the root directory." 1>&2 + echo "Also, you must run \"make dist\" before running this script." 1>&2 + exit 0 +fi + +# Find the top directory for this package +topdir="${PWD%/*}" + +# Find the tar archive built by "make dist" +archive="$(basename "$(ls -1 ${topdir}/$PACKAGE*.tar.gz | tail -n 1)" .tar.gz)" +if [ -z "${archive}" ]; then + echo "Cannot find ../$PACKAGE*.tar.gz. Run \"make dist\" first." 1>&2 + exit 0 +fi + +# Create a pristine directory for building the Debian package files +trap 'rm -rf '`pwd`/tmp'; exit $?' EXIT SIGHUP SIGINT SIGTERM + +rm -rf tmp +mkdir -p tmp +cd tmp + +# Debian has very specific requirements about the naming of build +# directories, and tar archives. It also wants to write all generated +# packages to the parent of the source directory. We accommodate these +# requirements by building directly from the tar file. +ln -s "${topdir}/${archive}.tar.gz" "${LIB}${archive}.orig.tar.gz" +tar zfx "${LIB}${archive}.orig.tar.gz" +[ -n "${LIB}" ] && mv "${archive}" "${LIB}${archive}" +cd "${LIB}${archive}" +# This is one of those 'specific requirements': where the deb control files live +ln -s "packages/deb" "debian" + +# Now, we can call Debian's standard build tool +debuild -uc -us +cd ../.. # get back to the original top-level dir + +# We'll put the result in a subdirectory that's named after the OS version +# we've made this .deb file for. +destdir="debian-$(cat /etc/debian_version 2>/dev/null || echo UNKNOWN)" + +rm -rf "$destdir" +mkdir -p "$destdir" +mv $(find tmp -mindepth 1 -maxdepth 1 -type f) "$destdir" + +echo +echo "The Debian package files are located in $PWD/$destdir" diff --git a/packages/deb/README b/packages/deb/README new file mode 100644 index 0000000..57becfd --- /dev/null +++ b/packages/deb/README @@ -0,0 +1,7 @@ +The list of files here isn't complete. For a step-by-step guide on +how to set this package up correctly, check out + http://www.debian.org/doc/maint-guide/ + +Most of the files that are in this directory are boilerplate. +However, you may need to change the list of binary-arch dependencies +in 'rules'. diff --git a/packages/deb/changelog b/packages/deb/changelog new file mode 100644 index 0000000..7db9caa --- /dev/null +++ b/packages/deb/changelog @@ -0,0 +1,5 @@ +google-perftools (0.1-1) unstable; urgency=low + + * Initial release. + + -- El Goog <opensource@google.com> Tue, 15 Feb 2005 08:07:33 -0800 diff --git a/packages/deb/compat b/packages/deb/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/packages/deb/compat @@ -0,0 +1 @@ +4 diff --git a/packages/deb/control b/packages/deb/control new file mode 100644 index 0000000..51692d2 --- /dev/null +++ b/packages/deb/control @@ -0,0 +1,25 @@ +Source: google-perftools +Priority: optional +Maintainer: El Goog <opensource@google.com> +Build-Depends: debhelper (>= 4.0.0), binutils, coreutils +Standards-Version: 3.6.1 + +Package: libgoogle-perftools-dev +Section: libdevel +Architecture: any +Depends: libgoogle-perftools0 (= ${Source-Version}) +Description: libraries for CPU and heap analysis, plus an efficient thread-caching malloc + The google-perftools package contains some utilities to improve and + analyze the performance of C++ programs. This includes an optimized + thread-caching malloc() and cpu and heap profiling utilities. The + devel package contains static and debug libraries and header files + for developing applications that use the google-perftools package. + +Package: libgoogle-perftools0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: libraries for CPU and heap analysis, plus an efficient thread-caching malloc + The google-perftools package contains some utilities to improve and + analyze the performance of C++ programs. This includes an optimized + thread-caching malloc() and cpu and heap profiling utilities. diff --git a/packages/deb/copyright b/packages/deb/copyright new file mode 100644 index 0000000..401e871 --- /dev/null +++ b/packages/deb/copyright @@ -0,0 +1,35 @@ +This package was debianized by El Goog <opensource@google.com> on +15 February 2005. + +It was downloaded from http://code.google.com/ + +Upstream Author: opensource@google.com + +Copyright (c) 2005, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/deb/files b/packages/deb/files new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/packages/deb/files diff --git a/packages/deb/libgoogle-perftools-dev.dirs b/packages/deb/libgoogle-perftools-dev.dirs new file mode 100644 index 0000000..9fdbd88 --- /dev/null +++ b/packages/deb/libgoogle-perftools-dev.dirs @@ -0,0 +1,3 @@ +usr/lib +usr/include +usr/include/google diff --git a/packages/deb/libgoogle-perftools-dev.install b/packages/deb/libgoogle-perftools-dev.install new file mode 100644 index 0000000..cc83888 --- /dev/null +++ b/packages/deb/libgoogle-perftools-dev.install @@ -0,0 +1,4 @@ +usr/include/google/* +usr/lib/lib*.so +usr/lib/lib*.a +usr/lib/*.la diff --git a/packages/deb/libgoogle-perftools0.dirs b/packages/deb/libgoogle-perftools0.dirs new file mode 100644 index 0000000..14f5b95 --- /dev/null +++ b/packages/deb/libgoogle-perftools0.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/bin diff --git a/packages/deb/libgoogle-perftools0.install b/packages/deb/libgoogle-perftools0.install new file mode 100644 index 0000000..983962c --- /dev/null +++ b/packages/deb/libgoogle-perftools0.install @@ -0,0 +1,2 @@ +usr/lib/lib*.so.* +usr/bin/pprof diff --git a/packages/deb/libgoogle-perftools0.manpages b/packages/deb/libgoogle-perftools0.manpages new file mode 100644 index 0000000..08d1476 --- /dev/null +++ b/packages/deb/libgoogle-perftools0.manpages @@ -0,0 +1 @@ +doc/pprof.1 diff --git a/packages/deb/rules b/packages/deb/rules new file mode 100755 index 0000000..f520bef --- /dev/null +++ b/packages/deb/rules @@ -0,0 +1,117 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +# shared library versions, option 1 +#version=2.0.5 +#major=2 +# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so +version=`ls src/.libs/lib*.so.* | \ + awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` +major=`ls src/.libs/lib*.so.* | \ + awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` + +config.status: configure + dh_testdir + # Add here commands to configure the package. + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info + + +build: build-stamp +build-stamp: config.status + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) distclean +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp + $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_install --sourcedir=debian/tmp +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff --git a/packages/rpm.sh b/packages/rpm.sh new file mode 100755 index 0000000..de936a3 --- /dev/null +++ b/packages/rpm.sh @@ -0,0 +1,74 @@ +#!/bin/sh -e + +# Run this from the 'packages' directory, just under rootdir + +# We can only build rpm packages, if the rpm build tools are installed +if [ \! -x /usr/bin/rpmbuild ] +then + echo "Cannot find /usr/bin/rpmbuild. Not building an rpm." 1>&2 + exit 0 +fi + +# Check the commandline flags +PACKAGE="$1" +VERSION="$2" +fullname="${PACKAGE}-${VERSION}" +archive=../$fullname.tar.gz + +if [ -z "$1" -o -z "$2" ] +then + echo "Usage: $0 <package name> <package version>" 1>&2 + exit 0 +fi + +# Double-check we're in the packages directory, just under rootdir +if [ \! -r ../Makefile -a \! -r ../INSTALL ] +then + echo "Must run $0 in the 'packages' directory, under the root directory." 1>&2 + echo "Also, you must run \"make dist\" before running this script." 1>&2 + exit 0 +fi + +if [ \! -r "$archive" ] +then + echo "Cannot find $archive. Run \"make dist\" first." 1>&2 + exit 0 +fi + +# Create the directory where the input lives, and where the output should live +RPM_SOURCE_DIR="/tmp/rpmsource-$fullname" +RPM_BUILD_DIR="/tmp/rpmbuild-$fullname" + +trap 'rm -rf $RPM_SOURCE_DIR $RPM_BUILD_DIR; exit $?' EXIT SIGHUP SIGINT SIGTERM + +rm -rf "$RPM_SOURCE_DIR" "$RPM_BUILD_DIR" +mkdir "$RPM_SOURCE_DIR" +mkdir "$RPM_BUILD_DIR" + +cp "$archive" "$RPM_SOURCE_DIR" + +rpmbuild -bb rpm/rpm.spec \ + --define "NAME $PACKAGE" \ + --define "VERSION $VERSION" \ + --define "_sourcedir $RPM_SOURCE_DIR" \ + --define "_builddir $RPM_BUILD_DIR" \ + --define "_rpmdir $RPM_SOURCE_DIR" + +# We put the output in a directory based on what system we've built for +destdir=rpm-unknown +if [ -r /etc/issue ] +then + grep "Red Hat.*release 7" /etc/issue >/dev/null 2>&1 && destdir=rh7 + grep "Red Hat.*release 8" /etc/issue >/dev/null 2>&1 && destdir=rh8 + grep "Red Hat.*release 9" /etc/issue >/dev/null 2>&1 && destdir=rh9 + grep "Fedora Core.*release 1" /etc/issue >/dev/null 2>&1 && destdir=fc1 + grep "Fedora Core.*release 2" /etc/issue >/dev/null 2>&1 && destdir=fc2 + grep "Fedora Core.*release 3" /etc/issue >/dev/null 2>&1 && destdir=fc3 +fi + +rm -rf "$destdir" +mkdir -p "$destdir" +mv "$RPM_SOURCE_DIR"/*/"$fullname"*.rpm "$destdir" + +echo +echo "The rpm package file(s) are located in $PWD/$destdir" diff --git a/packages/rpm/rpm.spec b/packages/rpm/rpm.spec new file mode 100644 index 0000000..9bb8238 --- /dev/null +++ b/packages/rpm/rpm.spec @@ -0,0 +1,89 @@ +%define ver %VERSION +%define RELEASE 1 +%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} +%define prefix /usr + +Name: %NAME +Summary: Performance tools for C++ +Version: %ver +Release: %rel +Group: Development/Libraries +URL: http://google.sourceforge.net +Copyright: BSD +Packager: El Goog <opensource@google.com> +Source: http://google.sourceforge.net/%{NAME}-%{PACKAGE_VERSION}.tar.gz +Distribution: Redhat 7 and above. +Buildroot: %{_tmppath}/%{name}-root +Docdir: %prefix/doc +Prefix: %prefix + +%description +The %name packages contains some utilities to improve and analyze the +performance of C++ programs. This includes an optimized thread-caching +malloc() and cpu and heap profiling utilities. + +%package devel +Summary: Performance tools for C++ +Group: Development/Libraries + +%description devel +The %name-devel package contains static and debug libraries and header +files for developing applications that use the %name package. + +%changelog + * Tue Feb 8 2005 <opensource@google.com> + - First draft + +%prep +%setup + +%build +./configure +make prefix=%prefix + +%install +rm -rf $RPM_BUILD_ROOT +make prefix=$RPM_BUILD_ROOT%{prefix} install + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) + +%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO doc/cpu_profiler.html doc/heap-example1.png doc/heap_profiler.html doc/overview.gif doc/pageheap.gif doc/pprof-test-big.gif doc/pprof-test.gif doc/pprof-vsnprintf-big.gif doc/pprof-vsnprintf.gif doc/spanmap.gif doc/tcmalloc.html doc/threadheap.gif + +%{prefix}/lib/libstacktrace.so.0 +%{prefix}/lib/libstacktrace.so.0.0.0 +%{prefix}/lib/libtcmalloc.so.0 +%{prefix}/lib/libtcmalloc.so.0.0.0 +%{prefix}/lib/libprofiler.so.0 +%{prefix}/lib/libprofiler.so.0.0.0 +%{prefix}/lib/libheapprofiler.so.0 +%{prefix}/lib/libheapprofiler.so.0.0.0 +%{prefix}/lib/libheapchecker.so.0 +%{prefix}/lib/libheapchecker.so.0.0.0 +%{prefix}/bin/pprof +%{prefix}/man/man1/pprof.1.gz + +%files devel +%defattr(-,root,root) + +%{prefix}/include/google +%{prefix}/lib/debug +%{prefix}/lib/libstacktrace.a +%{prefix}/lib/libstacktrace.la +%{prefix}/lib/libstacktrace.so +%{prefix}/lib/libtcmalloc.a +%{prefix}/lib/libtcmalloc.la +%{prefix}/lib/libtcmalloc.so +%{prefix}/lib/libprofiler.a +%{prefix}/lib/libprofiler.la +%{prefix}/lib/libprofiler.so +%{prefix}/lib/libheapprofiler.a +%{prefix}/lib/libheapprofiler.la +%{prefix}/lib/libheapprofiler.so +%{prefix}/lib/libheapchecker.a +%{prefix}/lib/libheapchecker.la +%{prefix}/lib/libheapchecker.so + |