From 898ff63f2f6c35ae5fc8ec18bc227ef007810379 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Fri, 19 Feb 2021 22:08:59 -0800 Subject: [PATCH 1/4] fix: update crufty version header, add release.sh and update readme Signed-off-by: Stephen L Arnold --- README.md | 2 +- cccc/cccc_ver.h | 6 +++--- release.sh | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100755 release.sh diff --git a/README.md b/README.md index 3653bde..e87bd28 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ README for CCCC version 3.1.6 ============================= [![Github CI](https://github.com/sarnold/cccc/actions/workflows/ci.yml/badge.svg)](https://github.com/sarnold/cccc/actions/workflows/ci.yml) -![GitHub tag (latest SemVer pre-release)](https://img.shields.io/github/v/tag/sarnold/cccc?include_prereleases&style=plastic) +![GitHub tag (latest SemVer pre-release)](https://img.shields.io/github/v/tag/sarnold/cccc?include_prereleases) [![CCCC License](https://img.shields.io/badge/license-GPL2-green.svg?dummy)](https://github.com/sarnold/cccc/blob/master/cccc/COPYING) [![Code Climate](https://codeclimate.com/github/sarnold/cccc/badges/gpa.svg)](https://codeclimate.com/github/sarnold/cccc) [![Github Issues](https://img.shields.io/github/issues/sarnold/cccc)](https://github.com/sarnold/cccc/issues?q=is:issue+is:open) diff --git a/cccc/cccc_ver.h b/cccc/cccc_ver.h index ff4d87a..367dc40 100644 --- a/cccc/cccc_ver.h +++ b/cccc/cccc_ver.h @@ -1,3 +1,3 @@ -// This version built on at Fri 01/06/2006 -#define CCCC_VERSION 3.1.1 -#define CCCC_VERSION_STRING "3.1.1" +// This version built on kepler at 20210219-220832 +#define CCCC_VERSION 3.1.6 +#define CCCC_VERSION_STRING "3.1.6" diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..784118a --- /dev/null +++ b/release.sh @@ -0,0 +1,24 @@ +#! /usr/bin/env bash +# release.sh +# set the release version in the header file before building +# + +set -e + +PATH=/usr/bin:/bin:/usr/sbin:/sbin +export LC_ALL=C + +DATE=$(date +%Y%m%d-%H%M%S) +UNAME_N=$(uname -n) + +if [[ $1 == "--version" ]]; then + RELEASE_VERSION="${2}" +elif [[ -n $VERSION ]]; then + RELEASE_VERSION="${VERSION}" +else + RELEASE_VERSION=$(git describe --tags) +fi + +echo "// This version built on ${UNAME_N} at ${DATE}" > cccc/cccc_ver.h +echo "#define CCCC_VERSION ${RELEASE_VERSION}" >> cccc/cccc_ver.h +echo "#define CCCC_VERSION_STRING \"${RELEASE_VERSION}\"" >> cccc/cccc_ver.h From 62c80748f6c07fbc653d6048c6970a625ec3bf79 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sat, 20 Feb 2021 19:36:41 -0800 Subject: [PATCH 2/4] fix: use correct readme filename in rules.mk Signed-off-by: Stephen L Arnold --- cccc/rules.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cccc/rules.mak b/cccc/rules.mak index 638cc07..3fee067 100644 --- a/cccc/rules.mak +++ b/cccc/rules.mak @@ -89,7 +89,7 @@ USR_H = cccc.h cccc_tok.h cccc_met.h cccc_utl.h \ cccc_opt.h ## documentation -USR_DOC = readme.txt cccc_ug.htm +USR_DOC = README.md cccc_ug.htm ## all source files USR_SOURCE = makefile cccc.mak cccc.dsw \ From d93e66e76cd8cfb9911c22cbfa4b891bdf7e2852 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sat, 20 Feb 2021 19:38:49 -0800 Subject: [PATCH 3/4] new: pkg: add debian packaging dir Signed-off-by: Stephen L Arnold --- debian/.git-dpm | 8 +++ debian/cccc.1 | 58 +++++++++++++++ debian/changelog | 168 +++++++++++++++++++++++++++++++++++++++++++ debian/clean | 4 ++ debian/control | 18 +++++ debian/copyright | 30 ++++++++ debian/docs | 1 + debian/install | 1 + debian/manpages | 1 + debian/rules | 43 +++++++++++ debian/source/format | 1 + debian/watch | 3 + 12 files changed, 336 insertions(+) create mode 100644 debian/.git-dpm create mode 100644 debian/cccc.1 create mode 100644 debian/changelog create mode 100644 debian/clean create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100644 debian/install create mode 100644 debian/manpages create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/watch diff --git a/debian/.git-dpm b/debian/.git-dpm new file mode 100644 index 0000000..d275309 --- /dev/null +++ b/debian/.git-dpm @@ -0,0 +1,8 @@ +# see git-dpm(1) from git-dpm package +b0b4e8fd4a71654c41e462670555dc0fc4a55109 +b0b4e8fd4a71654c41e462670555dc0fc4a55109 +ca38c154169eb001b5352a1105b307c35817c88e +ca38c154169eb001b5352a1105b307c35817c88e +cccc_3.1.4.orig.tar.gz +2b39667bf1f6ea6accddd8245cac0e8c19bc28e7 +632007 diff --git a/debian/cccc.1 b/debian/cccc.1 new file mode 100644 index 0000000..9f90c58 --- /dev/null +++ b/debian/cccc.1 @@ -0,0 +1,58 @@ +.TH CCCC 1 +.SH NAME +cccc \- C and C++ Code Counter, a software metrics tool +.SH SYNOPSIS +.B cccc +.RB [ options ] +.I file1.c +\&... +.SH DESCRIPTION +CCCC analyses and reports measurements of source code in C, C++, and Java. +The metrics supported include lines of code, McCabe's Cyclomatic Complexity, +and measures of module fan-out/fan-in. +.PP +CCCC processes the files listed on its command line. +If the filenames include \(oq-\(cq, read a list of files from standard input. +.PP +This program is work in progress and is not well documented. +Please be prepared to refer to the source code for the +meaning of some options. +.SH OPTIONS +.TP +.B \-\-help +Generate this help message. +.TP +\fB\-\-outdir\fP=\fIdname\fP +Directory for generated files (default=.cccc). +.TP +\fB\-\-html_outfile\fP=\fIfname\fP +Name of primary HTML report generated (default=\fIoutdir\fP/cccc.html). +.TP +\fB\-\-db_infile\fP=\fIfname\fP +Preload internal database from named file (default=no initial content). +.TP +\fB\-\-db_outfile\fP=\fIfname\fP +Save internal database to named file (default=\fIoutdir\fP/cccc.db). +.TP +\fB\-\-opt_infile\fP=\fIfname\fP +Load options from named file (default=use compiled-in option values, +refer to cccc_opt.cc for option information). +.TP +\fB\-\-opt_outfile\fP=\fIfname\fP +Save options to named file (default=\fIoutdir\fP/cccc.opt). +.TP +\fB\-\-lang\fP=\fIstring\fP +Use language specified for files specified after this option. +Languages supported are c, c++, ada, and java (default=use language/extension +mapping controlled by options). +.TP +\fB\-\-report_mask\fP=\fIhex\fP +Control report content (refer to ccccmain.cc for mask values). +.TP +\fB\-\-debug_mask\fP=\fIhex\fP +Control debug output content (refer to ccccmain.cc for mask values). +.SH AUTHOR +CCCC was written by Tim Littlefair . +.PP +This manual page was written by Colin Watson +for the Debian system (but may be used by others). diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..5efdd19 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,168 @@ +cccc (1:3.1.6-1ubuntu1) focal; urgency=medium + + * new upstream release + + -- Stephen L Arnold Sat, 20 Feb 2021 13:06:18 -0800 + +cccc (1:3.1.4-12build1) focal; urgency=medium + + * No-change rebuild for libgcc-s1 package name change. + + -- Matthias Klose Sun, 22 Mar 2020 16:35:51 +0100 + +cccc (1:3.1.4-12) unstable; urgency=medium + + [ Ondřej Nový ] + * d/watch: Use https protocol + + [ Colin Watson ] + * Use debhelper-compat instead of debian/compat. + + -- Colin Watson Fri, 23 Aug 2019 14:40:10 +0100 + +cccc (1:3.1.4-11) unstable; urgency=medium + + * Policy version 4.2.1: + - Use HTTPS form of copyright-format URL. + - Set Rules-Requires-Root: no. + * Fix implicit integer cast when parsing filenames (thanks, Erwan Legrand; + LP: #376859). + + -- Colin Watson Fri, 07 Sep 2018 10:35:41 +0100 + +cccc (1:3.1.4-10) unstable; urgency=medium + + * Move VCS to salsa.debian.org. + + -- Colin Watson Sat, 14 Apr 2018 18:44:39 +0100 + +cccc (1:3.1.4-9) unstable; urgency=medium + + * Use HTTPS for Vcs-* URLs. + * Build with all hardening options. + + -- Colin Watson Wed, 27 Jan 2016 10:52:18 +0000 + +cccc (1:3.1.4-8) unstable; urgency=medium + + * Simplify debian/rules using /usr/share/dpkg/buildflags.mk. + * Build with large file support. + * Upgrade to debhelper v9. + * Policy version 3.9.6: no changes required. + + -- Colin Watson Sat, 02 Jan 2016 16:58:05 +0000 + +cccc (1:3.1.4-7) unstable; urgency=medium + + * Update Vcs-Browser URL for alioth cgit. + * Adjust package description and cccc(1) to stop implying that metrics are + direct measures of quality (closes: #643799). + + -- Colin Watson Sat, 27 Sep 2014 23:40:07 +0100 + +cccc (1:3.1.4-6) unstable; urgency=medium + + * Switch to git; add Vcs-* fields. + * Policy version 3.9.5: no changes required. + * Add a reference to /usr/share/common-licenses/GPL-2 to debian/copyright, + and remove outdated Lintian override. + + -- Colin Watson Sun, 19 Jan 2014 12:48:40 +0000 + +cccc (1:3.1.4-5) unstable; urgency=low + + * Adjust debian/watch to remove epoch from Debian version. + + -- Colin Watson Tue, 18 Sep 2012 01:54:52 +0100 + +cccc (1:3.1.4-4) unstable; urgency=low + + * Convert debian/copyright to copyright-format 1.0. + * Use dpkg-buildflags to enable hardening options. + + -- Colin Watson Tue, 26 Jun 2012 01:04:39 +0100 + +cccc (1:3.1.4-3) unstable; urgency=low + + * Avoid dependent base class scope lookups, which no longer work in G++ + 4.7 (closes: #667133). + + -- Colin Watson Wed, 04 Apr 2012 01:42:33 +0100 + +cccc (1:3.1.4-2) unstable; urgency=low + + * Add cross-compiling support. + + -- Colin Watson Wed, 09 Nov 2011 13:01:30 +0000 + +cccc (1:3.1.4-1) unstable; urgency=low + + * New upstream release. + - Released under GPL v2 or later. + * Upgrade to debhelper v7. + * Use ${misc:Depends}. + * Convert to source format 3.0 (quilt). + * All patches are now maintained separately and tagged according to DEP-3. + * Add a Homepage field. + * Add a watch file. + * Switch to machine-readable copyright format (current DEP-5 draft). + + -- Colin Watson Tue, 02 Mar 2010 02:34:31 +0000 + +cccc (3.pre84-2) unstable; urgency=low + + * Fix build with g++ 4.1 (thanks, Martin Michlmayr; closes: #356161). + + -- Colin Watson Mon, 22 May 2006 10:20:03 +0100 + +cccc (3.pre84-1) unstable; urgency=low + + * New upstream release. + - Works around previous prn14 test problems, so I've removed my + temporary hack (closes: #202797). + * Fix various compiler errors when using g++ 4.0 (thanks, Andreas Jochens; + closes: #258560, #315117). + * Upgrade to debhelper v4. + + -- Colin Watson Sun, 7 Aug 2005 15:12:12 +0100 + +cccc (3.pre81-2) unstable; urgency=low + + * Ignore errors from prn14 test for now, following upstream's advice + (downgrades #202797 to normal). + * Use 'diff -u' in tests to get more context. + * Remove test/*.xml in 'debian/rules clean'. + + -- Colin Watson Sat, 23 Aug 2003 04:34:05 +0100 + +cccc (3.pre81-1) unstable; urgency=low + + * New upstream release. May fix test problems on hppa and s390. + + -- Colin Watson Tue, 19 Aug 2003 00:10:40 +0100 + +cccc (3.pre63-3) unstable; urgency=low + + * Compile with -Wno-deprecated. These warnings are currently unimportant + for Debian. + * Set DEBUG=true so that we compile with -g. + * Fix implicit typenames in cccc_tbl.cc and cccc_tbl.h (closes: #196782). + + -- Colin Watson Sun, 13 Jul 2003 14:19:13 +0100 + +cccc (3.pre63-2) unstable; urgency=low + + * Build with g++ 3.2. + * Override bogus lintian error (cccc isn't licensed under the GPL, the + copyright file merely mentions it). + + -- Colin Watson Wed, 8 Jan 2003 20:27:20 +0000 + +cccc (3.pre63-1) unstable; urgency=low + + * Initial release (closes: #130632). + * Build with the Debian pccts package rather than the included pccts. + * Avoid linking statically. + * Add a cccc(1) man page. + + -- Colin Watson Sun, 15 Sep 2002 17:36:19 +0100 diff --git a/debian/clean b/debian/clean new file mode 100644 index 0000000..45a3080 --- /dev/null +++ b/debian/clean @@ -0,0 +1,4 @@ +test/*.db +test/*.html +test/*.xml +test/.cccc/cccc.opt diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..220ae6b --- /dev/null +++ b/debian/control @@ -0,0 +1,18 @@ +Source: cccc +Section: devel +Priority: optional +Maintainer: Colin Watson +Standards-Version: 4.2.1 +Build-Depends: dpkg-dev (>= 1.16.1~), debhelper-compat (= 9), pccts +Homepage: https://github.com/sarnold/cccc +Vcs-Git: https://salsa.debian.org/debian/cccc.git +Vcs-Browser: https://salsa.debian.org/debian/cccc +Rules-Requires-Root: no + +Package: cccc +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: C and C++ Code Counter, a software metrics tool + CCCC analyses and reports measurements of source code in C, C++, and Java. + The metrics supported include lines of code, McCabe's Cyclomatic + Complexity, and measures of module fan-out/fan-in. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ddfdb7a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,30 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: CCCC +Upstream-Contact: Tim Littlefair +Source: http://cccc.sourceforge.net/ + +Files: * +Copyright: 1994-2005, Tim Littlefair +License: GPL-2+ + +Files: debian/* +Copyright: 2002, 2003, 2005, 2006, 2010 Colin Watson +License: GPL-2+ + +License: GPL-2+ + 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 and Debian-based systems, a copy of the GNU General Public + License version 2 is available in /usr/share/common-licenses/GPL-2. diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.md diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..f9d3c60 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +cccc/cccc usr/bin diff --git a/debian/manpages b/debian/manpages new file mode 100644 index 0000000..68e4c13 --- /dev/null +++ b/debian/manpages @@ -0,0 +1 @@ +debian/cccc.1 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..eb407f1 --- /dev/null +++ b/debian/rules @@ -0,0 +1,43 @@ +#! /usr/bin/make -f +%: + dh $@ + +DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) + CROSS := +else + CROSS := CCC=$(DEB_HOST_GNU_TYPE)-g++ LD=$(DEB_HOST_GNU_TYPE)-g++ +endif + +# We have to duplicate a little from the upstream build system. See +# cccc/posixgcc.mak. +export DEB_BUILD_MAINT_OPTIONS := hardening=+all +export DEB_CPPFLAGS_MAINT_APPEND := -D_FILE_OFFSET_BITS=64 +export DEB_CFLAGS_MAINT_APPEND := -Wno-deprecated -Wall +include /usr/share/dpkg/buildflags.mk +CFLAGS := $(CPPFLAGS) $(CFLAGS) +CFLAGS += -c -I/usr/include/pccts -x c++ +buildflags := CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" + +override_dh_auto_build: + $(MAKE) -C cccc -f posixgcc.mak $(buildflags) \ + PCCTS_H=/usr/include/pccts PCCTS_BIN=/usr/bin $(CROSS) + +override_dh_auto_test: +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) + $(MAKE) -C test -f posix.mak +endif + +override_dh_auto_clean: + $(MAKE) -C cccc -f posixgcc.mak clean + -rm cccc/CLexer.h cccc/CParser.h cccc/Ctokens.h cccc/JLexer.h \ + cccc/JParser.h cccc/Jtokens.h cccc/parser.dlg + -rm -rf test/.cccc + +override_dh_auto_install: + # The default 'make install' uses su! + +override_dh_installdocs: + dh_installdocs 'cccc/CCCC User Guide.html' diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..db531f0 --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts=uversionmangle=s/pre/~pre/,dversionmangle=s/^\d+:// \ + https://sf.net/cccc/cccc-(.+)\.tar\.gz From a512295e302a48fdf1c42be3a6e57da96b2420d3 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sat, 20 Feb 2021 19:45:14 -0800 Subject: [PATCH 4/4] fix: doc: update debian man page for xml out Signed-off-by: Stephen L Arnold --- debian/cccc.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/cccc.1 b/debian/cccc.1 index 9f90c58..5d44310 100644 --- a/debian/cccc.1 +++ b/debian/cccc.1 @@ -28,6 +28,9 @@ Directory for generated files (default=.cccc). \fB\-\-html_outfile\fP=\fIfname\fP Name of primary HTML report generated (default=\fIoutdir\fP/cccc.html). .TP +\fB\-\-xml_outfile\fP=\fIfname\fP +Name of primary XML report generated (default=\fIoutdir\fP/cccc.xml). +.TP \fB\-\-db_infile\fP=\fIfname\fP Preload internal database from named file (default=no initial content). .TP