summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2006-11-13 22:13:33 +0100
committerTobias Klauser <tklauser@xenon.tklauser.home>2006-11-13 22:13:33 +0100
commitb37e0da0b7dc72ddfa513e319ca71b5f5b8aeb7d (patch)
tree810ec4a83a30b7e001321fdb2402c756f511727e /debian
Initial import15.6-2
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog192
-rw-r--r--debian/compat1
-rw-r--r--debian/control29
-rw-r--r--debian/copyright93
-rw-r--r--debian/cscope-indexer.161
-rw-r--r--debian/emacsen-startup1
-rw-r--r--debian/ocs.162
-rw-r--r--debian/patches/00list1
-rwxr-xr-xdebian/patches/01-fix-resize-crash-inside-vim.dpatch55
-rwxr-xr-xdebian/rules92
-rw-r--r--debian/watch2
11 files changed, 589 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..db2961e
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,192 @@
+cscope (15.6-2) unstable; urgency=low
+
+ * Fix crash on resize when used inside vim. Patch taken from upstream BTS
+ (Closes: #374994)
+ * Add watch file again
+
+ -- Tobias Klauser <tklauser@access.unizh.ch> Sat, 21 Oct 2006 14:46:49 +0200
+
+cscope (15.6-1) unstable; urgency=low
+
+ * New upstream release
+ - Fixes a segfault when creating an inverted index and thus makes our own
+ patch obsolete (#386595).
+
+ -- Tobias Klauser <tklauser@access.unizh.ch> Tue, 17 Oct 2006 14:16:17 +0200
+
+cscope (15.5+cvs20060902-3) unstable; urgency=low
+
+ * Fix a segfault when creating an inverted index (Closes: #386595). Thanks
+ to Mike Stroyan <mike.stroyan@hp.com>
+ * Replace symlink to the GPL in /usr/share/doc/cscope/contrib/webcscope by a
+ license statement in debian/copyright. This fixes a linda warning.
+ * Mention xcscope license and copyright information in debian/copyright
+ * Remove pointless symlink to xcscope.el from cscope documentation
+ directory.
+ * CVE-2006-4262 was fixed with 15.5+cvs20060902-1 but I forgot to mention in
+ the changelog, sorry!
+
+ -- Tobias Klauser <tklauser@access.unizh.ch> Fri, 29 Sep 2006 12:03:40 +0200
+
+cscope (15.5+cvs20060902-2) unstable; urgency=low
+
+ * Restore accidentally removed manpages ocs.1 and cscope-indexer.1
+
+ -- Tobias Klauser <tklauser@access.unizh.ch> Sun, 3 Sep 2006 15:38:23 +0200
+
+cscope (15.5+cvs20060902-1) unstable; urgency=low
+
+ * New snapshot from upstream CVS as of 2006-09-02. Fixes the following bug:
+ - Handle trailing ':' in VPATH envvar correctly, thanks Mattia Dongili
+ (Closes: #353528)
+ * New maintainer (Closes: #378802)
+ * Remove Build-Depends on automake-1.7 as it was only there to shut up a
+ warning which does not show up anymore.
+ * Remove watch file
+
+ -- Tobias Klauser <tklauser@access.unizh.ch> Sat, 2 Sep 2006 19:25:48 +0200
+
+cscope (15.5+cvs20050816-2) unstable; urgency=low
+
+ * QA Upload (Ack NMU, Closes: #340177)
+ * Set Maintainer to QA Group, Orphaned: #378802
+ * Conforms to latest Standards Version 3.7.2
+
+ -- Michael Ablassmeier <abi@debian.org> Tue, 1 Aug 2006 11:04:19 +0200
+
+cscope (15.5+cvs20050816-1.1) unstable; urgency=high
+
+ * Non-maintainer upload.
+ * Apply patch from Alec Berryman <alec@thened.net> to fix
+ CVE-2004-2541.diff (Closes: #340177).
+
+ -- Julien Cristau <julien.cristau@ens-lyon.org> Sat, 10 Jun 2006 20:06:36 +0200
+
+cscope (15.5+cvs20050816-1) unstable; urgency=low
+
+ * New upstream CVS as of 2005-08-16. Fixes the following in Debian BTS:
+ - 2004-06-23 Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>
+ * src/dir.c (makefilelist): Fix broken movement of point_in_line
+ when parsing quoted names. Simplify structure by moving default
+ handling upward.
+ Closes: Bug#298931 - bug in handling quote-protected filenames in
+ cscope.files
+ - 2004-12-06 Neil Horman <nhorman@gmail.com>
+ * src/main.c: Fix for temp file security bug (sourceforge
+ bug number 1062807 / CAN-2004-0970 [sic, should be CAN-2004-0996])
+ Acknowledge NMU of 15.5-1.1 (Thanks to Joey Hess, Martin Pitt
+ and Gerardo Di Giacomo). Upstream fixed the same issue in a
+ slightly different way, by creating a temp directory to store
+ the temp files. (Closes: #282815)
+ * xcscope.el: Applied Lasse Kantola's change_let_to_setq.patch
+ so that disabling of fuzzy matching would work correctly.
+ (Closes: Bug#315466)
+ * Adds Build-Depends: automake1.7 to avoid warnings.
+ * Updated Standards-Version: from to 3.6.2.
+ * Updated author list in debian/copyright.
+
+ -- Anthony Fok <foka@debian.org> Sun, 13 Nov 2005 00:30:02 +0800
+
+cscope (15.5-1.1) unstable; urgency=HIGH
+
+ * NMU to fix temp file security hole. Closes: #282815 (CAN-2004-0996)
+ * Incorporates a patch by Martin Pitt <martin.pitt@canonical.com>:
+ * SECURITY UPDATE: insecure temp file creation vulnerability
+ * src/main.c:
+ - modified the temporary file creation procedure
+ * References:
+ - CAN-2004-0996
+ - http://lists.netsys.com/pipermail/full-disclosure/2004-November/029341.html
+ * Thanks to Gerardo Di Giacomo <gerardo@linux.it> for his assistance with
+ the patch
+
+ -- Joey Hess <joeyh@debian.org> Sun, 5 Dec 2004 12:45:00 -0500
+
+cscope (15.5-1) unstable; urgency=low
+
+ * New upstream release. (Closes: Bug#236296)
+ * cscope man page line-breaking problem has been fixed upstream.
+ (Closes: Bug#176003, Bug#245705)
+ * Added cscope-index.1 man page, thanks to Robert Lemmen!
+ (Closes: Bug#174689)
+ * Updated to Standards-Version: 3.6.1.
+ * Fixed debian/watch.
+
+ -- Anthony Fok <foka@debian.org> Thu, 29 Apr 2004 22:35:29 +0800
+
+cscope (15.4-2) unstable; urgency=high
+
+ * config.guess and config.sub too old. Updated with the ones in
+ /usr/share/misc. Thanks to LaMont Jones for the bug report.
+ Also, the new bison did not like the extraneous "=". Removed them.
+ Thanks to Junichi Uekawa for the added note. (Closes: Bug#163465)
+ * Minor fixes (incremented debhelper dependencies, shortened description)
+
+ -- Anthony Fok <foka@debian.org> Sun, 3 Nov 2002 00:28:19 +0800
+
+cscope (15.4-1) unstable; urgency=low
+
+ * New upstream release. Thanks to GOTO Masanori for notifying me.
+ (Closes: Bug#163309)
+
+ -- Anthony Fok <foka@debian.org> Sun, 6 Oct 2002 03:59:56 +0800
+
+cscope (15.3-1) unstable; urgency=low
+
+ * New upstream release. (Thanks to GOTO Masanori for the notification).
+ (Closes: Bug#104084)
+ * Upstream seems to have fixed the "cscope hangs on trivial file not
+ ending in newline" problem too. :-) Thanks to Bradley A. Bosch
+ for reporting the problem. (Closes: Bug#98461)
+ * Added manpage for ocs(1) kindly provided by Nick Rusnov <nick@grawk.net>.
+ Many thanks! (Closes: Bug#100418)
+ * Upgraded to Standards-Version: 3.5.6.
+ * Added webcscope in /usr/share/doc/cscope/contrib.
+ * Installed xcscope, an (X)Emacs interface for cscope.
+
+ -- Anthony Fok <foka@debian.org> Mon, 12 Nov 2001 01:48:57 +0800
+
+cscope (15.1-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Anthony Fok <foka@debian.org> Sat, 2 Dec 2000 03:40:32 -0700
+
+cscope (15.0bl2-1) unstable; urgency=low
+
+ * New upstream release. According to the upstream maintainer,
+ it should be a lot more stable than 13.0x even though it's still
+ in a pre-alpha stage,
+ * Added contrib files in /usr/share/doc/cscope/contrib.
+
+ -- Anthony Fok <foka@debian.org> Wed, 17 May 2000 13:51:19 -0600
+
+cscope (13.0.0.20000419-2) unstable; urgency=low
+
+ * [debian/control]:
+ - Now Suggests: cbrowser, a great Tcl-based front-end to cscope.
+ - Added "Open-Sourced by" and "Maintainer" to the package description.
+
+ -- Anthony Fok <foka@debian.org> Wed, 17 May 2000 02:02:26 -0600
+
+cscope (13.0.0.20000419-1) unstable; urgency=low
+
+ * New upstream post-13.0 CVS updates as of 2000-04-19.
+ * [common/library.h]: Added parentheses around `strcpy', `strncpy',
+ `strpbrk' and `strchr' since they are defined as macros in
+ glibc2, and cscope would not compile with CFLAGS="-O2" unless
+ things like `char *strcpy()' is changed to `char *(strcpy)()'.
+ * [debian/rules]: Uses CFLAGS="-O2 -g -Wall".
+ * [debian/control]: Added Build-Depends line.
+ * [debian/copyright]: Added the address to cscope's home page.
+
+ -- Anthony Fok <foka@debian.org> Thu, 20 Apr 2000 13:15:18 -0600
+
+cscope (13.0-1) unstable; urgency=low
+
+ * Initial Release.
+ * [common/main.c]: Changed TMPDIR from "/usr/tmp" to "/tmp" as per FHS,
+ otherwise cscope simply doesn't work. /usr/tmp does not exist
+ on Debian.
+
+ -- Anthony Fok <foka@debian.org> Wed, 19 Apr 2000 15:34:00 -0600
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..175a823
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,29 @@
+Source: cscope
+Section: devel
+Priority: optional
+Maintainer: Tobias Klauser <tklauser@access.unizh.ch>
+Build-Depends: debhelper (>= 4), dpatch, autotools-dev, bison, flex, libncurses5-dev
+Standards-Version: 3.7.2
+
+Package: cscope
+Architecture: any
+Depends: ${shlibs:Depends}
+Suggests: cbrowser
+Description: Interactively examine a C program source
+ Cscope is an interactive text screen based source browsing tool.
+ Although it is primarily designed to search C code (including lex
+ and yacc files), it can also be used for C++ code.
+ .
+ Using cscope, you can easily search for where symbols are used and
+ defined. Cscope is designed to answer questions like:
+ .
+ Where is this variable used?
+ What is the value of this preprocessor symbol?
+ Where is this function in the source files?
+ What functions call this function?
+ What functions are called by this function?
+ Where does the message "out of space" come from?
+ Where is this source file in the directory structure?
+ What files include this header file?
+ .
+ Homepage: <http://cscope.sourceforge.net/>
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..ca8bbfd
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,93 @@
+This package was first debianized by Anthony Fok <foka@debian.org> on
+Wed, 19 Apr 2000 13:23:08 -0600.
+
+It was downloaded from <http://cscope.sourceforge.net/>
+
+Upstream Authors:
+ Joe Steffen - Creator of Cscope
+ Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> - Maintainer
+ Petr Sorfa <petr@users.sourceforge.net> - Initial OpenSource Maintainer
+
+ Courtesy of:
+ The Santa Cruz Operation, Inc. (SCO) who released cscope
+ as Open Source software in April 2000.
+
+Copyright: (a BSD-style license, from the file COPYING)
+
+ Copyright (c) 1998-2000, The Santa Cruz Operation
+ 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 name of The Santa Cruz Operation 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 REGENTS 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.
+
+Copyright: (webcscope)
+ Copyright (C) 2001, Ragho Mahalingam <ragho@mahalingam.com>
+ Copyright (C) 1999, Dmitry Obukhov, <dso@usa.net>
+
+ This program 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General Public
+License can be found in `/usr/share/common-licenses/GPL'.
+
+Copyright: (cgi-lib.pl, part of webcscope)
+ Copyright (C) 1993-1999 Steven E. Brenner
+
+ Permission granted to use and modify this library so long as the
+ copyright above is maintained, modifications are documented, and
+ credit is given for any use of the library.
+
+Copyright: (xcscope and cscope-indexer)
+ Copyright (C) 2000, Darryl Okahata <darrylo@sonic.net>
+
+ This program 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General Public
+License can be found in `/usr/share/common-licenses/GPL'.
diff --git a/debian/cscope-indexer.1 b/debian/cscope-indexer.1
new file mode 100644
index 0000000..5e0f296
--- /dev/null
+++ b/debian/cscope-indexer.1
@@ -0,0 +1,61 @@
+.TH cscope-indexer 1 "30. December 2002" "Script to index files for cscope"
+.SH NAME
+cscope-indexer \- Script to index files for cscope
+
+.SH SYNOPSIS
+.B cscope-indexer [\fI-v\fR] [\fI-f database_file\fR] [\fI-i list_file\fR]
+[\fI-l\fR] [\fI-r\fR]
+
+.SH DESCRIPTION
+This script generates a list of files to index
+(cscope.out), which is then (optionally) used to
+generate a cscope database. You can use this script
+to just build a list of files, or it can be used to
+build a list and database. This script is not used to
+just build a database (skipping the list of files
+step), as this can be simply done by just calling
+"cscope -b".
+
+Normally, cscope will do its own indexing, but this
+script can be used to force indexing. This is useful
+if you need to recurse into subdirectories, or have
+many files to index (you can run this script from a
+cron job, during the night). It is especially useful
+for large projects, which can contstantly have source
+files added and deleted; by using this script, the
+changing sources files are automatically handled.
+
+Currently, any paths containing "/CVS/" or "/RCS/" are
+stripped out (ignored).
+
+.SH OPTIONS
+.TP
+.B \-f database_file
+Specifies the cscope database file (default: cscope.out).
+
+.TP
+.B \-i list_file
+Specifies the name of the file into which the list of files
+to index is placed (default: cscope.files).
+
+.TP
+.B \-l
+Suppress the generation/updating of the cscope database
+file. Only a list of files is generated.
+
+.TP
+.B \-r
+Recurse into subdirectories to locate files to index.
+Without this option, only the current directory is
+searched.
+
+.TP
+.B \-v
+Be verbose. Output simple progress messages.
+
+.SH "SEE ALSO"
+.BR cscope (1)
+
+.SH AUTHOR
+This manual page was written for the Debian GNU/Linux system by Robert Lemmen
+<robertle@semistable.com> (but may be used by others, of course)
diff --git a/debian/emacsen-startup b/debian/emacsen-startup
new file mode 100644
index 0000000..5de02b7
--- /dev/null
+++ b/debian/emacsen-startup
@@ -0,0 +1 @@
+(require 'xcscope)
diff --git a/debian/ocs.1 b/debian/ocs.1
new file mode 100644
index 0000000..450fea1
--- /dev/null
+++ b/debian/ocs.1
@@ -0,0 +1,62 @@
+.\"
+.\" This document is free to modify and distribute.
+.\"
+.TH ocs 1 "June 2001" "The Debian Project"
+
+.SH NAME
+ocs \- creates and maintains the database for cscope on a recursive directory set
+.SH SYNOPSIS
+.B ocs
+[-x] [-f] [-q] [-u]
+.br
+
+.SH DESCRIPTION
+This manual page briefly documents
+.B ocs
+, a shell script wrapper that automates the creation and maintainence of a
+.BR cscope(1)
+database on a recursive set of directories. Under normal circumstances,
+.B ocs
+generates a cscope database on a recursive group of directories starting from the current working directory, before launching
+.BR cscope(1)
+in interactive mode.
+.br
+
+.SH OPTIONS
+.B
+.IP -x
+Enable debugging.
+.br
+.B
+.IP -f
+Force. Do not ask about regenerating 'TMP' lists (lists generated by
+.B ocs
+), just do it; Allow the regeneration of 'CSD' (lists generated by
+.BR cscope(1)
+) lists.
+.br
+.B
+.IP -q
+Tell cscope to build a fast reverse index. Database disk space usage is doubled, but searching speed is increased.
+.br
+.B
+.IP -u
+Request that the database be updated or regenerated.
+.br
+.SH FILES
+.IP ./cscope.rc
+If this is an executable shell script, it will be included in the body of
+.B ocs
+in order to override intenal filenames and other options. See the comments at the top of
+.B /usr/bin/ocs
+for more information.
+.SH BUGS
+None noted.
+.SH SEE ALSO
+.BR cscope(1),
+.BR /usr/bin/ocs.
+.SH AUTHORS
+.br
+This manpage originally prepared by
+.B Nick Rusnov
+<nick@grawk.net> for the Debian Project.
diff --git a/debian/patches/00list b/debian/patches/00list
new file mode 100644
index 0000000..759b17a
--- /dev/null
+++ b/debian/patches/00list
@@ -0,0 +1 @@
+01-fix-resize-crash-inside-vim
diff --git a/debian/patches/01-fix-resize-crash-inside-vim.dpatch b/debian/patches/01-fix-resize-crash-inside-vim.dpatch
new file mode 100755
index 0000000..e2fe9d2
--- /dev/null
+++ b/debian/patches/01-fix-resize-crash-inside-vim.dpatch
@@ -0,0 +1,55 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 01-fix-resize-crash-inside-vim.dpatch taken from upstream BTS
+##
+## DP: Fixes a crash on resize when used inside vim
+## DP: (Closes: #374994)
+
+diff -urpN cscope-15.6.orig/src/main.c cscope-15.6/src/main.c
+--- cscope-15.6.orig/src/main.c 2006-10-21 14:42:04.000000000 +0200
++++ cscope-15.6/src/main.c 2006-10-21 14:44:50.000000000 +0200
+@@ -64,7 +64,7 @@
+ #define DFLT_INCDIR "/usr/include"
+ #endif
+
+-static char const rcsid[] = "$Id: main.c,v 1.41 2006/08/20 15:00:34 broeker Exp $";
++static char const rcsid[] = "$Id: main.c,v 1.42 2006/10/10 11:42:17 nhorman Exp $";
+
+ /* note: these digraph character frequencies were calculated from possible
+ printable digraphs in the cross-reference for the C compiler */
+@@ -128,7 +128,8 @@ sigwinch_handler(int sig, siginfo_t *inf
+ (void) sig;
+ (void) info;
+ (void) unused;
+- ungetch(KEY_RESIZE);
++ if(incurses == YES)
++ ungetch(KEY_RESIZE);
+ }
+ #endif
+
+@@ -153,12 +154,6 @@ main(int argc, char **argv)
+ yyout = stdout;
+ /* save the command name for messages */
+ argv0 = argv[0];
+-#if defined(KEY_RESIZE) && !defined(__DJGPP__)
+- winch_action.sa_sigaction = sigwinch_handler;
+- sigemptyset(&winch_action.sa_mask);
+- winch_action.sa_flags = SA_SIGINFO;
+- sigaction(SIGWINCH,&winch_action,NULL);
+-#endif
+ /* set the options */
+ while (--argc > 0 && (*++argv)[0] == '-') {
+ /* HBB 20030814: add GNU-style --help and --version options */
+@@ -403,6 +398,13 @@ cscope: Could not create private temp di
+ signal(SIGINT, SIG_IGN); /* ignore interrupts */
+ signal(SIGPIPE, SIG_IGN);/* | command can cause pipe signal */
+
++#if defined(KEY_RESIZE) && !defined(__DJGPP__)
++ winch_action.sa_sigaction = sigwinch_handler;
++ sigemptyset(&winch_action.sa_mask);
++ winch_action.sa_flags = SA_SIGINFO;
++ sigaction(SIGWINCH,&winch_action,NULL);
++#endif
++
+ /* initialize the curses display package */
+ initscr(); /* initialize the screen */
+ entercurses();
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..969ccc2
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,92 @@
+#!/usr/bin/make -f
+
+include /usr/share/dpatch/dpatch.make
+
+DEST = $(CURDIR)/debian/cscope
+
+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
+
+config.status: patch-stamp configure
+ dh_testdir
+ CFLAGS="$(CFLAGS) -Wl,-z,defs" ./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
+
+ $(MAKE)
+
+ touch build-stamp
+
+clean: unpatch
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+
+ -$(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 usr/share/emacs/site-lisp
+
+ $(MAKE) install DESTDIR=$(DEST)
+
+ # Install xcscope
+ install -m755 -p contrib/xcscope/cscope-indexer $(DEST)/usr/bin/
+ install -m644 -p contrib/xcscope/xcscope.el $(DEST)/usr/share/emacs/site-lisp/
+
+binary-indep: build install
+# We have nothing to do by default.
+
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installdocs AUTHORS NEWS README TODO
+ dh_installman debian/ocs.1 debian/cscope-indexer.1
+ install -d $(DEST)/usr/share/doc/cscope/contrib/webcscope
+ cp -av contrib/README $(DEST)/usr/share/doc/cscope/contrib
+ cp -av contrib/webcscope/cgi-lib.pl contrib/webcscope/cscope \
+ contrib/webcscope/hilite.c contrib/webcscope/icons \
+ contrib/webcscope/INSTALL contrib/webcscope/TODO \
+ $(DEST)/usr/share/doc/cscope/contrib/webcscope
+ # Prevent CVS metadata from being installed
+ find $(DEST)/usr/share/doc/cscope/contrib/webcscope -type d -name CVS | xargs rm -rf
+ dh_installmenu
+ dh_installemacsen
+ dh_installchangelogs ChangeLog
+ dh_strip
+ dh_compress
+ dh_fixperms
+ 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/debian/watch b/debian/watch
new file mode 100644
index 0000000..17393d0
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://sf.net/cscope/cscope-(.*)\.tar\.gz