From 1be873533e1f9c1d745acba3db04c28b7035c217 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Sat, 20 Oct 2012 04:42:34 -0400 Subject: [PATCH] This adds support for "make rpm" --- Makefile.am | 10 +-- certs/include.am | 2 +- configure.ac | 1 + doc/include.am | 2 +- examples/client/include.am | 2 +- examples/echoclient/include.am | 2 +- examples/echoserver/include.am | 2 +- examples/server/include.am | 2 +- m4/ax_harden_compiler_flags.m4 | 8 +- rpm/include.am | 37 +++++++++ rpm/spec.in | 144 +++++++++++++++++++++++++++++++++ 11 files changed, 197 insertions(+), 15 deletions(-) create mode 100644 rpm/include.am create mode 100644 rpm/spec.in diff --git a/Makefile.am b/Makefile.am index 0a30c8859..b3414841a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,13 +15,10 @@ check_PROGRAMS = EXTRA_HEADERS = BUILT_SOURCES= EXTRA_DIST= -doc_DATA= +dist_doc_DATA= -exampledir = $(docdir)/@PACKAGE@/example -example_DATA= -EXTRA_DIST+= $(example_DATA) - -EXTRA_DIST+= $(doc_DATA) +exampledir = $(docdir)/example +dist_example_DATA= ACLOCAL_AMFLAGS= -I m4 @@ -50,6 +47,7 @@ include examples/echoserver/include.am include testsuite/include.am include tests/include.am include sslSniffer/sslSnifferTest/include.am +include rpm/include.am TESTS += $(check_PROGRAMS) test: check diff --git a/certs/include.am b/certs/include.am index fcedd005b..197ebc46c 100644 --- a/certs/include.am +++ b/certs/include.am @@ -34,7 +34,7 @@ EXTRA_DIST += \ certs/ecc-key.der -doc_DATA+= certs/taoCert.txt +dist_doc_DATA+= certs/taoCert.txt EXTRA_DIST+= certs/ntru-key.raw diff --git a/configure.ac b/configure.ac index 3858966fc..28f8cace3 100644 --- a/configure.ac +++ b/configure.ac @@ -692,6 +692,7 @@ AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([cyassl/version.h]) AC_CONFIG_FILES([support/libcyassl.pc]) +AC_CONFIG_FILES([rpm/spec]) AC_OUTPUT diff --git a/doc/include.am b/doc/include.am index fa44fcf8f..5bef623aa 100644 --- a/doc/include.am +++ b/doc/include.am @@ -2,4 +2,4 @@ # included from Top Level Makefile.am # All paths should be given relative to the root -doc_DATA+= doc/README.txt +dist_doc_DATA+= doc/README.txt diff --git a/examples/client/include.am b/examples/client/include.am index 4773cc8a1..f902fbeef 100644 --- a/examples/client/include.am +++ b/examples/client/include.am @@ -10,4 +10,4 @@ EXTRA_DIST += examples/client/client.sln EXTRA_DIST += examples/client/client-ntru.vcproj EXTRA_DIST += examples/client/client.vcproj -example_DATA+= examples/client/client.c +dist_example_DATA+= examples/client/client.c diff --git a/examples/echoclient/include.am b/examples/echoclient/include.am index 37592d158..ed35bffe9 100644 --- a/examples/echoclient/include.am +++ b/examples/echoclient/include.am @@ -12,4 +12,4 @@ EXTRA_DIST += examples/echoclient/echoclient.sln EXTRA_DIST += examples/echoclient/echoclient-ntru.vcproj EXTRA_DIST += examples/echoclient/echoclient.vcproj -example_DATA+= examples/echoclient/echoclient.c +dist_example_DATA+= examples/echoclient/echoclient.c diff --git a/examples/echoserver/include.am b/examples/echoserver/include.am index 6e031e063..f5ba8b6c1 100644 --- a/examples/echoserver/include.am +++ b/examples/echoserver/include.am @@ -12,4 +12,4 @@ EXTRA_DIST += examples/echoserver/echoserver.sln EXTRA_DIST += examples/echoserver/echoserver-ntru.vcproj EXTRA_DIST += examples/echoserver/echoserver.vcproj -example_DATA+= examples/echoserver/echoserver.c +dist_example_DATA+= examples/echoserver/echoserver.c diff --git a/examples/server/include.am b/examples/server/include.am index c54eb9135..760e40034 100644 --- a/examples/server/include.am +++ b/examples/server/include.am @@ -12,4 +12,4 @@ EXTRA_DIST += examples/server/server.sln EXTRA_DIST += examples/server/server-ntru.vcproj EXTRA_DIST += examples/server/server.vcproj -example_DATA+= examples/server/server.c +dist_example_DATA+= examples/server/server.c diff --git a/m4/ax_harden_compiler_flags.m4 b/m4/ax_harden_compiler_flags.m4 index f65c6e14f..99916d876 100644 --- a/m4/ax_harden_compiler_flags.m4 +++ b/m4/ax_harden_compiler_flags.m4 @@ -70,10 +70,12 @@ ax_append_compile_link_flags_extra= AS_IF([test "$ac_cv_vcs_checkout" = "yes"], [ - AX_CHECK_LINK_FLAG([-Werror]) - ],[ - AX_CHECK_LINK_FLAG([-Werror],[ax_append_compile_link_flags_extra]) + AX_CHECK_LINK_FLAG([-Werror]) + ],[ + AX_CHECK_LINK_FLAG([-Werror],[ + ax_append_compile_link_flags_extra=$ax_cv_check_ldflags___Werror ]) + ]) AX_CHECK_LINK_FLAG([-z relro -z now],,[$ax_append_compile_link_flags_extra]) AX_CHECK_LINK_FLAG([-pie],,[$ax_append_compile_link_flags_extra]) ]) diff --git a/rpm/include.am b/rpm/include.am new file mode 100644 index 000000000..e5253dd15 --- /dev/null +++ b/rpm/include.am @@ -0,0 +1,37 @@ +# vim:ft=automake + +rpm-build: rpm/spec dist + @rm -f *.rpm + @rm -f ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-$(VERSION)*.rpm + @rm -f ~/rpmbuild/SRPMS/$(PACKAGE)-$(VERSION)*.rpm + @mkdir -p ~/rpmbuild/BUILD/ + @mkdir -p ~/rpmbuild/RPMS/i386/ + @mkdir -p ~/rpmbuild/RPMS/i686/ + @mkdir -p ~/rpmbuild/RPMS/noarch/ + @mkdir -p ~/rpmbuild/RPMS/x86_64/ + @mkdir -p ~/rpmbuild/SOURCES/ + @mkdir -p ~/rpmbuild/SPECS/ + @mkdir -p ~/rpmbuild/SRPMS/ + @cp $(PACKAGE)-$(VERSION).tar.gz ~/rpmbuild/SOURCES/ + @rpmbuild -ba --clean rpm/spec + @cp ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-$(VERSION)*.rpm . + @cp ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-devel-$(VERSION)*.rpm . + @cp ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-debuginfo-$(VERSION)*.rpm . + @cp ~/rpmbuild/SRPMS/$(PACKAGE)-$(VERSION)*.rpm . + +rpm-sign: rpm-build + @rpm --addsign *.rpm + @rpm --checksig *.rpm + +clean-rpm: + @rm -f *.tar.gz + @rm -f *.src.rpm + @rm -f *.rpm + +rpm: rpm-build + +release: rpm-sign + +auto-rpmbuild: + @auto-br-rpmbuild -ba rpm/spec + diff --git a/rpm/spec.in b/rpm/spec.in new file mode 100644 index 000000000..80e5daf58 --- /dev/null +++ b/rpm/spec.in @@ -0,0 +1,144 @@ +Summary: Embedded SSL Library +Name: @PACKAGE@ +Version: @VERSION@ +Release: 1 +License: BSD +Group: System Environment/Libraries +BuildRequires: bison +URL: http://www.yassl.com/yaSSL/Home.html + +Packager: Brian Aker + +Source: http://yassl.com/yaSSL/download/%{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot + +%description +Misc tools for Yassl. + +%package devel +Summary: Header files and development libraries for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains the header files and development libraries +for %{name}. If you like to develop programs using %{name}, +you will need to install %{name}-devel. + +%prep +%setup -q + +%configure + + +%build +%{__make} %{?_smp_mflags} + +%install +%{__rm} -rf %{buildroot} +%{__make} install DESTDIR="%{buildroot}" AM_INSTALL_PROGRAM_FLAGS="" +mkdir -p $RPM_BUILD_ROOT/ + +%check + + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc AUTHORS ChangeLog COPYING NEWS README +%{_docdir}/cyassl/taoCert.txt +%{_docdir}/cyassl/example/echoserver.c +%{_docdir}/cyassl/example/server.c +%{_docdir}/cyassl/example/echoclient.c +%{_docdir}/cyassl/example/client.c +%{_docdir}/cyassl/README.txt + +%files devel +%defattr(-,root,root,-) +%doc AUTHORS ChangeLog COPYING NEWS README +%{_libdir}/libcyassl.a +%{_libdir}/libcyassl.la +%{_libdir}/libcyassl.so +%{_libdir}/libcyassl.so.3 +%{_libdir}/libcyassl.so.3.0.3 +%{_includedir}/cyassl/callbacks.h +%{_includedir}/cyassl/crl.h +%{_includedir}/cyassl/ctaocrypt/aes.h +%{_includedir}/cyassl/ctaocrypt/arc4.h +%{_includedir}/cyassl/ctaocrypt/asn.h +%{_includedir}/cyassl/ctaocrypt/asn_public.h +%{_includedir}/cyassl/ctaocrypt/coding.h +%{_includedir}/cyassl/ctaocrypt/des3.h +%{_includedir}/cyassl/ctaocrypt/dh.h +%{_includedir}/cyassl/ctaocrypt/dsa.h +%{_includedir}/cyassl/ctaocrypt/ecc.h +%{_includedir}/cyassl/ctaocrypt/error.h +%{_includedir}/cyassl/ctaocrypt/hc128.h +%{_includedir}/cyassl/ctaocrypt/hmac.h +%{_includedir}/cyassl/ctaocrypt/integer.h +%{_includedir}/cyassl/ctaocrypt/logging.h +%{_includedir}/cyassl/ctaocrypt/md2.h +%{_includedir}/cyassl/ctaocrypt/md4.h +%{_includedir}/cyassl/ctaocrypt/md5.h +%{_includedir}/cyassl/ctaocrypt/memory.h +%{_includedir}/cyassl/ctaocrypt/misc.h +%{_includedir}/cyassl/ctaocrypt/mpi_class.h +%{_includedir}/cyassl/ctaocrypt/mpi_superclass.h +%{_includedir}/cyassl/ctaocrypt/pwdbased.h +%{_includedir}/cyassl/ctaocrypt/rabbit.h +%{_includedir}/cyassl/ctaocrypt/random.h +%{_includedir}/cyassl/ctaocrypt/ripemd.h +%{_includedir}/cyassl/ctaocrypt/rsa.h +%{_includedir}/cyassl/ctaocrypt/settings.h +%{_includedir}/cyassl/ctaocrypt/sha.h +%{_includedir}/cyassl/ctaocrypt/sha256.h +%{_includedir}/cyassl/ctaocrypt/sha512.h +%{_includedir}/cyassl/ctaocrypt/tfm.h +%{_includedir}/cyassl/ctaocrypt/types.h +%{_includedir}/cyassl/ctaocrypt/visibility.h +%{_includedir}/cyassl/error.h +%{_includedir}/cyassl/internal.h +%{_includedir}/cyassl/ocsp.h +%{_includedir}/cyassl/openssl/asn1.h +%{_includedir}/cyassl/openssl/bio.h +%{_includedir}/cyassl/openssl/bn.h +%{_includedir}/cyassl/openssl/conf.h +%{_includedir}/cyassl/openssl/crypto.h +%{_includedir}/cyassl/openssl/des.h +%{_includedir}/cyassl/openssl/dh.h +%{_includedir}/cyassl/openssl/dsa.h +%{_includedir}/cyassl/openssl/ec.h +%{_includedir}/cyassl/openssl/ecdsa.h +%{_includedir}/cyassl/openssl/engine.h +%{_includedir}/cyassl/openssl/err.h +%{_includedir}/cyassl/openssl/evp.h +%{_includedir}/cyassl/openssl/hmac.h +%{_includedir}/cyassl/openssl/lhash.h +%{_includedir}/cyassl/openssl/md4.h +%{_includedir}/cyassl/openssl/md5.h +%{_includedir}/cyassl/openssl/ocsp.h +%{_includedir}/cyassl/openssl/opensslconf.h +%{_includedir}/cyassl/openssl/opensslv.h +%{_includedir}/cyassl/openssl/ossl_typ.h +%{_includedir}/cyassl/openssl/pem.h +%{_includedir}/cyassl/openssl/pkcs12.h +%{_includedir}/cyassl/openssl/rand.h +%{_includedir}/cyassl/openssl/ripemd.h +%{_includedir}/cyassl/openssl/rsa.h +%{_includedir}/cyassl/openssl/sha.h +%{_includedir}/cyassl/openssl/ssl.h +%{_includedir}/cyassl/openssl/stack.h +%{_includedir}/cyassl/openssl/ui.h +%{_includedir}/cyassl/openssl/x509.h +%{_includedir}/cyassl/openssl/x509v3.h +%{_includedir}/cyassl/sniffer.h +%{_includedir}/cyassl/sniffer_error.h +%{_includedir}/cyassl/ssl.h +%{_includedir}/cyassl/test.h +%{_includedir}/cyassl/version.h + +%changelog +* Fri Oct 20 2012 Brian Aker - 0.1-1 +- Initial package