Skip to content

Commit 5833036

Browse files
committed
Initial RPM packaging support
1 parent a43f4f5 commit 5833036

3 files changed

Lines changed: 108 additions & 0 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ report/
1919
IDE/Android/.idea/deploymentTargetDropDown.xml
2020
IDE/Android/app/.cxx/
2121
IDE/Android/app/src/main/cpp/wolfssl/
22+
23+
# RPM package files
24+
rpm/spec
25+
*.rpm

Makefile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
NAME = wolfssl-jni-jsse
2+
VERSION = $(shell grep 'name="implementation.version"' build.xml | sed -re 's/.*value="(.+)".*/\1/')
3+
DIST_FILES = build.xml COPYING docs examples IDE java.sh lib LICENSING Makefile native platform \
4+
README.md rpm src
5+
6+
ifneq ($(PREFIX),)
7+
INSTALL_DIR = $(DESTDIR)$(PREFIX)
8+
else
9+
INSTALL_DIR = $(DESTDIR)/usr/local
10+
endif
11+
12+
ifeq ($(INSTALL),)
13+
INSTALL=install
14+
endif
15+
16+
ifeq ($(LIBDIR),)
17+
LIBDIR=lib
18+
endif
19+
20+
21+
all: build
22+
23+
build:
24+
./java.sh
25+
ant
26+
27+
install:
28+
$(INSTALL) -d $(INSTALL_DIR)/$(LIBDIR)
29+
$(INSTALL) lib/libwolfssljni.so $(INSTALL_DIR)/$(LIBDIR)
30+
$(INSTALL) lib/wolfssl.jar $(INSTALL_DIR)/$(LIBDIR)
31+
$(INSTALL) lib/wolfssl-jsse.jar $(INSTALL_DIR)/$(LIBDIR)
32+
33+
uninstall:
34+
rm -f $(INSTALL_DIR)/$(LIBDIR)/libwolfssljni.so
35+
rm -f $(INSTALL_DIR)/share/java/wolfssl.jar
36+
rm -f $(INSTALL_DIR)/share/java/wolfssl-jsse.jar
37+
38+
dist:
39+
@mkdir -p "$(NAME)-$(VERSION)"
40+
@cp -pr $(DIST_FILES) "$(NAME)-$(VERSION)"
41+
tar -zcf "$(NAME)-$(VERSION).tar.gz" "$(NAME)-$(VERSION)"
42+
@rm -rf "$(NAME)-$(VERSION)"
43+
44+
rpm: dist
45+
@rm -f *.rpm
46+
rpmdev-setuptree
47+
find ~/rpmbuild/RPMS ~/rpmbuild/SRPMS -name "$(PACKAGE)-$(VERSION)*.rpm" | xargs rm -f
48+
@cp "$(NAME)-$(VERSION).tar.gz" ~/rpmbuild/SOURCES/
49+
@cp rpm/spec.in rpm/spec
50+
@sed -i rpm/spec -e "s/@NAME@/$(NAME)/g"
51+
@sed -i rpm/spec -e "s/@VERSION@/$(VERSION)/g"
52+
rpmbuild -ba --clean rpm/spec
53+
@cp ~/rpmbuild/RPMS/*/$(NAME)-$(VERSION)*.rpm .
54+
@cp ~/rpmbuild/SRPMS/$(NAME)-$(VERSION)*.rpm .

rpm/spec.in

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Name: @NAME@
2+
Version: @VERSION@
3+
Release: 1
4+
Summary: wolfSSL JSSE Provider and JNI Wrapper
5+
6+
License: GPLv2
7+
URL: http://www.wolfssl.com/
8+
Source0: @NAME@-@VERSION@.tar.gz
9+
10+
BuildRequires: ant
11+
12+
# Don't add wolfSSL to dependency list. User may want to
13+
# use a version outside of RPM.
14+
%global __requires_exclude ^libwolfssl.*$
15+
16+
17+
%description
18+
This package contains the libraries for %{name}.
19+
20+
21+
# Don't generate the debug sources
22+
%define debug_package %{nil}
23+
24+
25+
%prep
26+
%autosetup
27+
28+
29+
%build
30+
%make_build
31+
32+
33+
%install
34+
%make_install LIBDIR=%{_lib} PREFIX=%{_prefix}
35+
36+
37+
%clean
38+
%{__rm} -rf %{buildroot}
39+
40+
41+
%files
42+
%{_libdir}/libwolfssljni.so
43+
%{_libdir}/wolfssl.jar
44+
%{_libdir}/wolfssl-jsse.jar
45+
46+
47+
%changelog
48+
* Fri Nov 18 2022 Juliusz Sosinowicz <juliusz@wolfssl.com>
49+
- Initial package
50+

0 commit comments

Comments
 (0)