[build] Support for multiple archs. JB#49681
Fixes Debian build and path in libglibutil.pc
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,9 +6,11 @@ test/coverage/libglibutil.gcov
|
||||
test/coverage/results
|
||||
debian/files
|
||||
debian/libglibutil-dev.debhelper.log
|
||||
debian/libglibutil-dev.install
|
||||
debian/libglibutil-dev.substvars
|
||||
debian/libglibutil-dev
|
||||
debian/libglibutil.debhelper.log
|
||||
debian/libglibutil.install
|
||||
debian/libglibutil.postinst.debhelper
|
||||
debian/libglibutil.postrm.debhelper
|
||||
debian/libglibutil.substvars
|
||||
|
||||
28
Makefile
28
Makefile
@@ -70,10 +70,7 @@ COVERAGE_BUILD_DIR = $(BUILD_DIR)/coverage
|
||||
# Tools and flags
|
||||
#
|
||||
|
||||
ifndef CC
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
endif
|
||||
|
||||
CC ?= $(CROSS_COMPILE)gcc
|
||||
LD = $(CC)
|
||||
WARNINGS = -Wall
|
||||
INCLUDES = -I$(INCLUDE_DIR)
|
||||
@@ -86,10 +83,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
|
||||
@@ -164,6 +158,7 @@ clean:
|
||||
rm -fr debian/tmp debian/libglibutil debian/libglibutil-dev
|
||||
rm -f documentation.list debian/files debian/*.substvars
|
||||
rm -f debian/*.debhelper.log debian/*.debhelper debian/*~
|
||||
rm -fr debian/*.install
|
||||
|
||||
test:
|
||||
make -C test test
|
||||
@@ -221,9 +216,6 @@ $(RELEASE_STATIC_LIB): $(RELEASE_OBJS)
|
||||
$(COVERAGE_STATIC_LIB): $(COVERAGE_OBJS)
|
||||
$(AR) rc $@ $?
|
||||
|
||||
$(PKGCONFIG): $(LIB_NAME).pc.in
|
||||
sed -e 's/\[version\]/'$(PCVERSION)/g $< > $@
|
||||
|
||||
#
|
||||
# Install
|
||||
#
|
||||
@@ -234,9 +226,19 @@ INSTALL = install
|
||||
INSTALL_DIRS = $(INSTALL) -d
|
||||
INSTALL_FILES = $(INSTALL) -m $(INSTALL_PERM)
|
||||
|
||||
INSTALL_LIB_DIR = $(DESTDIR)$(libdir)
|
||||
# This one could be substituted with arch specific dir
|
||||
LIBDIR ?= /usr/lib
|
||||
ABS_LIBDIR = $(shell echo /$(LIBDIR) | sed -r 's|/+|/|g')
|
||||
|
||||
INSTALL_LIB_DIR = $(DESTDIR)$(ABS_LIBDIR)
|
||||
INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/gutil
|
||||
INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(libdir)/pkgconfig
|
||||
INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(ABS_LIBDIR)/pkgconfig
|
||||
|
||||
$(PKGCONFIG): $(LIB_NAME).pc.in
|
||||
sed -e 's|@version@|$(PCVERSION)|g' -e 's|@libdir@|$(ABS_LIBDIR)|' $< > $@
|
||||
|
||||
debian/%.install: debian/%.install.in
|
||||
sed 's|@LIBDIR@|$(LIBDIR)|g' $< > $@
|
||||
|
||||
install: $(INSTALL_LIB_DIR)
|
||||
$(INSTALL_FILES) $(RELEASE_LIB) $(INSTALL_LIB_DIR)
|
||||
|
||||
2
debian/control
vendored
2
debian/control
vendored
@@ -2,7 +2,7 @@ Source: libglibutil
|
||||
Section: libs
|
||||
Priority: optional
|
||||
Maintainer: Slava Monich <slava.monich@jolla.com>
|
||||
Build-Depends: debhelper (>= 7), libglib2.0-dev (>= 2.0)
|
||||
Build-Depends: debhelper (>= 8.1.3), libglib2.0-dev (>= 2.0)
|
||||
Standards-Version: 3.8.4
|
||||
|
||||
Package: libglibutil
|
||||
|
||||
3
debian/libglibutil-dev.install
vendored
3
debian/libglibutil-dev.install
vendored
@@ -1,3 +0,0 @@
|
||||
debian/tmp/usr/lib/libglibutil.so usr/lib
|
||||
include/*.h usr/include/gutil
|
||||
build/libglibutil.pc usr/lib/pkgconfig
|
||||
3
debian/libglibutil-dev.install.in
vendored
Normal file
3
debian/libglibutil-dev.install.in
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
debian/tmp/@LIBDIR@/libglibutil.so @LIBDIR@
|
||||
debian/tmp/@LIBDIR@/pkgconfig/libglibutil.pc @LIBDIR@/pkgconfig
|
||||
debian/tmp/usr/include/* usr/include/
|
||||
1
debian/libglibutil.install
vendored
1
debian/libglibutil.install
vendored
@@ -1 +0,0 @@
|
||||
debian/tmp/usr/lib/libglibutil.so.* usr/lib
|
||||
1
debian/libglibutil.install.in
vendored
Normal file
1
debian/libglibutil.install.in
vendored
Normal file
@@ -0,0 +1 @@
|
||||
debian/tmp/@LIBDIR@/libglibutil.so.* @LIBDIR@
|
||||
7
debian/rules
vendored
7
debian/rules
vendored
@@ -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/libglibutil.install debian/libglibutil-dev.install
|
||||
|
||||
override_dh_auto_install:
|
||||
dh_auto_install -- install-dev
|
||||
dh_auto_install -- LIBDIR=$(LIBDIR) install-dev
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
name=glibutil
|
||||
libdir=/usr/lib
|
||||
libdir=@libdir@
|
||||
includedir=/usr/include
|
||||
|
||||
Name: libglibutil
|
||||
Description: Library of glib utilities
|
||||
Version: [version]
|
||||
Version: @version@
|
||||
Requires.private: glib-2.0
|
||||
Libs: -L${libdir} -l${name}
|
||||
Cflags: -I${includedir} -I${includedir}/gutil
|
||||
|
||||
@@ -25,11 +25,11 @@ This package contains the development library for %{name}.
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
make libdir=%{_libdir} KEEP_SYMBOLS=1 release pkgconfig
|
||||
make LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release pkgconfig
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
make libdir=%{_libdir} install-dev DESTDIR=%{buildroot}
|
||||
make LIBDIR=%{_libdir} DESTDIR=%{buildroot} install-dev
|
||||
|
||||
%check
|
||||
make -C test test
|
||||
|
||||
Reference in New Issue
Block a user