[Rspamd-Users] Build rspam package

rspam at padaru.com rspam at padaru.com
Fri Nov 12 13:43:04 UTC 2021


   Hey Ged,

   thank you for your huge reply, i didn´t want to provoke much effort,
   hence the mega short question.

   However, i have not needed c-programming and manual packing of packages
   so far. Now it´s not recommendet to use the rspamd packaged from the
   official debian repo´s - i have read at least - i have to build my own.

   But now i want to occupy mysqlf with the rspam and packing of packages,
   in my next step i want to set up my own mirror repo and install my
   rspam package from these... At least that is the plan.

   I work with ubuntu 18 - ubuntu 20 servers.


   What i have until done (Ubuntu 20.04.3 LTS):

   0. $ sudoapt install openssl libglib2.0-dev ragel luajit cmake
   cmake-qt-gui sqlite3 libmagic-dev libicu-dev libpcre3 libpcre3-dev
   libhyperscan-dev libhyperscan4 zlibc devscripts fakeroot packaging-dev
   libcurl4-openssl-dev libjemalloc-dev libluajit-5.1-dev liblua5.1-dev
   libpcre2-dev libsodium-dev libsqlite3-dev libssl-dev libunwind-dev
   1. $ mkdir rspamd.build
   2. $ git clone --recursive [1]https://github.com/rspamd/rspamd.git
   3. $ cd rspamd
   4. $ ./dist.sh rspamd_3.1.tar.xz
   5. $ mv rspamd_3.1.tar.xz ..
   6. $ tar -xf rspamd_3.1.tar.xz
   7. $ debuild # error:

   dpkg-buildpackage -us -uc -ui
   dpkg-buildpackage: info: source package rspamd
   dpkg-buildpackage: info: source version 2.5
   dpkg-buildpackage: info: source distribution unstable
   dpkg-buildpackage: info: source changed by Vsevolod Stakhov
   <vsevolod at highsecure.ru>
   dpkg-source --before-build .
   dpkg-buildpackage: info: host architecture amd64
   fakeroot debian/rules clean
   fakeroot, while creating message channels: Function not implemented
   This may be due to a lack of SYSV IPC support.
   fakeroot: error while starting the `faked' daemon.
   /usr/bin/fakeroot: 1: kill: Usage: kill [-s sigspec | -signum |
   -sigspec] [pid | job]... or
   kill -l [exitstatus]
   dpkg-buildpackage: error: fakeroot debian/rules clean subprocess
   returned exit status 1
   debuild: fatal error at line 1182:
   dpkg-buildpackage -us -uc -ui failed


   8. $ sudo debuild # so i tried with root privileges, but here comes
   this error:

   dpkg-buildpackage -us -uc -ui
   dpkg-buildpackage: info: source package rspamd
   dpkg-buildpackage: info: source version 2.5
   dpkg-buildpackage: info: source distribution unstable
   dpkg-buildpackage: info: source changed by Vsevolod Stakhov
   <vsevolod at highsecure.ru>
   dpkg-source --before-build .
   dpkg-buildpackage: info: host architecture amd64
   debian/rules clean
   dh clean --with systemd --parallel
   debian/rules override_dh_auto_clean
   make[1]: Entering directory '/home/pascal/myRspam/rspamd_3.1'
   dh_auto_clean
   rm -f src/modules.c
   make[1]: Leaving directory '/home/pascal/myRspam/rspamd_3.1'
   dh_clean -O--parallel
   dpkg-source -b .
   dpkg-source: error: can't build with source format '3.0 (quilt)': no
   upstream tarball found at ../rspamd_2.5.orig.tar.{bz2,gz,lzma,xz}
   dpkg-buildpackage: error: dpkg-source -b . subprocess returned exit
   status 25
   debuild: fatal error at line 1182:
   dpkg-buildpackage -us -uc -ui failed

   # here i thought i need the rspamd_2.5.orig.tar file, i found it here:
   [2]http://archive.ubuntu.com/ubuntu/pool/universe/r/rspamd/

   9. $ wget
   [3]http://archive.ubuntu.com/ubuntu/pool/universe/r/rspamd/rspamd_2.5.o
   rig.tar.xz
   10. $ ls -alh

   drwxr-xr-x 1 user user 4096 Nov 12 14:25 rspamd
   drwxr-xr-x 1 user user 4096 Nov 12 14:23 rspamd.build
   -rw-r--r-- 1 user user 3420248 Apr 27 2020 rspamd_2.5.orig.tar.xz
   -rw-r--r-- 1 user user 847 Nov 12 14:27 rspamd_2.5_amd64.build
   drwxr-xr-x 1 user user 4096 Nov 12 12:16 rspamd_3.1
   -rw-r--r-- 1 user user 4206456 Nov 12 14:25 rspamd_3.1.tar.xz

   11. $ cd rspamd_3.1
   12. $ sudo debuild # this works a while until this error is thrown:

   rspamd_3.1/utils/rspamd_http_bench.c
   rspamd_3.1/utils/rspamd_http_server.c
   rspamd_3.1/utils/rspamd_stats.pl
   rspamd_3.1/utils/sa_trivial_convert.lua
   dpkg-source: error: aborting due to unexpected upstream changes, see
   /tmp/rspamd_2.5.diff.zZuZia
   dpkg-source: info: you can integrate the local changes with dpkg-source
   --commit
   dpkg-buildpackage: error: dpkg-source -b . subprocess returned exit
   status 2
   debuild: fatal error at line 1182:
   dpkg-buildpackage -us -uc -ui failed


   And now i stuck, i dont understand why i need this file
   '[4]rspamd_2.5.orig.tar.xz' which by all appearances is not needed
   after all. I thought i can build a package like an .deb out of the box
   with the git files.

   Here sits my main question, is this a special rspamd
   package-build-process behavior? What´s the correct way to build own
   packages from opensource projects?

   I try the package build process on a windows ubuntu vm. If it run i
   want to portate it on a real server.


   Many thanks for your reply.

   G.W. Haywood via Users schrieb am 12.11.2021 13:14 (GMT +01:00):

Hi there,

On Fri, 12 Nov 2021, rspam at padaru.com wrote:

> i try to build a own rspam package, is there somwhere a more detailed
> toturial as the official one: [5]https://rspamd.com/downloads.html?

The instructions on that page are a little terse but I understand them
because I have built a lot of software on Linux machines.

Firstly, are you building on Linux?  If not, then the instructions will
probably be no use to you.

Secondly, have you tried to follow the instructions?  If you have, and
they did not work for you, perhaps you can explain exactly what you
did and exactly what were the results.  Assuming that you are building
on Linux or a similar operating system, before you follow any of the
instructions you would be expected to be running a shell as a normal
user - not as root - and to have as the current directory a place in
the filesystem to which your user has write access.  You would need to
have a working Internet connection, so that commands which perform
network operations like 'git' can do something useful for you.  Other
commands which rely on a working network are 'wget', 'curl' and 'dig'.

After successfully completing the

$ git clone --recursive [6]https://github.com/rspamd/rspamd.git

step you will have a new sub-directory called 'rspamd' which contains
the sources which have been downloaded from the git repository for the
project.  You then need to create your new 'build' directory, then cd
into it, and run 'cmake' in it, to build rspamd in that directory.  To
recap, you are expected to have in your directory structure something
like this:

/home/
/home/user/
/home/user/rspamd/
/home/user/rspamd.build/

where the sources are in /home/user/rspamd/ and you do the build in
/home/user/rspamd.build/.  Of course there will be a lot of *other*
directories in there, but we are not interested in those just now.

The name of the build directory doesn't *have* to be rspamd.build
but it will make things easier if you don't call it something crazy
because when you ask questions about it people will probably expect
that you have called it 'rspamd.build' and not 'crazy.new.project'.

Note that I prepended a '$' symbol to the line 'git clone ...' above.
That is because you are expected to run the command as a normal user.
It is perhaps unfortunate that the '$' is missing from the Web page
instructions, but people who are familiar with using 'git' will know
what it means.

To build the software needs no permissions other than those of the
normal user because it works entirely in the build directory, but to
install it requires root permissions so the install step needs to be
done either as root or using 'sudo'.  That is why the shell 'prompt'
in the instructions is the '$' symbol, except for the 'make install'
step, where it is '#', which is the convention for a root prompt.  If
you have sudo permissions, then instead of switching to user root you
can use

$ sudo make install

Finally, how do you plan to use rspamd?  If you are having difficulty
building it, then you can probably expect more difficulties using it.

Anyway, I hope this helps.  Please let us know if it does not.

--

73,
Ged.
--
Users mailing list
Users at lists.rspamd.com
[7]https://lists.rspamd.com/mailman/listinfo/users

References

   1. https://github.com/rspamd/rspamd.git
   2. http://archive.ubuntu.com/ubuntu/pool/universe/r/rspamd/
   3. http://archive.ubuntu.com/ubuntu/pool/universe/r/rspamd/rspamd_2.5.orig.tar.xz
   4. http://archive.ubuntu.com/ubuntu/pool/universe/r/rspamd/rspamd_2.5.orig.tar.xz
   5. https://rspamd.com/downloads.html
   6. https://github.com/rspamd/rspamd.git
   7. https://lists.rspamd.com/mailman/listinfo/users


More information about the Users mailing list