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

Bug#683746: rspamd packaging



Hi Vsevolod,

I've seen your ITP of rspamd and thought I may package it instead of
you. But as I see, it's close to ready.
I send a patch to make it better. Contains the following fixes:
- make it rebuildable with deleting src/modules.c between builds
- fixing debian/copyright (the BSD license text is still not 100%
  correct)
- install the correct binaries and not symlinks to specific versioned
  ones
- fix spelling mistake in debian/rules
- correct build-dependencies for Sid
- add patch to build with newer gmime (v2.6)
- update standards-version to the current one
- take a step toward build hardening build

I couldn't build it with hardening enabled due to this error:
/usr/bin/ld.bfd.real: librspamd-util.a(mem_pool.c.o): relocation R_X86_64_PC32 against symbol `memory_pool_alloc' can not be used when making a shared object; recompile with -fPIC

The package should be split to lib, -dev and binary. Please don't use
debian/changelog as upstream changelog. It's only for packaging changes
and nothing else.

Regards,
Laszlo/GCS
diff -Nur rspamd-0.5.0.orig/debian/control rspamd-0.5.0/debian/control
--- rspamd-0.5.0.orig/debian/control	2012-06-09 14:35:05.000000000 +0200
+++ rspamd-0.5.0/debian/control	2012-08-04 20:01:52.000000000 +0200
@@ -2,8 +2,8 @@
 Section: mail
 Priority: extra
 Maintainer: Vsevolod Stakhov <vsevolod@highsecure.ru>
-Build-Depends: debhelper (>= 7.0.50~), cmake, libevent1-dev(>= 1.3), libglib2.0-dev (>= 2.16.0), libgmime-2.4-dev, liblua5.1-0-dev, libpcre3-dev, cdbs
-Standards-Version: 3.9.1
+Build-Depends: debhelper (>= 7.0.50~), dpkg-dev (>= 1.16.1~), cmake, libevent-dev (>= 1.3), libglib2.0-dev (>= 2.16.0), libgmime-2.6-dev, liblua5.1-0-dev, libpcre3-dev, cdbs
+Standards-Version: 3.9.3
 Homepage: https://bitbucket.org/vstakhov/rspamd/
 Vcs-Hg: https://bitbucket.org/vstakhov/rspamd/
 Vcs-Browser: https://bitbucket.org/vstakhov/rspamd/src
diff -Nur rspamd-0.5.0.orig/debian/copyright rspamd-0.5.0/debian/copyright
--- rspamd-0.5.0.orig/debian/copyright	2012-06-09 14:35:05.000000000 +0200
+++ rspamd-0.5.0/debian/copyright	2012-08-04 19:51:37.000000000 +0200
@@ -3,15 +3,47 @@
 Source: https://bitbucket.org/vstakhov/rspamd
 
 Files: contrib/lgpl/*
-Copyright: 1999, 2000 Scott Wimer
-Copyright: 2004, Matthias Clasen <mclasen@redhat.com>
-Copyright: 2005 - 2007, Marco Barisione <marco@barisione.org>
+Copyright: 1999, 2000 Scott Wimer,
+           2004, Matthias Clasen <mclasen@redhat.com>,
+           2005 - 2007 Marco Barisione <marco@barisione.org>
 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
+ Lesser General Public License for more details.
+ .
+ You should have received a copy of the GNU Library General Public
+ License along with this package; 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 Library General
+ Public License can be found in `/usr/share/common-licenses/LGPL-2'.
 
 Files: *
 Copyright: 2008-2011 Vsevolod Stakhov <vsevolod@highsecure.ru>
 License: BSD
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted under the terms of the BSD License.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS 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.
+ .
+ On Debian systems, the complete text of the BSD License can be
+ found in `/usr/share/common-licenses/BSD'.
 
 Files: debian/*
 Copyright: 2011 Vsevolod Stakhov <vsevolod@highsecure.ru>
diff -Nur rspamd-0.5.0.orig/debian/patches/gmime-2.6.patch rspamd-0.5.0/debian/patches/gmime-2.6.patch
--- rspamd-0.5.0.orig/debian/patches/gmime-2.6.patch	1970-01-01 01:00:00.000000000 +0100
+++ rspamd-0.5.0/debian/patches/gmime-2.6.patch	2012-08-04 20:06:18.741331505 +0200
@@ -0,0 +1,20 @@
+Description: build with gmime-2.6
+ CMake checks for gmime-2.4 , change it to gmime-2.6 to build with that
+ version.
+ .
+Author: Laszlo Boszormenyi (GCS) <gcs@debian.hu>
+Last-Update: 2012-08-04
+
+---
+
+--- rspamd-0.5.0.orig/CMakeLists.txt
++++ rspamd-0.5.0/CMakeLists.txt
+@@ -454,7 +454,7 @@ ENDIF(HIREDIS_FOUND)
+ 
+ # Try to link with gmime24
+ IF(NOT GMIME2_FOUND OR FORCE_GMIME24)
+-	pkg_check_modules(GMIME24 REQUIRED gmime-2.4)
++	pkg_check_modules(GMIME24 REQUIRED gmime-2.6)
+ 	SET(GMIME24 "yes")
+ 	# Gmime2
+ 	FOREACH(arg ${GMIME24_CFLAGS})
diff -Nur rspamd-0.5.0.orig/debian/patches/series rspamd-0.5.0/debian/patches/series
--- rspamd-0.5.0.orig/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ rspamd-0.5.0/debian/patches/series	2012-08-04 20:06:41.901332699 +0200
@@ -0,0 +1 @@
+gmime-2.6.patch
diff -Nur rspamd-0.5.0.orig/debian/rules rspamd-0.5.0/debian/rules
--- rspamd-0.5.0.orig/debian/rules	2012-06-09 14:35:05.000000000 +0200
+++ rspamd-0.5.0/debian/rules	2012-08-04 19:59:39.000000000 +0200
@@ -1,6 +1,17 @@
 #!/usr/bin/make -f
 
+#export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+
+include /usr/share/dpkg/buildflags.mk
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/cmake.mk
 
-DEB_CMAKE_NORMAL_ARGS+= -DETC_PREFIX=/etc -DMAN_PREFIX=/usr/share/man -DLOCALSTATES_PREFIX=/var/run -DLIBDIR=/usr/lib -DINCLUDEDIR=/usr/inlude -DNO_SHARED=ON
+DEB_CMAKE_NORMAL_ARGS+= -DETC_PREFIX=/etc -DMAN_PREFIX=/usr/share/man -DLOCALSTATES_PREFIX=/var/run -DLIBDIR=/usr/lib -DINCLUDEDIR=/usr/include -DNO_SHARED=ON
+
+clean::
+	rm -f src/modules.c
+
+install/rspamd::
+	rm -f debian/rspamd/usr/bin/rspam[cd]
+	mv debian/rspamd/usr/bin/rspamc-* debian/rspamd/usr/bin/rspamc
+	mv debian/rspamd/usr/bin/rspamd-* debian/rspamd/usr/bin/rspamd

Reply to: