1

I compiled the latest version of netatalk (3.1.8) from source to replace the rather outdated version on my Raspberry Pi.

This was quite successful, and I would like to use this version on other Raspberry Pi, but downloading all the dev libraries and repeating the compilation seems overkill.

Is there a process to copy the compiled version, with its man and conf files etc to another system?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Milliways
  • 1,348
  • 5
  • 18
  • 35

2 Answers2

3

Kusalananda's answer is the better approach generally; but in netatalk's case, upgrading the package to a newer version seems rather complex (at least, in the context of a distribution).

Now that you've installed your locally-built version of netatalk, I would recommend the following approach (I'm assuming you extracted netatalk to a directory called netatalk-3.1.8, and built and installed it from there):

  • tar up the source (and binaries built in the source tree);
  • copy the tarball to another Raspberry Pi;
  • on that other Raspberry Pi, install checkinstall and extract the tarball;
  • install the binaries using checkinstall

    checkinstall -D make install
    

    (as root).

This last step will install the binaries copied across in the pre-built source from your first Raspberry Pi (which shouldn't require any -dev package), and build a .deb package out of it. You can then copy the .deb package to other Raspberry Pi systems...

I'm not sure how well this will work if any of the required libraries are missing, so you may want to run ldd on the binaries on your first Raspberry Pi beforehand, and make sure that the corresponding lib... packages (not -dev!) are installed on the second one.

There's a simpler variant if the netatalk Makefile has a working uninstall target: in that case, on the first Raspberry Pi,

  • install checkinstall;
  • uninstall netatalk:

    make uninstall
    
  • install it again using checkinstall:

    checkinstall -D make install
    

That way you know that the required libraries are already installed, and the resulting .deb should have the appropriate dependencies.

If checkinstall doesn't work, there's always the pre-built tarball approach:

  • tar up the source (and binaries built in the source tree);
  • copy the tarball to the other Raspberry Pis;
  • on each Raspberry Pi, run make install;
  • make a note of the libraries you need to install separately to get everything working.
Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • 1
    Some other alternatives are GNU [stow](http://www.gnu.org/software/stow/) or [xstow](http://xstow.sourceforge.net/) or [paco](http://paco.sf.net/)....like [checkinstall](http://checkinstall.izto.org), they're all useful wrappers around `make install`. see also http://unix.stackexchange.com/questions/73461/differences-between-xstow-and-stow – cas Jun 17 '16 at 12:39
  • Thanks for the reply. I tried `checkinstall` which looked promising. Unfortunately the resultant package failed with the following error:- `afpd: error while loading shared libraries: libatalk.so.17: cannot open shared object file: No such file or directory` On checking the lib was there, but after `make install` (which did work) there is an obvious difference in size of the library, so something has gone wrong. I have repeated the whole process, with the same result. This is beyond my abilities to debug. – Milliways Jun 18 '16 at 04:05
  • PS The link provided was interesting. Most of it is obscure, but it seems that the several year hiatus is because of a copyright notice in an include file. – Milliways Jun 18 '16 at 04:06
  • @Milliways it's weird that `checkinstall` doesn't work. Does the plain pre-built-tarball approach work better? (See the last part of my updated answer.) – Stephen Kitt Jun 18 '16 at 19:50
  • It has been quite a while, and I have had a few disasters with one system. I decided to start again, and did a brand new build on the original system. I transferred the pre built tarball. The `checkinstall` fails with `unix.c:30:21: fatal error: sys/acl.h: No such file or directory #include `. This was presumably installed by one of the `dev` packages, but I can't find which. Raspbian Jessie has `acl` package installed. – Milliways Jun 25 '16 at 04:48
0

This is why packaging tools like yum, dpkg and rpm exists. I'm not a Rasbian user and I don't know if netatalk is available as a package for the system (checking... it seems to be).

  • If it is available, that would be your first port of call.
  • If it is available, but the version is too old, then I would contact the package maintainer about an update.
  • If it isn't available, or you just don't want to contact the maintainer, you could consider building a package with whatever package managing system Rasbian uses (seems to be Debian packages). Here's a HOWTO for dpkg, and here's another that the Rasbian people link to from their own pages.

To not use a binary package means that you will have to keep track of where all the files are installed yourself, tar them up somehow and then hope that untarring that tar file won't overwrite things at the destination. These are all things that a package management tool does (as well as making sure dependencies are met etc.)

Rasbian seems to be a small distribution that relies on user participation, so a friendly dialogue with a package maintainer might be welcomed?

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
  • I would created the deb myself if possible. Some packages already have it semi-prepared, other small packages it is quite easy to download apt-sources and overwriting the sources with the new version. Of course there are also more problematic packages. – Rui F Ribeiro Jun 17 '16 at 09:44
  • @RuiFRibeiro Seems like they need another package maintainer, *nudge nudge, wink wink*. – Kusalananda Jun 17 '16 at 09:45
  • I have obviously tried all these. `Raspbian` is `Debian` with hardware specific changes and additions. Both use the same 5 year version of `netatalk` so I could have asked the same question of `Debian` or `Ubuntu`. – Milliways Jun 17 '16 at 09:55