Skip to content

Commit 70c16aa

Browse files
authored
Merge pull request #199 from julek-wolfssl/rpm
rpmbuild: Initial support
2 parents 6858852 + cd5eb22 commit 70c16aa

File tree

5 files changed

+123
-1
lines changed

5 files changed

+123
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ test.aps
6565
.cproject
6666
.project
6767
.settings
68+
69+
rpm/spec

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ include test/include.am
2020
include scripts/include.am
2121
include windows/include.am
2222
include examples/include.am
23+
include rpm/include.am
2324

2425
noinst_PROGRAMS += bench
2526
bench_SOURCES = bench.c

configure.ac

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@ USER_CFLAGS="$CFLAGS"
2525
AC_PROG_CC
2626
AC_LANG(C)
2727

28+
WOLFENGINE_CONFIG_ARGS=$ac_configure_args
29+
AC_SUBST([WOLFENGINE_CONFIG_ARGS])
30+
2831
# shared library versioning
32+
# The three numbers in the libwolfengine.so.*.*.* file name. Unfortunately
33+
# these numbers don't always line up nicely with the library version.
34+
WOLFENGINE_LIBRARY_VERSION_FIRST=1
35+
WOLFENGINE_LIBRARY_VERSION_SECOND=0
36+
WOLFENGINE_LIBRARY_VERSION_THIRD=2
2937
WOLFENGINE_LIBRARY_VERSION=1:2:0
3038
# | | |
3139
# +------+ | +---+
@@ -39,6 +47,9 @@ WOLFENGINE_LIBRARY_VERSION=1:2:0
3947
# | set to zero if current is incremented
4048
# +- increment if interfaces have been added, removed or changed
4149
AC_SUBST([WOLFENGINE_LIBRARY_VERSION])
50+
AC_SUBST([WOLFENGINE_LIBRARY_VERSION_FIRST])
51+
AC_SUBST([WOLFENGINE_LIBRARY_VERSION_SECOND])
52+
AC_SUBST([WOLFENGINE_LIBRARY_VERSION_THIRD])
4253

4354
LIBS="$LIBS -ldl"
4455

@@ -710,7 +721,8 @@ AC_SUBST([AM_CPPFLAGS])
710721
AC_SUBST([AM_CFLAGS])
711722
AC_SUBST([AM_LDFLAGS])
712723

713-
AC_CONFIG_FILES([Makefile])
724+
AC_CONFIG_FILES([Makefile
725+
rpm/spec])
714726
AC_OUTPUT
715727

716728
# force make clean

rpm/include.am

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
rpm-build: rpm/spec dist
2+
@rm -f *.rpm
3+
rpmdev-setuptree
4+
find ~/rpmbuild/RPMS ~/rpmbuild/SRPMS -name "$(PACKAGE)-$(VERSION)*.rpm" | xargs rm -f
5+
@cp $(PACKAGE)-$(VERSION).tar.gz ~/rpmbuild/SOURCES/
6+
@rpmbuild -ba --clean rpm/spec
7+
@cp ~/rpmbuild/RPMS/*/$(PACKAGE)-$(VERSION)*.rpm .
8+
@cp ~/rpmbuild/RPMS/*/$(PACKAGE)-devel-$(VERSION)*.rpm .
9+
@cp ~/rpmbuild/RPMS/*/$(PACKAGE)-debuginfo-$(VERSION)*.rpm .
10+
@cp ~/rpmbuild/SRPMS/$(PACKAGE)-$(VERSION)*.rpm .
11+
12+
rpm-sign: rpm-build
13+
@rpm --addsign *.rpm
14+
@rpm --checksig *.rpm
15+
16+
clean-rpm:
17+
@rm -f *.tar.gz
18+
@rm -f *.src.rpm
19+
@rm -f *.rpm
20+
21+
rpm: rpm-build
22+
23+
release: rpm-sign
24+
25+
auto-rpmbuild:
26+
@auto-br-rpmbuild -ba rpm/spec
27+
28+

rpm/spec.in

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Name: @PACKAGE@
2+
Version: @VERSION@
3+
Release: 1
4+
Summary: wolfCrypt and wolfCrypt FIPS engine for OpenSSL
5+
6+
License: GPLv3
7+
URL: http://www.wolfssl.com/
8+
Source0: @PACKAGE@-@[email protected]
9+
10+
BuildRequires: gcc
11+
BuildRequires: glibc
12+
BuildRequires: glibc-common
13+
BuildRequires: glibc-devel
14+
BuildRequires: glibc-headers
15+
BuildRequires: make
16+
BuildRequires: pkgconfig
17+
BuildRequires: sed
18+
BuildRequires: tar
19+
20+
21+
# Don't add wolfSSL and OpenSSL to dependency list. User may want to
22+
# use a version outside of RPM.
23+
%global __requires_exclude ^lib(wolfssl|ssl|crypto).*$
24+
25+
26+
%description
27+
This package contains the header files and development libraries
28+
for %{name}. If you like to develop programs using %{name},
29+
you will need to install %{name}-devel.
30+
31+
32+
%package devel
33+
Summary: Header files and development libraries for %{name}
34+
Group: Development/Libraries
35+
Requires: %{name} = %{version}-%{release}
36+
37+
%description devel
38+
This package contains the header files and development libraries
39+
for %{name}. If you like to develop programs using %{name},
40+
you will need to install %{name}-devel.
41+
42+
43+
%prep
44+
%setup
45+
46+
47+
%build
48+
%configure @WOLFENGINE_CONFIG_ARGS@
49+
%make_build
50+
51+
52+
%install
53+
%make_install
54+
%{__rm} -f %{buildroot}/%{_libdir}/libwolfengine.la
55+
56+
57+
%clean
58+
%{__rm} -rf %{buildroot}
59+
60+
61+
%files
62+
%doc ChangeLog.md COPYING INSTALL README.md
63+
64+
%{_libdir}/libwolfengine.so
65+
%{_libdir}/libwolfengine.so.@WOLFENGINE_LIBRARY_VERSION_FIRST@
66+
%{_libdir}/libwolfengine.so.@WOLFENGINE_LIBRARY_VERSION_FIRST@.@WOLFENGINE_LIBRARY_VERSION_SECOND@.@WOLFENGINE_LIBRARY_VERSION_THIRD@
67+
68+
69+
%files devel
70+
%{_includedir}/wolfengine/we_fips.h
71+
%{_includedir}/wolfengine/we_logging.h
72+
%{_includedir}/wolfengine/we_visibility.h
73+
%{_includedir}/wolfengine/we_wolfengine.h
74+
75+
76+
77+
%changelog
78+
* Mon Oct 17 2022 Juliusz Sosinowicz <[email protected]>
79+
- Initial package

0 commit comments

Comments
 (0)