retitle 668028 Re: Bug#668028: [PATCH] jwhois: packaging format 3.0 and 
hardened build flags
thanks

2012-04-17 Paul Dwerryhouse
| 2012-03-03 10:37 Paul Dwerryhouse <p...@dwerryhouse.com.au>:
| | Hi Jari,
| |
| | 2012-03-03 jari.aa...@cante.net wrote:
| | > I had some free time and I've removed dpatch and convert all patches
| | > to the new package to format 3.0 quilt. The changes were quite
| | > straight forward and don't much change the current style of packaging.
| | >
| | > Please let me know how could I best help to upgrade the package. I have
| | > a NMU ready if you are working on other issues needing attention.
| |
| | Cool, thanks for that. I've had some changes to the jwhois package
| | ready to upload for a while, too, but last time I tried to contact my
| | sponsor, I think his mail was bouncing.
| |
| | Do you have upload access? If I were to merge your patches into my
| | latest build, would you be able to upload it?
|
| [Jari Aalto]
| > Could you put your *.dsc (see inside that file what is needed) in a public
| > HTTP and send me a link to *dsc.
| >
| > I'll see what I can do.
|
| Thanks for the patches; I've merged my updates into them and put them
| up here, version 4.0-3:
|
| http://leapster.org/linux/debian/jwhois/

Hi Paul,

I've checked the package. See some more updates in patch below. The major
changes:

    (1) In order to satisfy:

        http://wiki.debian.org/ReleaseGoals/SecurityHardeningBuildFlags

    The debian/rules were migrated to dh(1) syntax, which I'm sure you find,
    quite easy to use. For more information about dh(1), see Debian manual
    pages and:

        http://pinboard.in/u:jariaalto/t:debhelper

    (2) There were some unused patches that I also moved to
    debian/patches/unused in order to make the debian/patches directory clean
    for reviewers.

    (3) Migrate to new debian/copyright format DEP-3
    See http://dep.debian.net/deps/dep3/

Let me know if anything needs adjusting. When you have repackaged, send
message to this by <668...@bugs.debian.org> and I'll try to help you with
the upload.

Thanks,
Jari

>From 1ce0f4bcd62212cd164cb7c01cf66d30ba42eb1b Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Tue, 17 Apr 2012 16:05:13 +0300
Subject: [PATCH] harden-and-misc-updates
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 debian/changelog                                   |   16 ++--
 debian/control                                     |    6 +-
 debian/copyright                                   |   77 +++++++++++++-----
 debian/patches/{sv-man.patch => 20-sv-man.patch}   |    3 +
 .../{30_man_typo.patch => 30-man-typo.patch}       |    0
 .../patches/{40_afrinic.patch => 40-afrinic.patch} |    0
 .../{40_nic.or.kr.patch => 42-nic.or.kr.patch}     |    0
 ...45_info_section.patch => 45-info-section.patch} |    0
 .../patches/{46_afrinic.patch => 46-afrinic.patch} |    0
 .../patches/{47_retval.patch => 47-retval.patch}   |    4 +-
 debian/patches/series                              |   14 ++--
 debian/patches/{ => unused}/48_ggje_nic.patch      |    0
 debian/patches/{ => unused}/49_foglvc_nic.dpatch   |    0
 debian/rules                                       |   85 +++-----------------
 14 files changed, 91 insertions(+), 114 deletions(-)
 rename debian/patches/{sv-man.patch => 20-sv-man.patch} (67%)
 rename debian/patches/{30_man_typo.patch => 30-man-typo.patch} (100%)
 rename debian/patches/{40_afrinic.patch => 40-afrinic.patch} (100%)
 rename debian/patches/{40_nic.or.kr.patch => 42-nic.or.kr.patch} (100%)
 rename debian/patches/{45_info_section.patch => 45-info-section.patch} (100%)
 rename debian/patches/{46_afrinic.patch => 46-afrinic.patch} (100%)
 rename debian/patches/{47_retval.patch => 47-retval.patch} (88%)
 rename debian/patches/{ => unused}/48_ggje_nic.patch (100%)
 rename debian/patches/{ => unused}/49_foglvc_nic.dpatch (100%)

diff --git a/debian/changelog b/debian/changelog
index 93eefc5..01ef697 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,19 +1,19 @@
 jwhois (4.0-3) unstable; urgency=low
 
+  [ Paul Dwerryhouse ]
   * /etc/jwhois.conf: new nics for .gg and .je (noted in Ubuntu bug 339913)
   * /etc/jwhois.conf: new nics for .fo, .gl and .vc
 
- -- Paul Dwerryhouse <p...@dwerryhouse.com.au>  Mon, 16 Apr 2012 16:35:04 +1000
-
-jwhois (4.0-2.1) unstable; urgency=low
-
-  * Non-maintainer upload (Closes: #668028)
-  * Remove deprecated dpatch and upgrade to packaging format "3.0 quilt".
+  [ Jari Aalto <jari.aa...@cante.net> ]
+  * Remove deprecated dpatch and upgrade to packaging format "3.0 quilt"
+    (Closes: #668028)
   * Update to Standards-Version to 3.9.3.1 and debhelper to 9.
-  * Add build-arch and build-indep targets; use dh_prep in rules file.
+  * Migrate to Copyright Format 1.0.
+  * Migrate to dh(1) in debian/rules. Enable all hardened build flags.
+  * Add debian/watch file.
   * Fix package-contains-empty-directory usr/share/jwhois/ (Lintian).
 
- -- Jari Aalto <jari.aa...@cante.net>  Sun, 08 Apr 2012 14:33:43 +0300
+ -- Paul Dwerryhouse <p...@dwerryhouse.com.au>  Mon, 16 Apr 2012 16:35:04 +1000
 
 jwhois (4.0-2) unstable; urgency=low
 
diff --git a/debian/control b/debian/control
index 0abb620..1afe003 100644
--- a/debian/control
+++ b/debian/control
@@ -2,16 +2,16 @@ Source: jwhois
 Section: net
 Priority: optional
 Maintainer: Paul Dwerryhouse <p...@dwerryhouse.com.au>
-Build-Depends: debhelper (>= 9), gettext, libgdbm-dev, texinfo
-Homepage: http://www.gnu.org/software/jwhois/jwhois.html
+Build-Depends: debhelper (>= 9), gettext, libgdbm-dev, texinfo, autotools-dev
 Standards-Version: 3.9.3.1
+Homepage: http://freecode.com/projects/jwhois
 
 Package: jwhois
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, dpkg (>= 1.9.0)
 Recommends: lynx
 Conflicts: suidmanager (<< 0.50)
-Description: Improved Caching Whois client
+Description: improved caching whois client
  GNU jwhois is an Internet Whois client that queries hosts for
  information according to RFC 954 - NICNAME/WHOIS. JWHOIS is configured
  via a configuration file that contains information about all known Whois
diff --git a/debian/copyright b/debian/copyright
index d3f5ef8..e1bacdc 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,23 +1,64 @@
-Package: GNU jwhois
-Obtained from: ftp://ftp.gnu.org/pub/gnu/jwhois
-Packaged for Debian by: Peter Karlsson <pet...@debian.org>
-Upstream authors: Jonas Öberg <jo...@gnu.org>,
-                  Peter Karlsson <pet...@debian.org>
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0
+X-Format: http://dep.debian.net/deps/dep5
+Upstream-Name: GNU jwhois
+Upstream-Contact:
+ Jonas Öberg <jo...@gnu.org>,
+ Peter Karlsson <pet...@debian.org>
+Source: ftp://ftp.gnu.org/pub/gnu/jwhois
+X-Source: http://savannah.gnu.org/projects/jwhois
+X-Upstream-Vcs: http://savannah.gnu.org/cvs/?group=jwhois
+X-Upstream-Bugs: http://savannah.gnu.org/bugs/?group=jwhois
 
-Copyright (C) 1999-2007 Free Software Foundation, Inc.
+Files: *
+Copyright:
+  1999-2007 Free Software Foundation, Inc.
+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 as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+Files: include/getopt.h src/getopt.c src/getopt1.c
+Copyright:
+  1999-2007 Free Software Foundation, Inc.
+License: LGPL-2+
 
-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.
+Files: debian/*
+Copyright:
+  2005-2007,2010,2012 Paul Dwerryhouse <p...@dwerryhouse.com.au>
+  2012      Jari Aalto <jari.aa...@cante.net>
+  2005      Peter Karlsson <pet...@debian.org>
+  2004      Andreas Metzler <ametz...@debian.org>
+  2001-2003 Peter Karlsson <pet...@debian.org>
+  1999,2000 Per Lundberg <plun...@debian.org>
+License: GPL-3+
 
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+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 as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package 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, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License can be found in "/usr/share/common-licenses/GPL-3".
 
-On Debian systems, the complete text of the GNU General
-Public License can be found in "/usr/share/common-licenses/GPL-3".
+License: LGPL-2+
+ This package is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ .
+ This package 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
+ Library General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU Library General
+ Public License can be found in "/usr/share/common-licenses/LGPL-2".
diff --git a/debian/patches/sv-man.patch b/debian/patches/20-sv-man.patch
similarity index 67%
rename from debian/patches/sv-man.patch
rename to debian/patches/20-sv-man.patch
index f1b7867..fdd1ca9 100644
--- a/debian/patches/sv-man.patch
+++ b/debian/patches/20-sv-man.patch
@@ -1,3 +1,6 @@
+From: Paul Dwerryhouse <p...@dwerryhouse.com.au>
+Subject: Correct manual page markup
+
 --- a/doc/sv/jwhois.1
 +++ b/doc/sv/jwhois.1
 @@ -1,5 +1,4 @@
diff --git a/debian/patches/30_man_typo.patch b/debian/patches/30-man-typo.patch
similarity index 100%
rename from debian/patches/30_man_typo.patch
rename to debian/patches/30-man-typo.patch
diff --git a/debian/patches/40_afrinic.patch b/debian/patches/40-afrinic.patch
similarity index 100%
rename from debian/patches/40_afrinic.patch
rename to debian/patches/40-afrinic.patch
diff --git a/debian/patches/40_nic.or.kr.patch b/debian/patches/42-nic.or.kr.patch
similarity index 100%
rename from debian/patches/40_nic.or.kr.patch
rename to debian/patches/42-nic.or.kr.patch
diff --git a/debian/patches/45_info_section.patch b/debian/patches/45-info-section.patch
similarity index 100%
rename from debian/patches/45_info_section.patch
rename to debian/patches/45-info-section.patch
diff --git a/debian/patches/46_afrinic.patch b/debian/patches/46-afrinic.patch
similarity index 100%
rename from debian/patches/46_afrinic.patch
rename to debian/patches/46-afrinic.patch
diff --git a/debian/patches/47_retval.patch b/debian/patches/47-retval.patch
similarity index 88%
rename from debian/patches/47_retval.patch
rename to debian/patches/47-retval.patch
index 5c3f966..69801b8 100644
--- a/debian/patches/47_retval.patch
+++ b/debian/patches/47-retval.patch
@@ -1,5 +1,5 @@
-+From: <p...@dwerryhouse.com.au>
-+Subject: Fixes the return value
+From: <p...@dwerryhouse.com.au>
+Subject: Fix the return value
 
 ---
  src/utils.c     |    1 +-
diff --git a/debian/patches/series b/debian/patches/series
index c2517dc..1e6cd6f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,7 @@
-sv-man.patch
-30_man_typo.patch
-40_afrinic.patch
-40_nic.or.kr.patch
-45_info_section.patch
-46_afrinic.patch
-47_retval.patch
+20-sv-man.patch
+30-man-typo.patch
+40-afrinic.patch
+42-nic.or.kr.patch
+45-info-section.patch
+46-afrinic.patch
+47-retval.patch
diff --git a/debian/patches/48_ggje_nic.patch b/debian/patches/unused/48_ggje_nic.patch
similarity index 100%
rename from debian/patches/48_ggje_nic.patch
rename to debian/patches/unused/48_ggje_nic.patch
diff --git a/debian/patches/49_foglvc_nic.dpatch b/debian/patches/unused/49_foglvc_nic.dpatch
similarity index 100%
rename from debian/patches/49_foglvc_nic.dpatch
rename to debian/patches/unused/49_foglvc_nic.dpatch
diff --git a/debian/rules b/debian/rules
index 9880cea..66b3907 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,88 +1,21 @@
 #!/usr/bin/make -f
-# These are the rules for building Jwhois packages for Debian.
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+export DEB_BUILD_MAINT_OPTIONS	= hardening=+all
+export DEB_CFLAGS_MAINT_APPEND	= -Wall
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 
-# 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
-
-config.status: configure
-	dh_testdir
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+override_dh_auto_configure:
 	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
-	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --datadir=\$${prefix}/share --with-cache --localstatedir=/var/cache/jwhois
-
-
-
-build-arch: build
-build-indep: build
+	dh_auto_configure -- --with-cache --localstatedir=/var/cache/jwhois
 
-build: build-stamp
-
-build-stamp:  config.status
-	dh_testdir
-	$(MAKE)
-	touch build-stamp
-
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp 
-	[ ! -f Makefile ] || $(MAKE) distclean
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
-	rm -f config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
-	rm -f config.guess
-endif
-	dh_clean 
-
-
-install: build
-	dh_testdir
-	dh_testroot
-	dh_prep
-	dh_installdirs
+override_dh_auto_install:
 	$(MAKE) install DESTDIR=$(CURDIR)/debian/jwhois
 	install -d debian/jwhois/etc
 	install -m644 example/jwhois.conf debian/jwhois/etc
 	rm -f $(CURDIR)/debian/jwhois/usr/share/info/dir
 
-# Build architecture-independent files here.
-binary-indep: build install
-
-# Build architecture-dependent files here.
-binary-arch: build install
-	dh_testdir
-	dh_testroot
-	dh_installdocs
-	dh_installman
-	dh_installinfo
-	dh_installchangelogs ChangeLog
-	dh_strip
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_shlibdeps
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-binary: binary-indep binary-arch
+%:
+	dh $@
 
-.PHONY: build clean binary-indep binary-arch binary install 
+# End of file
-- 
1.7.9.5

Reply via email to