Questions about packaging for Fedora

I saw a reference to UrBackup on the Fedora mailing list and decided to take a look since it wasn’t packaged yet. I’ve run into some interesting issues, most of which I have already worked around, and wanted to see if anyone had better solutions.

  1. A couple of items in the Makefile don’t respect the DESTDIR environment variable. I have a patch for this that should be acceptable upstream.

  2. make install tries to create a new user and change ownership of some directories/files to this user. This can’t happen during packaging and is taken care of within the package itself. I have a brute force patch to get around this. Perhaps some sort of --packaging configure option to skip this behavior?

  3. This is a big one. I think all references to “localstatedir” should be replaced with “sharedstatedir”. By default make installs the backup location to /var/urbackup which I think violates the FHS hierarchy. “sharedstatedir” is “/usr/lib” which is the same prefix as what BackupPC uses. I’m getting around this for the time being using “configure --localstatedir=%{_sharedstatedir}” so things get installed into /usr/lib/urbackup.

  4. Since Fedora has moved to SystemD since Fedora 15, I have created a systemd service file but I haven’t had a chance to test it yet. I’m sure it still needs some tweaks. I’d like to use the “simple” type startup (no forking) but as UrBackup uses a wrapper script to control the daemon, I don’t think I can so I’m stuck with type “forking”.

Related to #4: Since this is a service, shouldn’t the binary go in /usr/sbin, not /usr/bin?

Well that’s all I can think of right now. The screenshots look pretty neat so I’m eager to get it up and running. If anyone’s interested in seeing the spec file or my patches let me know and I’ll make them available.

Thanks,
Richard

Great.

With regard to Automake/Autoconf: I pretty much stopped at the point where it all worked (on my system). I had no prior experience and everything you think is wrong probably is and needs fixing.

  1. Is pretty straightforward with above explanation :)
  2. If this is the standard approach to do it. For the debian packages I use the same patch approach you do. But the --packaging option should be better. Feel free to send in patches – I can change it as well but if you have more experience with autoconf you’ll be faster.
  3. I had no idea where to put these files (see also https://sourceforge.net/apps/mantisbt/urbackup/view.php?id=5 ). On Debian BackupPC is in /var/lib/backuppc. There is no configure variable for /var/lib (that I did find). Feel free to change this as well.
  4. If you start the wrapper with --no_deamon it does not fork. The wrapper uses exec which replaces the current process(shell) with the real server (with appropriate paramters). It should work I think.

You are correct: It should go to /usr/sbin I think.

The debian package asks where to save the backups on install and creates and sets the appropriate permissions for this directory. One can also set this directory in the web interface so this is not that important. Another option would be to set it to a default directory like backuppc.

The debian package checker also complains about me including the SQLite library directly and not as library. I hope this is no problem for you. Including it directly has performance benefits and it always has the correct compilation flags.

The TMPDIR issue should also somehow be worked around (see https://sourceforge.net/apps/mantisbt/urbackup/view.php?id=20 ). Either by adding the deleting part to start_urbackup_server or by adding it to the systemd service file (if possible).

Thanks for keeping with the numbering! I hate (well, hate’s a strong word, perhaps strongly dislike) the quoting system on phpBB :)

  1. I’ll post the patch on here when I get the package closer to done. I’m assuming the devs monitor the forum?

  2. Nope, I’m a cmake guy, not an automake guy :) I’ll patch around it for now.

  3. Thanks for the link. The question I have is why was the path changed to begin with? Strange. As far as “fixing” it during configure, just do the Debian equivalent of what I did: (includes /usr/sbin)
    %build
    %configure --localstatedir=%{_sharedstatedir} \
    –bindir=%{_sbindir}
    make %{?_smp_mflags}

  4. Thanks! Since it calls the binary with exec it may well work. I’ll give it a try.

Ok, resorted to quoting :)
Since RPM is non-interactive by design I have to fix it on the front end. :)

Hmm… rpmlint (the Redhat/Fedora checker tool) didn’t complain about the database but it did complain about /var/urbackup being a problem as well as a couple of other random things like one of the libraries calling EXIT (shared-lib-calls-exit).

Thanks for the link. I can add something to the PreExec part of the systemD service file to clean out the tmp folder.

Thanks,
Richard