Skip to content

Commit

Permalink
[build] Pass _unitdir to makefile. JB#50027
Browse files Browse the repository at this point in the history
To make sure that the one used by makefile matches the build environment.
  • Loading branch information
monich committed Jul 6, 2020
1 parent 2d507b7 commit 57cefbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rpm/nfcd.spec
Expand Up @@ -54,7 +54,7 @@ make LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release pkgconfig
%define settings_dir %{_sharedstatedir}/nfcd/
%define settings_file %{settings_dir}/settings
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} LIBDIR=%{_libdir}
make install DESTDIR=%{buildroot} LIBDIR=%{_libdir} UNITDIR=%{_unitdir}
install -d -m 0700 %{buildroot}/%{settings_dir}
mkdir -p %{buildroot}/%{target_wants_dir}
ln -s ../nfcd.service %{buildroot}/%{target_wants_dir}/nfcd.service
Expand Down
5 changes: 4 additions & 1 deletion src/Makefile
Expand Up @@ -182,11 +182,14 @@ endif
# Install
#

UNITDIR ?= usr/lib/systemd/system
ABS_UNITDIR := $(shell echo /$(UNITDIR) | sed -r 's|/+|/|g')

INSTALL = install
INSTALL_DIRS = $(INSTALL) -d

INSTALL_SBIN_DIR = $(DESTDIR)/usr/sbin
INSTALL_SYSTEMD_DIR = $(DESTDIR)/usr/lib/systemd/system
INSTALL_SYSTEMD_DIR = $(DESTDIR)$(ABS_UNITDIR)

install: $(RELEASE_EXE) $(INSTALL_SBIN_DIR) $(INSTALL_SYSTEMD_DIR)
$(INSTALL) -m 644 nfcd.service "$(INSTALL_SYSTEMD_DIR)"
Expand Down

0 comments on commit 57cefbf

Please sign in to comment.