guedes / ldap_fdw

A LDAP Foreign Data Wrapper for PostgreSQL
31 stars 11 forks source link

Bug in Makefile #13

Closed mpasserini closed 8 years ago

mpasserini commented 10 years ago

Hi,

I think there's a bug in the Makefile. I'm trying to install ldap_fdw-0.1.1 on CentOS release 6.4 (Final), with: make-3.81-20.el6.x86_64 postgresql93-devel-9.3.1-1PGDG.rhel6.x86_64 gcc-4.4.7-4.el6.x86_64 openldap-devel-2.4.23-32.el6_4.1.x86_64 postgresql93-9.3.1-1PGDG.rhel6.x86_64

If I type make it compiles, but then I say make install it says:

[root@localhost ldap_fdw-0.1.1]# make install /bin/mkdir -p '/usr/pgsql-9.3/lib' /bin/mkdir -p '/usr/pgsql-9.3/share/extension' /bin/mkdir -p '/usr/pgsql-9.3/share/extension' /bin/mkdir -p '/usr/share/doc/pgsql/extension' /usr/bin/install -c -m 755 ldap_fdw.so '/usr/pgsql-9.3/lib/ldap_fdw.so' /usr/bin/install -c -m 644 ./ldap_fdw.control '/usr/pgsql-9.3/share/extension/' /usr/bin/install -c -m 644 ./sql/ldap_fdw--0.1.1.sql ./sql/ldap_fdw--0.1.1.sql '/usr/pgsql-9.3/share/extension/' /usr/bin/install: will not overwrite just-created /usr/pgsql-9.3/share/extension/ldap_fdw--0.1.1.sql' with./sql/ldap_fdw--0.1.1.sql'

To fix the problem I deleted the following file after running make: sql/ldap_fdw--0.1.1.sql . Now it seems to install it correctly. But I will do more tests.

guedes commented 10 years ago

What is the behavior when you call the code bellow?

make clean
make
make install
mpasserini commented 10 years ago

[root@localhost pldap]# ls ldap_fdw-0.1.1.zip [root@localhost pldap]# export PATH="$PATH:/usr/pgsql-9.3/bin" [root@localhost pldap]# unzip ldap_fdw-0.1.1.zip Archive: ldap_fdw-0.1.1.zip 3b312ba91f984cb889b0103ab6ec4414b3cd1f90 creating: ldap_fdw-0.1.1/ extracting: ldap_fdw-0.1.1/.gitignore
inflating: ldap_fdw-0.1.1/META.json
inflating: ldap_fdw-0.1.1/Makefile
inflating: ldap_fdw-0.1.1/README.md
creating: ldap_fdw-0.1.1/doc/ inflating: ldap_fdw-0.1.1/doc/ldap_fdw.md
inflating: ldap_fdw-0.1.1/ldap_fdw.control
creating: ldap_fdw-0.1.1/sql/ inflating: ldap_fdw-0.1.1/sql/ldap_fdw.sql
extracting: ldap_fdw-0.1.1/sql/uninstall_ldap_fdw.sql
creating: ldap_fdw-0.1.1/src/ inflating: ldap_fdw-0.1.1/src/ldap_fdw.c
inflating: ldap_fdw-0.1.1/src/ldap_fdw.h
creating: ldap_fdw-0.1.1/test/ creating: ldap_fdw-0.1.1/test/expected/ inflating: ldap_fdw-0.1.1/test/expected/base.out
creating: ldap_fdw-0.1.1/test/sql/ inflating: ldap_fdw-0.1.1/test/sql/base.sql
[root@localhost pldap]# cd ldap_fdw-0.1.1 [root@localhost ldap_fdw-0.1.1]# ls sql/ ldap_fdw.sql uninstall_ldap_fdw.sql [root@localhost ldap_fdw-0.1.1]# make gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fpic -I. -I. -I/usr/pgsql-9.3/include/server -I/usr/pgsql-9.3/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o src/ldap_fdw.o src/ldap_fdw.c src/ldap_fdw.c:335: warning: ‘_get_str_attributes’ defined but not used src/ldap_fdw.c:354: warning: ‘_name_str_case_cmp’ defined but not used gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fpic -shared -o ldap_fdw.so src/ldap_fdw.o -L/usr/pgsql-9.3/lib -L/usr/lib64 -Wl,--as-needed -lldap cp sql/ldap_fdw.sql sql/ldap_fdw--0.1.1.sql [root@localhost ldap_fdw-0.1.1]# ls sql/ ldap_fdw--0.1.1.sql ldap_fdw.sql uninstall_ldap_fdw.sql [root@localhost ldap_fdw-0.1.1]# make install /bin/mkdir -p '/usr/pgsql-9.3/lib' /bin/mkdir -p '/usr/pgsql-9.3/share/extension' /bin/mkdir -p '/usr/pgsql-9.3/share/extension' /bin/mkdir -p '/usr/share/doc/pgsql/extension' /usr/bin/install -c -m 755 ldap_fdw.so '/usr/pgsql-9.3/lib/ldap_fdw.so' /usr/bin/install -c -m 644 ./ldap_fdw.control '/usr/pgsql-9.3/share/extension/' /usr/bin/install -c -m 644 ./sql/ldap_fdw--0.1.1.sql ./sql/ldap_fdw--0.1.1.sql '/usr/pgsql-9.3/share/extension/' /usr/bin/install: will not overwrite just-created /usr/pgsql-9.3/share/extension/ldap_fdw--0.1.1.sql' with./sql/ldap_fdw--0.1.1.sql' make: *\ [install] Error 1

mpasserini commented 10 years ago

[root@localhost ldap_fdw-0.1.1]# rm sql/ldap_fdw--0.1.1.sql rm: remove regular file `sql/ldap_fdw--0.1.1.sql'? y [root@localhost ldap_fdw-0.1.1]# make install cp sql/ldap_fdw.sql sql/ldap_fdw--0.1.1.sql /bin/mkdir -p '/usr/pgsql-9.3/lib' /bin/mkdir -p '/usr/pgsql-9.3/share/extension' /bin/mkdir -p '/usr/pgsql-9.3/share/extension' /bin/mkdir -p '/usr/share/doc/pgsql/extension' /usr/bin/install -c -m 755 ldap_fdw.so '/usr/pgsql-9.3/lib/ldap_fdw.so' /usr/bin/install -c -m 644 ./ldap_fdw.control '/usr/pgsql-9.3/share/extension/' /usr/bin/install -c -m 644 ./sql/ldap_fdw--0.1.1.sql '/usr/pgsql-9.3/share/extension/' /usr/bin/install -c -m 644 ./doc/ldap_fdw.md '/usr/share/doc/pgsql/extension/' [root@localhost ldap_fdw-0.1.1]# diff sql/ldap_fdw--0.1.1.sql sql/ldap_fdw.sql [root@localhost ldap_fdw-0.1.1]#

guedes commented 10 years ago

OK, I'll poke into this. Thanks!

xiu1 commented 8 years ago
diff --git a/Makefile b/Makefile
index 24effdc..8b2d8f9 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ all: sql/$(EXTENSION)--$(EXTVERSION).sql
 sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
        cp $< $@

-DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
+DATA = sql/$(EXTENSION)--$(EXTVERSION).sql
 EXTRA_CLEAN = sql/$(EXTENSION)--$(EXTVERSION).sql
 endif
guedes commented 8 years ago

It seems to fix that. Thanks!