[gbinder-radio] Respect arch specific lib dir. JB#49681

This commit is contained in:
Slava Monich
2020-06-02 20:26:33 +03:00
parent 7e4b839fc6
commit 94d469380e
9 changed files with 39 additions and 25 deletions

10
.gitignore vendored
View File

@@ -1,13 +1,11 @@
*~
debian/files
debian/libgbinder-radio-dev.debhelper.log
debian/libgbinder-radio-dev.substvars
debian/libgbinder-radio-dev
debian/libgbinder-radio.debhelper.log
debian/libgbinder-radio.postinst.debhelper
debian/libgbinder-radio.postrm.debhelper
debian/libgbinder-radio.substvars
debian/libgbinder-radio
debian/*.debhelper.log
debian/*.debhelper
debian/*.substvars
debian/*.install
debian/tmp
documentation.list
installroot

View File

@@ -78,10 +78,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
@@ -144,6 +141,10 @@ pkgconfig: $(PKGCONFIG)
clean:
rm -f *~ $(SRC_DIR)/*~ $(INCLUDE_DIR)/*~
rm -fr $(BUILD_DIR) RPMS installroot
rm -fr debian/tmp debian/libgbinder-radio debian/libgbinder-radio-dev
rm -f documentation.list debian/files debian/*.substvars
rm -f debian/*.debhelper.log debian/*.debhelper debian/*~
rm -f debian/*.install
$(BUILD_DIR):
mkdir -p $@
@@ -189,8 +190,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
@@ -198,15 +210,14 @@ $(PKGCONFIG): $(LIB_NAME).pc.in Makefile
INSTALL = install
INSTALL_DIRS = $(INSTALL) -d
INSTALL_LIBS = $(INSTALL) -m 755
INSTALL_FILES = $(INSTALL) -m 644
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_LIBS) $(RELEASE_SO) $(INSTALL_LIB_DIR)
$(INSTALL_FILES) $(RELEASE_SO) $(INSTALL_LIB_DIR)
ln -sf $(LIB_SO) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK2)
ln -sf $(LIB_SYMLINK2) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK1)

View File

@@ -1,3 +0,0 @@
debian/tmp/usr/lib/libgbinder-radio.so usr/lib
include/*.h usr/include/gbinder-radio
build/libgbinder-radio.pc usr/lib/pkgconfig

View File

@@ -0,0 +1,3 @@
debian/tmp/@LIBDIR@/libgbinder-radio.so @LIBDIR@
debian/tmp/@LIBDIR@/pkgconfig/libgbinder-radio.pc @LIBDIR@/pkgconfig
debian/tmp/usr/include/* usr/include

View File

@@ -1 +0,0 @@
debian/tmp/usr/lib/libgbinder-radio.so.* usr/lib

1
debian/libgbinder-radio.install.in vendored Normal file
View File

@@ -0,0 +1 @@
debian/tmp/@LIBDIR@/libgbinder-radio.so.* @LIBDIR@

7
debian/rules vendored
View File

@@ -2,8 +2,13 @@
# Uncomment to enable verbose build
#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-radio.install debian/libgbinder-radio-dev.install
override_dh_auto_install:
dh_auto_install -- install-dev
dh_auto_install -- LIBDIR=$(LIBDIR) install-dev
%:
dh $@

View File

@@ -1,10 +1,10 @@
name=gbinder-radio
libdir=/usr/lib
libdir=@libdir@
includedir=/usr/include
Name: libgbinder-radio
Description: Binder client library for Android radio interfaces
Version: [version]
Requires: glib-2.0 libglibutil libgbinder
Version: @version@
Requires.private: glib-2.0 libglibutil libgbinder
Libs: -L${libdir} -l${name}
Cflags: -I${includedir} -I${includedir}/${name}

View File

@@ -31,11 +31,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
%post -p /sbin/ldconfig