Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot build rpm on OpenSUSE #1915

Closed
sergey-safarov opened this issue Mar 30, 2019 · 9 comments
Closed

cannot build rpm on OpenSUSE #1915

sergey-safarov opened this issue Mar 30, 2019 · 9 comments

Comments

@sergey-safarov
Copy link
Member

Description

Cannot build postgres module on openSUSE Tumbleweed

Troubleshooting

Reproduction

Package kamailio on openSUSE Tumbleweed.

Debugging Data

N/A

Log Messages

[  434s] xsubpp -typemap `perl -MConfig -e 'print $Config{installprivlib}'`/ExtUtils/typemap -typemap typemap kamailioxs.xs > kamailioxs.c
[  434s] CC (gcc) [M app_perl.so]		kamailioxs.o
[  435s] LD (gcc) [M app_perl.so]		app_perl.so
[  436s] CC (gcc) [M db_perlvdb.so]		perlvdbfunc.o
[  437s] CC (gcc) [M db_perlvdb.so]		perlvdb_oohelpers.o
[  437s] CC (gcc) [M db_perlvdb.so]		perlvdb_conv.o
[  438s] CC (gcc) [M db_perlvdb.so]		db_perlvdb.o
[  439s] make[3]: 'libsrdb1.so.1.0' is up to date.
[  439s] LD (gcc) [M db_perlvdb.so]		db_perlvdb.so
[  439s] which: no pg_config in (/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin)
[  439s] which: no pg_config in (/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin)
[  439s] CC (gcc) [M db_postgres.so]		pg_uri.o
[  439s] CC (gcc) [M db_postgres.so]		pg_sql.o
[  439s] CC (gcc) [M db_postgres.so]		pg_res.o
[  439s] In file included from pg_res.c:33:
[  439s] pg_res.h:40:10: fatal error: libpq-fe.h: No such file or directory
[  439s]  #include <libpq-fe.h>
[  439s]           ^~~~~~~~~~~~
[  439s] compilation terminated.
[  439s] make[2]: *** [../../Makefile.rules:100: pg_res.o] Error 1
[  439s] make[1]: *** [Makefile:511: modules] Error 1
[  439s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/kamailio-5.3.0-dev4/src'
[  439s] make: *** [Makefile:30: every-module] Error 2
[  439s] error: Bad exit status from /var/tmp/rpm-tmp.dwfwP1 (%build)
[  439s] 
[  439s] 
[  439s] RPM build errors:
[  439s]     bogus date in %changelog: Tue Feb 21 2019 Sergey Safarov <s.safarov@gmail.com> 5.3.0-0
[  439s]     Bad exit status from /var/tmp/rpm-tmp.dwfwP1 (%build)
[  439s] 
[  439s] build80 failed "build kamailio.spec" at Sat Mar 30 09:44:29 UTC 2019.
[  439s] 

SIP Traffic

N/A

Possible Solutions

Add ability to use pkgconfig file from Makefile

d90393c7d32a:/ # cat /usr/lib64/pkgconfig/libpq.pc
Name: libpq
Description: PostgreSQL libpq library
Url: http://www.postgresql.org/
Version: 11.2
Requires: 
Requires.private: 
Cflags: -I/usr/include/pgsql
Libs: -lpq
Libs.private:  -lssl -lcrypto -lgssapi_krb5 -lcrypt -lldap_r

Additional Information

Current master

  • Operating System:
d90393c7d32a:/ # cat /etc/os-release 
NAME="openSUSE Tumbleweed"
# VERSION="20190327"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20190327"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20190327"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
miconda added a commit that referenced this issue Apr 1, 2019
@miconda
Copy link
Member

miconda commented Apr 1, 2019

Try with the patch referenced above.

@sergey-safarov
Copy link
Member Author

Hi Daniel @miconda
After applying this patch module is compiled

diff --git a/src/modules/db_postgres/Makefile b/src/modules/db_postgres/Makefile
index 2663ee751..eff11fd3a 100644
--- a/src/modules/db_postgres/Makefile
+++ b/src/modules/db_postgres/Makefile
@@ -14,7 +14,7 @@ LIBPQL_BUILDER = $(shell \
        if pkg-config --exists libpq; then \
                echo 'pkg-config libpq'; \
        fi)
-ifneq ($(LIBPQ_BUILDER),)
+ifeq ($(LIBPQ_BUILDER),)
        DEFS += $(shell $(LIBPQL_BUILDER) --cflags)
        LIBS += $(shell $(LIBPQL_BUILDER) --libs)
 endif

@miconda
Copy link
Member

miconda commented Apr 1, 2019

Why did you have to change ifneq in ifeq? The purpose there was to use pkg-config if found, so that variable is not empty.

@miconda
Copy link
Member

miconda commented Apr 1, 2019

Noticed that I had some variables there with LIBPQ_BUILDER and some with LIBPQL_BUILDER. I just pushed a commit to fix them. Can you try again with latest master?

@sergey-safarov
Copy link
Member Author

yes,that is working.
Could it be backported to 5.2 and 5.1 branches?

@sergey-safarov
Copy link
Member Author

Relevant commit is 49a34c8

miconda added a commit that referenced this issue Apr 3, 2019
@miconda
Copy link
Member

miconda commented Apr 4, 2019

Backported.

@miconda miconda closed this as completed Apr 4, 2019
@sergey-safarov
Copy link
Member Author

I see backport for 5.2 branch.
Could you also backport for 5.1 too.

@miconda
Copy link
Member

miconda commented Apr 4, 2019

Just noted that the cherry-pick failed, I will backport manually later today.

sergey-safarov pushed a commit to sergey-safarov/kamailio that referenced this issue Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants