-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile
54 lines (44 loc) · 1.43 KB
/
Makefile
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
NAME = wolfssl-jni-jsse
VERSION = $(shell grep 'name="implementation.version"' build.xml | sed -re 's/.*value="(.+)".*/\1/')
DIST_FILES = build.xml COPYING docs examples IDE java.sh lib LICENSING Makefile native platform \
README.md rpm src
ifneq ($(PREFIX),)
INSTALL_DIR = $(DESTDIR)$(PREFIX)
else
INSTALL_DIR = $(DESTDIR)/usr/local
endif
ifeq ($(INSTALL),)
INSTALL=install
endif
ifeq ($(LIBDIR),)
LIBDIR=lib
endif
all: build
build:
./java.sh
ant
install:
$(INSTALL) -d $(INSTALL_DIR)/$(LIBDIR)
$(INSTALL) lib/libwolfssljni.so $(INSTALL_DIR)/$(LIBDIR)
$(INSTALL) lib/wolfssl.jar $(INSTALL_DIR)/$(LIBDIR)
$(INSTALL) lib/wolfssl-jsse.jar $(INSTALL_DIR)/$(LIBDIR)
uninstall:
rm -f $(INSTALL_DIR)/$(LIBDIR)/libwolfssljni.so
rm -f $(INSTALL_DIR)/share/java/wolfssl.jar
rm -f $(INSTALL_DIR)/share/java/wolfssl-jsse.jar
dist:
@mkdir -p "$(NAME)-$(VERSION)"
@cp -pr $(DIST_FILES) "$(NAME)-$(VERSION)"
tar -zcf "$(NAME)-$(VERSION).tar.gz" "$(NAME)-$(VERSION)"
@rm -rf "$(NAME)-$(VERSION)"
rpm: dist
@rm -f *.rpm
rpmdev-setuptree
find ~/rpmbuild/RPMS ~/rpmbuild/SRPMS -name "$(PACKAGE)-$(VERSION)*.rpm" | xargs rm -f
@cp "$(NAME)-$(VERSION).tar.gz" ~/rpmbuild/SOURCES/
@cp rpm/spec.in rpm/spec
@sed -i rpm/spec -e "s/@NAME@/$(NAME)/g"
@sed -i rpm/spec -e "s/@VERSION@/$(VERSION)/g"
rpmbuild -ba --clean rpm/spec
@cp ~/rpmbuild/RPMS/*/$(NAME)-$(VERSION)*.rpm .
@cp ~/rpmbuild/SRPMS/$(NAME)-$(VERSION)*.rpm .