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

Re: dpkg-buildpackage mvn command tries to use /root/.m2/repository

>>>>> Emmanuel Bourg <ebourg@apache.org>:

> The rules file disables most of the targets, that looks wrong. Did you
> generate the package with mh_make from maven-debian-helper?

No, I startet with creating files as in this article

I can try running mh_make, but as this is a multi-module project with
lots of non-standard maven stuff, most of the examples I've been able to
google up hasn't.

But the problem I have isn't really related to the structure of the
rules file, I think.  The problem is that dpkg-buildpackage thinks $HOME
is "/root" and that user "sb" doesn't have write access to root.

> If you share the repository on GitHub I'll get a look.

I will share it on github eventually but I'm still working on my first
commit. :-)

> I suggest running mh_make and selecting only the first core karaf
> modules, and then enabling more modules gradually as needed.

Actually I planned to go the other way: first build karaf, and then move
the files where they should go.

Outline of the plan
 1. Download the sources and build them with maven (this is where I'm now)
 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
 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

After point 5 in this, there will hopefully be a running
non-debian-package compliant karaf that's installable by a debian
package (ie. about the same level of functionality as my current fpm
based package, but built from sources instead of the binary tar-ball and
using the debian tools).

Point 6 and 7 are for moving this to a more debian-package-compliant

There are 34 org.apache.karaf.*.jar files built from the karaf sources,
and creating individual .deb packages for all of them seems like a lot of work.

Reply to: