PDB-REDO / libcifpp

Library containing code to manipulate mmCIF and PDB files
https://pdb-redo.github.io/libcifpp/
BSD 2-Clause "Simplified" License
28 stars 10 forks source link

GNUmakefile does not honor DESTDIR for some files #4

Closed pacho2 closed 3 years ago

pacho2 commented 3 years ago

When running make DESTDIR=... install , it still tries to install some files out of the wanted location

That is because of some lines in GNUMakefile needing to append DESTDIR to them: libdir = /usr/lib64 datadir = /usr/share docdir = /usr/share/doc/libcifpp-1.0.1_p20210810 DATA_DIR = /usr/share/libcifpp

Thanks a lot

pacho2 commented 3 years ago

This patch solves the issue

--- a/GNUmakefile.in.old    2021-08-31 11:37:44.381788404 +0200
+++ b/GNUmakefile.in    2021-08-31 11:39:12.924885425 +0200
@@ -43,18 +43,18 @@

 prefix             = $(DESTDIR)@prefix@
 exec_prefix            = @exec_prefix@
-libdir             = @libdir@
+libdir             = $(DESTDIR)@libdir@
 includedir         = @includedir@
 datarootdir            = @datarootdir@
-datadir                = @datadir@
-docdir             = @docdir@
+datadir                = $(DESTDIR)@datadir@
+docdir             = $(DESTDIR)@docdir@
 pkgconfigdir       = $(libdir)/pkgconfig

 CCP4DIR                = @CCP4@
 CLIBD              = $(CCP4DIR:%=%/lib/data)

 CACHE_DIR          = $(DESTDIR)@DATA_CACHE_DIR@
-DATA_DIR           = @DATA_LIB_DIR@
+DATA_DIR           = $(DESTDIR)@DATA_LIB_DIR@
 CRON_DIR           = $(DESTDIR)/etc/cron.weekly

 DEFINES                += CACHE_DIR='"$(CACHE_DIR)"' DATA_DIR='"$(DATA_DIR)"'
@@ -288,9 +288,9 @@
    done
    install -d $(CACHE_DIR)
    install -d $(CRON_DIR)
-   if [ ! -f /etc/libcifpp.conf ] ; then \
-       echo "# Uncomment the next line to enable automatic updates" > /etc/libcifpp.conf; \
-       echo "# update=true" >> /etc/libcifpp.conf; \
+   if [ ! -f $(DESTDIR)/etc/libcifpp.conf ] ; then \
+       echo "# Uncomment the next line to enable automatic updates" > $(DESTDIR)/etc/libcifpp.conf; \
+       echo "# update=true" >> $(DESTDIR)/etc/libcifpp.conf; \
        echo ""; \
        echo "Update the /etc/libcifpp.conf file to enable automatic updates"; \
        echo ""; \
mhekkel commented 3 years ago

Thanks for the patch, however, I just moved to cmake so I will not use it. Sorry about that.

Hope the cmake version works better for you , if not, please file a bug report again.