aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-01-15 15:48:55 +0000
committerDavid Howells <dhowells@redhat.com>2014-01-15 15:48:55 +0000
commitf20a78e894b89cb3971264dddc049111357e2030 (patch)
treec9dc6d4a188f5106096c4045b4d40c622cbe0bee
parented72a1dfc56a4f5428affb1659d6812d54e392c5 (diff)
downloadkeyutils-f20a78e894b89cb3971264dddc049111357e2030.tar.gz
spec: Use the correct path macros in the specfile
Use the correct path macros in the specfile. Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--Makefile15
-rw-r--r--keyutils.spec38
2 files changed, 36 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 2adcfba..17e4183 100644
--- a/Makefile
+++ b/Makefile
@@ -9,10 +9,11 @@ ETCDIR := /etc
BINDIR := /bin
SBINDIR := /sbin
SHAREDIR := /usr/share/keyutils
-MAN1 := /usr/share/man/man1
-MAN3 := /usr/share/man/man3
-MAN5 := /usr/share/man/man5
-MAN8 := /usr/share/man/man8
+MANDIR := /usr/share/man
+MAN1 := $(MANDIR)/man1
+MAN3 := $(MANDIR)/man3
+MAN5 := $(MANDIR)/man5
+MAN8 := $(MANDIR)/man8
INCLUDEDIR := /usr/include
LNS := ln -sf
@@ -52,12 +53,17 @@ LIBNAME := libkeyutils.so.$(APIVERSION)
# Guess at the appropriate lib directory and word size
#
###############################################################################
+ifeq ($(origin LIBDIR),undefined)
LIBDIR := $(shell ldd /usr/bin/make | grep '\(/libc\)' | sed -e 's!.*\(/.*\)/libc[.].*!\1!')
+endif
+ifeq ($(origin USRLIBDIR),undefined)
USRLIBDIR := $(patsubst /lib/%,/usr/lib/%,$(LIBDIR))
+endif
BUILDFOR := $(shell file /usr/bin/make | sed -e 's!.*ELF \(32\|64\)-bit.*!\1!')-bit
LNS := ln -sf
+ifeq ($(origin CFLAGS),undefined)
ifeq ($(BUILDFOR),32-bit)
CFLAGS += -m32
LIBDIR := /lib
@@ -69,6 +75,7 @@ LIBDIR := /lib64
USRLIBDIR := /usr/lib64
endif
endif
+endif
###############################################################################
#
diff --git a/keyutils.spec b/keyutils.spec
index b1ba3e8..19c92bf 100644
--- a/keyutils.spec
+++ b/keyutils.spec
@@ -1,8 +1,6 @@
%define vermajor 1
%define verminor 5.8
%define version %{vermajor}.%{verminor}
-%define libdir /%{_lib}
-%define usrlibdir %{_prefix}/%{_lib}
%define libapivermajor 1
%define libapiversion %{libapivermajor}.5
@@ -47,11 +45,19 @@ This package provides headers and libraries for building key utilities.
%prep
%setup -q
+%define datadir %{_datarootdir}/keyutils
+
%build
make \
NO_ARLIB=1 \
- LIBDIR=%{libdir} \
- USRLIBDIR=%{usrlibdir} \
+ ETCDIR=%{_sysconfdir} \
+ LIBDIR=%{_libdir} \
+ USRLIBDIR=%{_libdir} \
+ BINDIR=%{_bindir} \
+ SBINDIR=%{_sbindir} \
+ MANDIR=%{_mandir} \
+ INCLUDEDIR=%{_includedir} \
+ SHAREDIR=%{datadir} \
RELEASE=.%{release} \
NO_GLIBC_KEYERR=1 \
CFLAGS="-Wall $RPM_OPT_FLAGS -Werror"
@@ -61,8 +67,14 @@ rm -rf $RPM_BUILD_ROOT
make \
NO_ARLIB=1 \
DESTDIR=$RPM_BUILD_ROOT \
- LIBDIR=%{libdir} \
- USRLIBDIR=%{usrlibdir} \
+ ETCDIR=%{_sysconfdir} \
+ LIBDIR=%{_libdir} \
+ USRLIBDIR=%{_libdir} \
+ BINDIR=%{_bindir} \
+ SBINDIR=%{_sbindir} \
+ MANDIR=%{_mandir} \
+ INCLUDEDIR=%{_includedir} \
+ SHAREDIR=%{datadir} \
install
%clean
@@ -74,23 +86,23 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc README LICENCE.GPL
-/sbin/*
-/bin/*
-/usr/share/keyutils
+%{_sbindir}/*
+%{_bindir}/*
+%{datadir}
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
-%config(noreplace) /etc/*
+%config(noreplace) %{_sysconfdir}/*
%files libs
%defattr(-,root,root,-)
%doc LICENCE.LGPL
-%{libdir}/libkeyutils.so.%{libapiversion}
-%{libdir}/libkeyutils.so.%{libapivermajor}
+%{_libdir}/libkeyutils.so.%{libapiversion}
+%{_libdir}/libkeyutils.so.%{libapivermajor}
%files libs-devel
%defattr(-,root,root,-)
-%{usrlibdir}/libkeyutils.so
+%{_libdir}/libkeyutils.so
%{_includedir}/*
%{_mandir}/man3/*