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

Bug#881297: An apache karaf debian package made with native debian packaging tools



I have written a new debian package that
 1. Uses native debian tools to create the package, instead of fpm
 2. Builds from an apache karaf source tarbal instead of from an apache
    karaf binary tarball (like the fpm package mentioned earlier in this
    issue does)

The new apache karaf debian package is here:
 https://github.com/steinarb/karaf-debian

Other improvements to the fpm package
 1. Simpler maintscripts written from scratch (I inherited the scripts
    in the fpm package, from the package I forked on github, and just
    modified them as needed)
 2. The new package works with "apt-get dist-upgrade", the fpm package
    didn't (the fix was that I needed to remove the old karaf's OSGi
    bundle cache during the upgrade)

I followed the plan outlined below and stopped at step 5 (where the
package became usable to me, as a replacement for the fpm package).



Here's the plan I worked after:
 1. Download the sources and build them with maven
 2. Create the directories that will receive the built karaf stuff:
     mkdir -p /etc/karaf
     mkdir -p /usr/share/karaf
     mkdir -p /var/lib/karaf
 3. Move the built stuff in unpacked-src/assemblies/apache-karaf/target/assembly
    to the appropriate places the final structure
    a. mv unpacked-src/assemblies/apache-karaf/target/assembly/bin to /usr/share/karaf
    b. mv unpacked-src/assemblies/apache-karaf/target/assembly/data to /var/lib/karaf
    c. mv unpacked-src/assemblies/apache-karaf/target/assembly/deploy to /var/lib/karaf
    d. mv unpacked-src/assemblies/apache-karaf/target/assembly/etc/* to /etc/karaf
    e. mv unpacked-src/assemblies/apache-karaf/target/assembly/lib to /usr/share/karaf
    f. mv unpacked-src/assemblies/apache-karaf/target/assembly/system to /usr/share/karaf
 4. Create a systemd config that sets up the appropriate environment variables before 
    starting the karaf daemon
      KARAF_BASE=/usr/share/karaf
      KARAF_ETC=/etc/karaf
      KARAF_DATA=/var/lib/karaf/data
 5. Create postinst and postrm scripts that creates/removes a karaf user
    (and group) and sets up and removes the systemd daemon
 6. Replace all of the non org.apache.karaf.*.jar needed for boot with
    deb dependencies
 7. Move the org.apache.karaf.*.jar part of /usr/share/karaf/system to
    /usr/share/maven-repository and use this as the system repo in karaf


Reply to: