Skip to content

Commit

Permalink
Merge pull request #87 from ibm-genwqe/fixup_rpm_build
Browse files Browse the repository at this point in the history
Fixup rpm build
  • Loading branch information
fhaverkamp committed Feb 29, 2016
2 parents 25ac88a + a75fd4b commit f654842
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 22 deletions.
32 changes: 26 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,43 @@
V ?= 2

ifeq ($(V),0)
Q := @
MAKEFLAGS += --silent
MAKE += -s
Q := @
MAKEFLAGS += --silent
MAKE += -s
endif

ifeq ($(V),1)
MAKEFLAGS += --silent
MAKE += -s
MAKEFLAGS += --silent
MAKE += -s
endif

#
# If we can use git to get a version, we use that. If not, we have
# no repository and set a static version number.
#
HAS_GIT = $(shell git describe > /dev/null 2>&1 && echo y || echo n)

ifeq (${HAS_GIT},y)
VERSION ?= $(shell git describe --abbrev=4 --dirty --always --tags)
RPMVERSION ?= $(shell git describe --abbrev=0 --tags)
else
VERSION=4.0.11
RPMVERSION=$(VERSION)
endif

PLATFORM ?= $(shell uname -i)

distro = $(shell lsb_release -d | cut -f2)
subdirs += lib tools init
subdirs += lib tools
ifeq ($(PLATFORM),ppc64le)
subdirs += init
endif
targets += $(subdirs)

UDEV_RULES_D ?= /etc/udev/rules.d
MODPROBE_D ?= /etc/modprobe.d


all: $(targets)

tools: lib
Expand Down
5 changes: 1 addition & 4 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ STRIP = $(CROSS)strip
NM = $(CROSS)nm
HELP2MAN = help2man

VERSION=4.0.11
RPMVERSION=$(VERSION)

ifeq ($(V),0)
Q := @
MAKEFLAGS += --silent
Expand All @@ -52,7 +49,7 @@ else
CLEAN = echo -n
endif

PLATFORM = $(shell uname -i)
PLATFORM ?= $(shell uname -i)

CFLAGS = -W -Wall -Werror -Wwrite-strings -Wextra -Os -g \
-DGIT_VERSION=\"$(VERSION)\" \
Expand Down
7 changes: 4 additions & 3 deletions init/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2015, International Business Machines
# Copyright 2016, International Business Machines
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,13 +14,14 @@
# limitations under the License.
#

SYSTEMD_UNIT_DIR?=$(DESTDIR)/usr/lib/systemd/system
SYSTEMD_UNIT_DIR?=$(DESTDIR)/lib/systemd/system

all:
clean:

install:
install -D -m 644 genwqe_maint.service $(SYSTEMD_UNIT_DIR)/genwqe_maint.service
install -D -m 644 genwqe_maint.service \
$(SYSTEMD_UNIT_DIR)/genwqe_maint.service

uninstall:
-rm $(SYSTEMD_UNIT_DIR)/genwqe_maint.service
40 changes: 35 additions & 5 deletions spec/genwqe.spec
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,45 @@ GenWQE adapter VPD tools
%files -n genwqe-tools
%doc LICENSE
%defattr(0755,root,root)
%{_bindir}/genwqe_*
%{_bindir}/zlib_mt_perf
%{_bindir}/genwqe_mt_perf
%{_bindir}/genwqe_test_gz
%{_bindir}/genwqe/gunzip
%{_bindir}/genwqe/gzip
%{_bindir}/genwqe_echo
%{_bindir}/genwqe_ffdc
%{_bindir}/genwqe_gunzip
%{_bindir}/genwqe_gzip
%{_bindir}/genwqe_cksum
%{_bindir}/genwqe_memcopy
%{_bindir}/genwqe_mt_perf
%{_bindir}/genwqe_peek
%{_bindir}/genwqe_poke
%{_bindir}/genwqe_test_gz
%{_bindir}/genwqe_update
%{_bindir}/zlib_mt_perf

%{_mandir}/man1/genwqe_*.gz
%{_mandir}/man1/genwqe_echo.1.gz
%{_mandir}/man1/genwqe_ffdc.1.gz
%{_mandir}/man1/genwqe_gunzip.1.gz
%{_mandir}/man1/genwqe_gzip.1.gz
%{_mandir}/man1/genwqe_cksum.1.gz
%{_mandir}/man1/genwqe_memcopy.1.gz
%{_mandir}/man1/genwqe_peek.1.gz
%{_mandir}/man1/genwqe_poke.1.gz
%{_mandir}/man1/genwqe_update.1.gz
%{_mandir}/man1/zlib_mt_perf.1.gz

# Not yet working with help2man
#%{_mandir}/man1/genwqe_mt_perf.1.gz
#%{_mandir}/man1/genwqe_test_gz.1.gz

%ifarch ppc64le
%{_bindir}/genwqe_maint
%{_prefix}/lib/systemd/system/genwqe_maint.service
%{_bindir}/genwqe_loadtree
%{_mandir}/man1/genwqe_maint.1.gz
%{_mandir}/man1/genwqe_loadtree.1.gz
%endif


%files -n genwqe-zlib
%doc LICENSE
%defattr(0755,root,root)
Expand All @@ -100,6 +129,7 @@ GenWQE adapter VPD tools
%{_bindir}/genwqe_csv2vpd
%{_bindir}/genwqe_vpdconv
%{_bindir}/genwqe_vpdupdate

%{_mandir}/man1/genwqe_csv2vpd.1.gz
%{_mandir}/man1/genwqe_vpdconv.1.gz
%{_mandir}/man1/genwqe_vpdupdate.1.gz
Expand Down
9 changes: 6 additions & 3 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ zlib_mt_perf_libs = ../lib/libzADC.a -ldl # statically link our libz

projs = genwqe_update genwqe_gzip genwqe_gunzip zlib_mt_perf genwqe_memcopy \
genwqe_echo genwqe_peek genwqe_poke genwqe_cksum \
genwqe_vpdconv genwqe_vpdupdate genwqe_csv2vpd genwqe_loadtree \
genwqe_vpdconv genwqe_vpdupdate genwqe_csv2vpd \
genwqe_ffdc

# Do this only on platforms where we have a libcxl available e.g. System p
ifneq ($(CONFIG_LIBCXL_PATH),)
projs += genwqe_maint
projs += genwqe_maint genwqe_loadtree
endif

all: $(projs)
Expand All @@ -53,7 +53,7 @@ $(projs): $(libs)

objs = force_cpu.o genwqe_vpd_common.o $(projs:=.o)

manpages = $(projs:=.1)
manpages = $(projs:=.1.gz)

manpages: all $(manpages)

Expand All @@ -75,6 +75,9 @@ genwqe_gunzip.o: genwqe_gzip.c
%.1: %
$(HELP2MAN) -N --output=$@ --name "IBM Hardware Accelerator Tool." ./$<

%.1.gz: %.1
gzip --best -c $< > $@

#
# Tools for card maintenance
#
Expand Down
2 changes: 1 addition & 1 deletion tools/genwqe_test_gz
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export ZLIB_ACCELERATOR=GENWQE
export ZLIB_CARD=-1

# Directories used
INSTALL_DIR="/opt/genwqe" # Tool RPM install directory
INSTALL_DIR="/usr" # Tool RPM install directory
TOOLS_DIR="${INSTALL_DIR}/bin/genwqe" # gzip, gunzip install directory
TMP_DIR="/tmp" # Temporary directory to use
DATA_DIR="${TMP_DIR}/$$_testdata" # directory for testdata
Expand Down

0 comments on commit f654842

Please sign in to comment.