droe / sslsplit

Transparent SSL/TLS interception
https://www.roe.ch/SSLsplit
BSD 2-Clause "Simplified" License
1.73k stars 327 forks source link

Makefile tries to install files outside of PREFIX #251

Closed fxcoudert closed 4 years ago

fxcoudert commented 5 years ago

Trying to build sslsplit 0.5.4 as part of Homebrew fails because:

The issue comes from:

    test -d $(DESTDIR)/var/log/$(TARGET) || \
        $(MKDIR) -p $(DESTDIR)/var/log/$(TARGET)
    test -d $(DESTDIR)/var/run/$(TARGET) || \
        $(MKDIR) -p $(DESTDIR)/var/run/$(TARGET)

which is wrong, because $(DESTDIR)/var/log is not inside PREFIX. This is not expected behaviour. More importantly, we cannot fix DESTDIR instead of PREFIX because then SUBSTITUTIONS will fail to point to the right directories (it does not use DESTDIR).

sonertari commented 5 years ago

I have never tried to change the default install path, nor do I have an osx system, but I think you are right. So what happens when you change those lines to the following (making them similar to all other install/deinstall paths)?:

    test -d $(DESTDIR)$(PREFIX)/var/log/$(TARGET) || \
        $(MKDIR) -p $(DESTDIR)$(PREFIX)/var/log/$(TARGET)
    test -d $(DESTDIR)$(PREFIX)/var/run/$(TARGET) || \
        $(MKDIR) -p $(DESTDIR)$(PREFIX)/var/run/$(TARGET)

Can you try this and report back please? If it works for you, I can fix it on the develop branch.

Edit: But I am not sure if this is going to break build environments. So I will try to build it myself too (e.g. on OpenBSD), hopefully soon.

fxcoudert commented 5 years ago

Yes, $(DESTDIR)$(PREFIX) is how it should be. That fixes the issue.

droe commented 4 years ago

Resolved by not creating those directories in the first place. Distributions with default configs depending on those directories should create them in their preferred location as part of their distribution packages.