Skip to content

Commit

Permalink
[gbinder] Respect arch specific lib dir. JB#49681
Browse files Browse the repository at this point in the history
  • Loading branch information
monich committed Jun 2, 2020
1 parent 6832546 commit 92cd463
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 24 deletions.
10 changes: 4 additions & 6 deletions .gitignore
@@ -1,13 +1,11 @@
*~
debian/files
debian/libgbinder-dev.debhelper.log
debian/libgbinder-dev.substvars
debian/libgbinder-dev
debian/libgbinder.debhelper.log
debian/libgbinder.postinst.debhelper
debian/libgbinder.postrm.debhelper
debian/libgbinder.substvars
debian/libgbinder
debian/*.debhelper.log
debian/*.debhelper
debian/*.substvars
debian/*.install
debian/tmp
documentation.list
installroot
Expand Down
23 changes: 16 additions & 7 deletions Makefile
Expand Up @@ -132,10 +132,7 @@ DEBUG_FLAGS = -g
RELEASE_FLAGS =
COVERAGE_FLAGS = -g

ifndef KEEP_SYMBOLS
KEEP_SYMBOLS = 0
endif

KEEP_SYMBOLS ?= 0
ifneq ($(KEEP_SYMBOLS),0)
RELEASE_FLAGS += -g
endif
Expand Down Expand Up @@ -233,6 +230,7 @@ clean:
rm -fr debian/tmp debian/libgbinder debian/libgbinder-dev
rm -f documentation.list debian/files debian/*.substvars
rm -f debian/*.debhelper.log debian/*.debhelper debian/*~
rm -f debian/*.install

test:
make -C unit test
Expand Down Expand Up @@ -291,8 +289,19 @@ $(COVERAGE_LIB): $(COVERAGE_OBJS)
$(AR) rc $@ $?
ranlib $@

#
# LIBDIR usually gets substituted with arch specific dir.
# It's relative in deb build and can be whatever in rpm build.
#

LIBDIR ?= usr/lib
ABS_LIBDIR := $(shell echo /$(LIBDIR) | sed -r 's|/+|/|g')

$(PKGCONFIG): $(LIB_NAME).pc.in Makefile
sed -e 's/\[version\]/'$(PCVERSION)/g $< > $@
sed -e 's|@version@|$(PCVERSION)|g' -e 's|@libdir@|$(ABS_LIBDIR)|g' $< > $@

debian/%.install: debian/%.install.in
sed 's|@LIBDIR@|$(LIBDIR)|g' $< > $@

#
# Install
Expand All @@ -304,9 +313,9 @@ INSTALL = install
INSTALL_DIRS = $(INSTALL) -d
INSTALL_FILES = $(INSTALL) -m $(INSTALL_PERM)

INSTALL_LIB_DIR = $(DESTDIR)/usr/lib
INSTALL_LIB_DIR = $(DESTDIR)$(ABS_LIBDIR)
INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/$(NAME)
INSTALL_PKGCONFIG_DIR = $(DESTDIR)/usr/lib/pkgconfig
INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(ABS_LIBDIR)/pkgconfig

install: $(INSTALL_LIB_DIR)
$(INSTALL_FILES) $(RELEASE_SO) $(INSTALL_LIB_DIR)
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Expand Up @@ -2,7 +2,7 @@ Source: libgbinder
Section: libs
Priority: optional
Maintainer: Slava Monich <slava.monich@jolla.com>
Build-Depends: debhelper (>= 7), libglib2.0-dev (>= 2.0), libglibutil (>= 1.0.35)
Build-Depends: debhelper (>= 8.1.3), libglib2.0-dev (>= 2.0), libglibutil (>= 1.0.35)
Standards-Version: 3.8.4

Package: libgbinder
Expand Down
3 changes: 0 additions & 3 deletions debian/libgbinder-dev.install

This file was deleted.

3 changes: 3 additions & 0 deletions debian/libgbinder-dev.install.in
@@ -0,0 +1,3 @@
debian/tmp/@LIBDIR@/libgbinder.so @LIBDIR@
debian/tmp/@LIBDIR@/pkgconfig/libgbinder.pc @LIBDIR@/pkgconfig
debian/tmp/usr/include/* usr/include
1 change: 0 additions & 1 deletion debian/libgbinder.install

This file was deleted.

1 change: 1 addition & 0 deletions debian/libgbinder.install.in
@@ -0,0 +1 @@
debian/tmp/@LIBDIR@/libgbinder.so.* @LIBDIR@
7 changes: 6 additions & 1 deletion debian/rules
Expand Up @@ -4,8 +4,13 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

override_dh_auto_build:
dh_auto_build -- LIBDIR=$(LIBDIR) release pkgconfig debian/libgbinder.install debian/libgbinder-dev.install

override_dh_auto_install:
dh_auto_install -- install-dev
dh_auto_install -- LIBDIR=$(LIBDIR) install-dev

%:
dh $@
6 changes: 3 additions & 3 deletions libgbinder.pc.in
@@ -1,10 +1,10 @@
name=gbinder
libdir=/usr/lib
libdir=@libdir@
includedir=/usr/include

Name: libgbinder
Description: Binder client library
Version: [version]
Requires: glib-2.0 libglibutil
Version: @version@
Requires.private: glib-2.0 libglibutil
Libs: -L${libdir} -l${name}
Cflags: -I${includedir} -I${includedir}/${name}
4 changes: 2 additions & 2 deletions rpm/libgbinder.spec
Expand Up @@ -29,11 +29,11 @@ This package contains the development library for %{name}.
%setup -q

%build
make KEEP_SYMBOLS=1 release pkgconfig
make LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release pkgconfig

%install
rm -rf %{buildroot}
make install-dev DESTDIR=%{buildroot}
make LIBDIR=%{_libdir} DESTDIR=%{buildroot} install-dev

%check
make -C unit test
Expand Down

0 comments on commit 92cd463

Please sign in to comment.