forked from XSEDE/oauth-ssh
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.bootstrap
64 lines (54 loc) · 1.64 KB
/
Makefile.bootstrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
PKGS_PRE:= epel-release
PKGS:= git \
gcc \
autoconf \
automake \
cmake3 \
libcurl-devel \
openssl-devel \
json-c-devel \
pam-devel \
libtool \
rpm-build \
libtool-ltdl-devel
MISSING_PKGS_PRE:=$(shell \
for p in ${PKGS_PRE}; do \
rpm -q $$p > /dev/null || echo $$p; \
done)
MISSING_PKGS:=$(shell \
for p in ${PKGS}; do \
rpm -q $$p > /dev/null || echo $$p; \
done)
CMOCKA_VER:= 1.1.3
CMOCKA_SRC:= cmocka-$(CMOCKA_VER)
CMOCKA_TAR:= $(CMOCKA_SRC).tar.xz
CMOCKA_URL:= https://cmocka.org/files/1.1/$(CMOCKA_TAR)
CMOCKA_PRE:= $(shell pwd)/cmocka
CMOCKA_BUILD:=(mkdir $(CMOCKA_SRC)/build; \
cd $(CMOCKA_SRC)/build; \
cmake3 -DCMAKE_INSTALL_PREFIX=$(CMOCKA_PRE) -DCMAKE_BUILD_TYPE=Debug ..; \
make; \
make install)
CONFIGURE:=PKG_CONFIG_PATH=$(CMOCKA_PRE)/lib64/pkgconfig/ ./configure
all: help
help:
@echo "Usage: make [develop|release]"
setup:
[ -z "$(MISSING_PKGS_PRE)" ] || sudo yum install -y $(MISSING_PKGS_PRE)
[ -z "$(MISSING_PKGS)" ] || sudo yum install -y $(MISSING_PKGS)
[ -f $(CMOCKA_TAR) ] || curl -o $(CMOCKA_TAR) $(CMOCKA_URL)
[ -d $(CMOCKA_SRC) ] || tar xf $(CMOCKA_TAR)
[ -d $(CMOCKA_PRE) ] || $(CMOCKA_BUILD)
[ -f configure ] || autoreconf -i
[ -f Makefile ] || CFLAGS=$(CFLAGS) $(CONFIGURE)
make
#LD_LIBRARY_PATH=$(CMOCKA_PRE)/lib64:$(PWD)/src/pam/.libs make check
develop: CFLAGS='-DDEBUG -Wall -ggdb3'
develop: setup
release: CFLAGS='-O3'
release: setup
make dist
mkdir -p BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
cp oauth_ssh-*.tar.gz SOURCES
echo "%_topdir " `pwd` >> ~/.rpmmacros
rpmbuild -v -bb --clean packaging/fedora/oauth-ssh.spec