[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFS: tinycalc



On Tue, Apr 19, 2011 at 10:51:41PM +0530, Neha Bhende wrote:
> Dear mentors,
> 
> I am looking for a sponsor for my package "tinycalc".
> 
> * Package name    : tinycalc
>   Version         : 0.1-1
>   Upstream Author : Rocco Folino <lordzen@autilsici.org>
> * URL             : http://tinycalc.sourceforge.net
> * License         : GPL
>   Section         : utils
> 
> It builds these binary packages:
> tinycalc   - command line calculator for developers

Hi,

Thanks for packaging this - it looks like a simple, useful tool!

What do you think about the attached simple patches that try to address
various nits, some in the packaging, some in the upstream program?
Except for the Standards-Version bump, the watch file and the
description fixes, all the rest are suggestions rather than mandatory
fixes - they are all things that I'd do for my own Debian packages, but
of course it's up to you whether you want to do things that way or not
:)

> The package appears to be lintian clean.

That's a bit doubtful, esp. in light of one of the patches that
I've sent you :)  Which version of Lintian did you check with,
and what Lintian flags - or is that just an artifact from
the mentors.d.n template? :) (for the record, I use
"lintian -IiE --pedantic" and usually try to pay attention even to
the pedantic-level messages)

A couple of further suggestions:
- if you use some kind of version control system (Git, Subversion, CVS,
  etc.) for the Debian packaging, it'd be a good idea to note that in
  the debian/control file - add the Vcs-* headers to the source package
- is there really a need for the "extra" priority?  IMHO this package
  deserves "optional" :)
- you might want to let the upstream author know that it's not always a
  good idea to leave the .svn/ directories in the release tarball :)

G'luck,
Peter

-- 
Peter Pentchev	roam@ringlet.net roam@FreeBSD.org peter@packetscale.com
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This sentence contradicts itself - or rather - well, no, actually it doesn't!
From d468004565dcd0d45731a306d8229f6f9d543662 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 12:43:11 +0300
Subject: [PATCH 01/12] Fix some unusual spacing :)

---
 debian/control |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 39785c3..03b0fae 100644
--- a/debian/control
+++ b/debian/control
@@ -4,12 +4,12 @@ Priority: extra
 Maintainer: Neha Bhende <neha.bhende10@gmail.com>
 Build-Depends: debhelper (>= 7), autotools-dev
 Standards-Version: 3.8.4
-Homepage:  http://tinycalc.sourceforge.net
+Homepage: http://tinycalc.sourceforge.net
 
 Package: tinycalc
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: command line calculator for developers
- Tiny Calculator is a command line calculator. It can resolve a 
- complex expression mixing decimal, esadecimal an binary number. 
+ Tiny Calculator is a command line calculator. It can resolve a
+ complex expression mixing decimal, esadecimal an binary number.
  The result is automatic converted in decimal, esadecimal ad binary format.
-- 
1.7.4.1

From 3e6bd80fb816b5692c2b3bb1ab968acf2a97516d Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 12:51:23 +0300
Subject: [PATCH 02/12] Bump Standards-Version to 3.9.2 with no changes.

---
 debian/control |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index 03b0fae..dca0759 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: utils
 Priority: extra
 Maintainer: Neha Bhende <neha.bhende10@gmail.com>
 Build-Depends: debhelper (>= 7), autotools-dev
-Standards-Version: 3.8.4
+Standards-Version: 3.9.2
 Homepage: http://tinycalc.sourceforge.net
 
 Package: tinycalc
-- 
1.7.4.1

From f0677657c0a7fd45ba45323f19a2d2f34e54f23a Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 12:53:14 +0300
Subject: [PATCH 03/12] Add a watch file using the Debian sf.net redirector.

---
 debian/watch |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
 create mode 100644 debian/watch

diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..31f7584
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://sf.net/tinycalc/ tinycalc-([\d.]+)\.tar\.gz
-- 
1.7.4.1

From 366258a85c178dbd39cb22fb3d642010a3f27b85 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 13:38:20 +0300
Subject: [PATCH 04/12] Fix some typographical and grammatical errors in the package description.

---
 debian/control |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/debian/control b/debian/control
index dca0759..68c699b 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,8 @@ Homepage: http://tinycalc.sourceforge.net
 Package: tinycalc
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: command line calculator for developers
- Tiny Calculator is a command line calculator. It can resolve a
- complex expression mixing decimal, esadecimal an binary number.
- The result is automatic converted in decimal, esadecimal ad binary format.
+Description: command-line calculator for developers
+ Tiny Calculator is a command-line calculator. It can resolve a
+ complex expression mixing decimal, esadecimal and binary numbers.
+ The result is automatically converted into decimal, esadecimal and
+ binary format.
-- 
1.7.4.1

From 80d6b34656cc2844d53011be8df3ace7251c424b Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 13:47:42 +0300
Subject: [PATCH 05/12] Convert the copyright file to the DEP 5 candidate format.

---
 debian/copyright |   46 ++++++++++++++++++++--------------------------
 1 files changed, 20 insertions(+), 26 deletions(-)

diff --git a/debian/copyright b/debian/copyright
index c213395..4db62a4 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,26 +1,20 @@
-This work was packaged for Debian by:
-
-    Neha Bhende <neha.bhende10@gmail.com> on Tue, 19 Apr 2011 12:22:23 +0530
-
-It was downloaded from http://tinycalc.sourceforge.net
-
-Upstream Author(s):
-
-     Rocco Folino <lordzen@autistici.org>
-    
-
-Copyright:
-
-    <Copyright (C) 2008-2009 Rocco Folino>
-   
-
-License:
-
-    GPL
-
-The Debian packaging is:
-
-    Copyright (C) 2011 Neha Bhende <neha.bhende10@gmail.com>
-
-and is licensed under the GPL version 3, 
-see `/usr/share/common-licenses/GPL-3'.
+Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=174
+Upstream-Name: tinycalc
+Upstream-Contact: Rocco Folino <lordzen@autistici.org>
+Source: http://tinycalc.sourceforge.net/
+
+Files *
+Copyright: 2008-2009 LordZen
+License: GPL-3+
+
+Files: debian/*
+Copyright: 2011 Neha Bhende <neha.bhende10@gmail.com>
+License: GPL-3+
+
+License: GPL-3+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License; either version 3 of the License,
+ or (at your option) any later version.
+ .
+ On Debian systems, the full text of the GNU General Public License version 3
+ can be found in `/usr/share/common-licenses/GPL-3'.
-- 
1.7.4.1

From 58684bc2839c79cf4427919a36400fd2ddcf7380 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 13:55:24 +0300
Subject: [PATCH 06/12] Fix some typographical and grammatical errors in the manual page.

---
 debian/patches/01-manpage-typos.patch |   40 +++++++++++++++++++++++++++++++++
 debian/patches/series                 |    1 +
 2 files changed, 41 insertions(+), 0 deletions(-)
 create mode 100644 debian/patches/01-manpage-typos.patch
 create mode 100644 debian/patches/series

diff --git a/debian/patches/01-manpage-typos.patch b/debian/patches/01-manpage-typos.patch
new file mode 100644
index 0000000..b3f5f25
--- /dev/null
+++ b/debian/patches/01-manpage-typos.patch
@@ -0,0 +1,40 @@
+Description: Fix some typographical and grammatical errors.
+Forwarded: no
+Author: Peter Pentchev <roam@ringlet.net>
+Last-Update: 2011-04-20
+
+Index: b/docs/tinycalc.1
+===================================================================
+--- a/docs/tinycalc.1
++++ b/docs/tinycalc.1
+@@ -2,17 +2,17 @@
+ .\"
+ .TH "TINYCALC" "1" "Tiny Calculator" "" "Tiny Calculator"
+ .SH NAME
+-tinycalc \- command line calculator
++tinycalc \- command-line calculator
+ .SH SYNOPSIS
+ .B tinycalc 
+ [\fIEXPRESSION\fR]
+ .SH DESCRIPTION
+ .PP
+-Tiny Calculator is a command line calculator.
++Tiny Calculator is a command-line calculator.
+ .br
+-It can resolve a complex expression mixing decimal, esadecimal and binary number.
++It can resolve a complex expression mixing decimal, esadecimal and binary numbers.
+ .br
+-The result is automatic converted in decimal, esadecimal ad binary format.
++The result is automatically converted into decimal, esadecimal and binary format.
+ .SH EXPRESSION SPECIFICATION
+ .PP
+ The format of an expression must follow this grammar:
+@@ -53,7 +53,7 @@
+ .B tinycalc 200
+ .SH BUGS
+ .PP
+-Please send bug-report, patches or suggestions to <lordzen@autistici.org>
++Please send bug reports, patches or suggestions to <lordzen@autistici.org>
+ 
+ .SH AUTHOR
+ Rocco Folino (LordZen) <lordzen@autistici.org>
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..52f9159
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+01-manpage-typos.patch
-- 
1.7.4.1

From 9f36f0847157df70bfd1ba9cfe19eda9cbd9bade Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 14:08:35 +0300
Subject: [PATCH 07/12] Use dpkg-buildflags to obtain the default CFLAGS, CPPFLAGS and LDFLAGS.

---
 debian/control |    2 +-
 debian/rules   |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index 68c699b..e42cba7 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: tinycalc
 Section: utils
 Priority: extra
 Maintainer: Neha Bhende <neha.bhende10@gmail.com>
-Build-Depends: debhelper (>= 7), autotools-dev
+Build-Depends: debhelper (>= 7), autotools-dev, dpkg-dev (>= 1.15.7~)
 Standards-Version: 3.9.2
 Homepage: http://tinycalc.sourceforge.net
 
diff --git a/debian/rules b/debian/rules
index 917d9bf..2d910d5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,5 +9,11 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+CFLAGS:=	$(shell dpkg-buildflags --get CFLAGS)
+CPPFLAGS:=	$(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS:=	$(shell dpkg-buildflags --get LDFLAGS)
+
+export CFLAGS CPPFLAGS LDFLAGS
+
 %:
 	dh  $@
-- 
1.7.4.1

From 60ec9a9e2343c2f02bc21f5e1d1cffcd064cdc48 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 14:14:53 +0300
Subject: [PATCH 08/12] Build with -Werror if the "werror" build option is specified.

---
 debian/patches/02-warnings.patch |   41 ++++++++++++++++++++++++++++++++++++++
 debian/patches/series            |    1 +
 debian/rules                     |    4 +++
 3 files changed, 46 insertions(+), 0 deletions(-)
 create mode 100644 debian/patches/02-warnings.patch

diff --git a/debian/patches/02-warnings.patch b/debian/patches/02-warnings.patch
new file mode 100644
index 0000000..cd06106
--- /dev/null
+++ b/debian/patches/02-warnings.patch
@@ -0,0 +1,41 @@
+Description: Fix the configure test for pow(3).
+Forwarded: no
+Author: Peter Pentchev <roam@ringlet.net>
+Last-Update: 2011-04-20
+
+Index: b/configure
+===================================================================
+--- a/configure
++++ b/configure
+@@ -3712,11 +3712,11 @@
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char pow ();
++double pow (double, double);
+ int
+ main ()
+ {
+-return pow ();
++return pow (2, 3);
+   ;
+   return 0;
+ }
+@@ -4827,7 +4827,7 @@
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char $ac_func ();
++double $ac_func (double, double);
+ /* The GNU C library defines this for functions which it implements
+     to always fail with ENOSYS.  Some functions are actually named
+     something starting with __ and the normal name is an alias.  */
+@@ -4838,7 +4838,7 @@
+ int
+ main ()
+ {
+-return $ac_func ();
++return $ac_func (2, 3);
+   ;
+   return 0;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 52f9159..2e9440c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 01-manpage-typos.patch
+02-warnings.patch
diff --git a/debian/rules b/debian/rules
index 2d910d5..9d77396 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,6 +13,10 @@ CFLAGS:=	$(shell dpkg-buildflags --get CFLAGS)
 CPPFLAGS:=	$(shell dpkg-buildflags --get CPPFLAGS)
 LDFLAGS:=	$(shell dpkg-buildflags --get LDFLAGS)
 
+ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
+	CFLAGS+=	-Werror
+endif
+
 export CFLAGS CPPFLAGS LDFLAGS
 
 %:
-- 
1.7.4.1

From 876173694457b2ac8ff56d7443cb6df9b23010aa Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 14:30:52 +0300
Subject: [PATCH 09/12] Add the 02-warnings patch and build with more compiler warning flags.

---
 debian/patches/02-warnings.patch |   65 +++++++++++++++++++++++++++++++++++++-
 debian/rules                     |    4 ++
 2 files changed, 68 insertions(+), 1 deletions(-)

diff --git a/debian/patches/02-warnings.patch b/debian/patches/02-warnings.patch
index cd06106..dc6fdf7 100644
--- a/debian/patches/02-warnings.patch
+++ b/debian/patches/02-warnings.patch
@@ -1,4 +1,8 @@
-Description: Fix the configure test for pow(3).
+Description: Fix some compiler warnings.
+ - fix the configure test for pow(3)
+ - mark debug()'s parameter as unused
+ - fix a signed/unsigned warning in dec2bin()
+ - constify a couple of strings
 Forwarded: no
 Author: Peter Pentchev <roam@ringlet.net>
 Last-Update: 2011-04-20
@@ -39,3 +43,62 @@ Index: b/configure
    ;
    return 0;
  }
+Index: b/tinycalc.c
+===================================================================
+--- a/tinycalc.c
++++ b/tinycalc.c
+@@ -27,6 +27,14 @@
+ #include "convert.h"
+ #include "parser.h"
+ 
++#ifndef __unused
++#ifdef __GNUC__
++#define __unused __attribute__((unused))
++#else  /* __GNUC__ */
++#define __unused
++#endif /* __GNUC__ */
++#endif /* __unused */
++
+ void usage(char *progname)
+ {
+   printf("\n:: Tiny Calculator %s ::\n",PACKAGE_VERSION);
+@@ -36,14 +44,14 @@
+   exit(0);
+ }
+ 
+-void show_debug(char *s)
++void show_debug(const char *s __unused)
+ {
+ #ifdef DEBUG
+   printf("[*] DEBUG: %s\n",s);
+ #endif
+ }
+ 
+-void show_error(char *s)
++void show_error(const char *s)
+ {
+   printf("\n[**] FATAL: %s\n\n",s);
+   exit(-1);
+@@ -153,7 +161,7 @@
+ 
+ void dec2bin(unsigned long num,char *bin)
+ {
+-  int i = 0;
++  unsigned i = 0;
+   char buffer[MAX_BIT_BIN+1];
+ 
+   //pointer to the end of buffer
+Index: b/debug.h
+===================================================================
+--- a/debug.h
++++ b/debug.h
+@@ -19,7 +19,7 @@
+ #ifndef DEBUG_H
+ #define DEBUG_H
+ 
+-void show_debug(char *s);
+-void show_error(char *s);
++void show_debug(const char *s);
++void show_error(const char *s);
+ 
+ #endif	//DEBUG_H
diff --git a/debian/rules b/debian/rules
index 9d77396..61aaec9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,6 +13,10 @@ CFLAGS:=	$(shell dpkg-buildflags --get CFLAGS)
 CPPFLAGS:=	$(shell dpkg-buildflags --get CPPFLAGS)
 LDFLAGS:=	$(shell dpkg-buildflags --get LDFLAGS)
 
+CFLAGS+=	-pipe -Wall -W -std=c99 -pedantic -Wbad-function-cast \
+		-Wcast-align -Wcast-qual -Wchar-subscripts -Winline \
+		-Wnested-externs -Wpointer-arith \
+		-Wredundant-decls -Wshadow -Wwrite-strings
 ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
 	CFLAGS+=	-Werror
 endif
-- 
1.7.4.1

From 7b8995106eebe95c9c3dd94667bf60291ed03d39 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 14:35:57 +0300
Subject: [PATCH 10/12] Harden the build unless the "nohardening" option is specified.

---
 debian/control |    2 +-
 debian/rules   |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index e42cba7..c115509 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: tinycalc
 Section: utils
 Priority: extra
 Maintainer: Neha Bhende <neha.bhende10@gmail.com>
-Build-Depends: debhelper (>= 7), autotools-dev, dpkg-dev (>= 1.15.7~)
+Build-Depends: debhelper (>= 7), autotools-dev, dpkg-dev (>= 1.15.7~), hardening-includes
 Standards-Version: 3.9.2
 Homepage: http://tinycalc.sourceforge.net
 
diff --git a/debian/rules b/debian/rules
index 61aaec9..c6466c2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -21,6 +21,12 @@ ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
 	CFLAGS+=	-Werror
 endif
 
+include /usr/share/hardening-includes/hardening.make
+ifeq (,$(filter nohardening,$(DEB_BUILD_OPTIONS)))
+CFLAGS+=	$(HARDENING_CFLAGS)
+LDFLAGS+=	$(HARDENING_LDFLAGS)
+endif
+
 export CFLAGS CPPFLAGS LDFLAGS
 
 %:
-- 
1.7.4.1

From 20ee25634eed479f80fa00c21f3e014bb199d72a Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 14:37:52 +0300
Subject: [PATCH 11/12] Bump the debhelper compat level to 8 with no changes.

---
 debian/compat  |    2 +-
 debian/control |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/compat b/debian/compat
index 7f8f011..45a4fb7 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+8
diff --git a/debian/control b/debian/control
index c115509..bb29a3b 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: tinycalc
 Section: utils
 Priority: extra
 Maintainer: Neha Bhende <neha.bhende10@gmail.com>
-Build-Depends: debhelper (>= 7), autotools-dev, dpkg-dev (>= 1.15.7~), hardening-includes
+Build-Depends: debhelper (>= 8), autotools-dev, dpkg-dev (>= 1.15.7~), hardening-includes
 Standards-Version: 3.9.2
 Homepage: http://tinycalc.sourceforge.net
 
-- 
1.7.4.1

From 23b6fdfa0d7e99572f0f51787721c8dd3b3465c6 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 20 Apr 2011 14:47:48 +0300
Subject: [PATCH 12/12] Remove the unneeded dependency on autotools-dev.

---
 debian/control |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index bb29a3b..211e40d 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: tinycalc
 Section: utils
 Priority: extra
 Maintainer: Neha Bhende <neha.bhende10@gmail.com>
-Build-Depends: debhelper (>= 8), autotools-dev, dpkg-dev (>= 1.15.7~), hardening-includes
+Build-Depends: debhelper (>= 8), dpkg-dev (>= 1.15.7~), hardening-includes
 Standards-Version: 3.9.2
 Homepage: http://tinycalc.sourceforge.net
 
-- 
1.7.4.1

Attachment: signature.asc
Description: Digital signature


Reply to: