Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[gsupplicant] Respect arch specific lib dir. JB#49681
  • Loading branch information
monich committed May 27, 2020
1 parent b2c0e97 commit 8447abb
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@ debian/libgsupplicant
debian/libgsupplicant-dev
debian/*.debhelper.log
debian/*.debhelper
debian/*.install
debian/*.substvars
debian/tmp
documentation.list
Expand Down
26 changes: 18 additions & 8 deletions Makefile
Expand Up @@ -100,10 +100,7 @@ FULL_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS) -shared -Wl,-soname=$(LIB_SONAME) \
DEBUG_FLAGS = -g
RELEASE_FLAGS =

ifndef KEEP_SYMBOLS
KEEP_SYMBOLS = 0
endif

KEEP_SYMBOLS ?= 0
ifneq ($(KEEP_SYMBOLS),0)
RELEASE_FLAGS += -g
endif
Expand Down Expand Up @@ -140,6 +137,7 @@ endif
endif

$(GEN_FILES): | $(GEN_DIR)
$(PKGCONFIG): | $(BUILD_DIR)
$(DEBUG_OBJS): | $(DEBUG_BUILD_DIR)
$(RELEASE_OBJS): | $(RELEASE_BUILD_DIR)

Expand Down Expand Up @@ -185,6 +183,7 @@ clean:
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
make -C test cleaner
make -C tools/wpa-tool clean

Expand Down Expand Up @@ -242,8 +241,19 @@ $(DEBUG_BUILD_DIR)/$(LIB_SYMLINK2): $(DEBUG_LIB)
$(RELEASE_BUILD_DIR)/$(LIB_SYMLINK2): $(RELEASE_LIB)
ln -sf $(LIB) $@

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

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

#
# Install
Expand All @@ -253,9 +263,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/$(NAME)
INSTALL_PKGCONFIG_DIR = $(DESTDIR)/usr/lib/pkgconfig
INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(ABS_LIBDIR)/pkgconfig

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

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

This file was deleted.

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

This file was deleted.

1 change: 1 addition & 0 deletions debian/libgsupplicant.install.in
@@ -0,0 +1 @@
debian/tmp/@LIBDIR@/libgsupplicant.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/libgsupplicant.install debian/libgsupplicant-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 libgsupplicant.pc.in
@@ -1,10 +1,10 @@
name=gsupplicant
libdir=/usr/lib
libdir=@libdir@
includedir=/usr/include

Name: libgsupplicant
Description: Client library for wpa_supplicant
Version: [version]
Requires: glib-2.0 gio-2.0 libglibutil
Version: @version@
Requires.private: glib-2.0 gio-2.0 libglibutil
Libs: -L${libdir} -l${name}
Cflags: -I${includedir} -I${includedir}/${name}
6 changes: 3 additions & 3 deletions rpm/libgsupplicant.spec
Expand Up @@ -4,7 +4,7 @@ Release: 0
Summary: Client library for wpa_supplicant
Group: Development/Libraries
License: BSD
URL: https://git.merproject.org/mer-core/libgsupplicant
URL: https://git.sailfishos.org/mer-core/libgsupplicant
Source: %{name}-%{version}.tar.bz2

%define libglibutil_version 1.0.21
Expand All @@ -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

%check
make -C test test
Expand Down

0 comments on commit 8447abb

Please sign in to comment.