Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[libmce-glib] Respect arch specific lib dir. JB#49681
  • Loading branch information
monich committed May 24, 2020
1 parent c60c134 commit dcfa3ff
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@ debian/libmce-glib
debian/libmce-glib-dev
debian/*.debhelper.log
debian/*.debhelper
debian/*.install
debian/*.substvars
debian/tmp
documentation.list
Expand Down
20 changes: 13 additions & 7 deletions Makefile
Expand Up @@ -133,14 +133,13 @@ debug: $(DEBUG_LIB) $(DEBUG_LINK)

release: $(RELEASE_LIB) $(RELEASE_LINK)

pkgconfig: $(PKGCONFIG)

clean:
rm -f *~ $(SRC_DIR)/*~ $(INCLUDE_DIR)/*~ rpm/*~
rm -fr $(BUILD_DIR) RPMS installroot
rm -fr debian/tmp debian/lib$(NAME) debian/lib$(NAME)-dev
rm -f documentation.list debian/files debian/*.substvars
rm -f debian/*.debhelper.log debian/*.debhelper debian/*~
rm -f debian/*.install

$(GEN_DIR):
mkdir -p $@
Expand Down Expand Up @@ -181,8 +180,17 @@ $(DEBUG_LINK):
$(RELEASE_LINK):
ln -sf $(LIB) $@

# This one could be substituted with arch specific dir
LIBDIR ?= /usr/lib
ABS_LIBDIR := $(shell echo /$(LIBDIR) | sed -r 's|/+|/|g')

pkgconfig: $(PKGCONFIG)

$(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 @@ -192,11 +200,9 @@ INSTALL = install
INSTALL_DIRS = $(INSTALL) -d
INSTALL_FILES = $(INSTALL) -m 644

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

INSTALL_ALIAS = $(INSTALL_LIB_DIR)/$(LIB_SHORTCUT)
INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(ABS_LIBDIR)/pkgconfig

install: $(INSTALL_LIB_DIR)
$(INSTALL_FILES) $(RELEASE_LIB) $(INSTALL_LIB_DIR)
Expand Down
4 changes: 2 additions & 2 deletions debian/control
Expand Up @@ -2,13 +2,13 @@ Source: libmce-glib
Section: libs
Priority: optional
Maintainer: Slava Monich <slava.monich@jolla.com>
Build-Depends: debhelper (>= 7), libglib2.0-dev (>= 2.0), libglibutil-dev, mce-dev
Build-Depends: debhelper (>= 8.1.3), libglib2.0-dev (>= 2.0), libglibutil-dev, mce-dev
Standards-Version: 3.8.4

Package: libmce-glib
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Depends: libglibutil (>= 1.0.5), ${shlibs:Depends}, ${misc:Depends}
Description: Client library for mce

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

This file was deleted.

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

This file was deleted.

1 change: 1 addition & 0 deletions debian/libmce-glib.install.in
@@ -0,0 +1 @@
debian/tmp/@LIBDIR@/libmce-glib.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/libmce-glib.install debian/libmce-glib-dev.install

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

%:
dh $@
4 changes: 2 additions & 2 deletions libmce-glib.pc.in
@@ -1,9 +1,9 @@
libdir=/usr/lib
libdir=@libdir@
includedir=/usr/include

Name: libmce-glib
Description: MCE client library
Version: [version]
Version: @version@
Requires.private: libglibutil glib-2.0 gio-2.0
Libs: -lmce-glib
Cflags: -I${includedir}/libmce-glib
4 changes: 2 additions & 2 deletions rpm/libmce-glib.spec
Expand Up @@ -28,11 +28,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

Expand Down

0 comments on commit dcfa3ff

Please sign in to comment.