From 19d02a8b004195050d1d5edf826cb99e51069f7b Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 4 Jun 2013 14:09:09 +0100 Subject: [PATCH] Import fixes from bug 970002 --- libtomcrypt-pkgconfig.patch | 34 ++++++++++++++++ libtomcrypt.spec | 80 +++++++++++++++++++------------------ 2 files changed, 75 insertions(+), 39 deletions(-) create mode 100644 libtomcrypt-pkgconfig.patch diff --git a/libtomcrypt-pkgconfig.patch b/libtomcrypt-pkgconfig.patch new file mode 100644 index 0000000..0a50634 --- /dev/null +++ b/libtomcrypt-pkgconfig.patch @@ -0,0 +1,34 @@ +--- libtomcrypt-1.17.orig/makefile.shared ++++ libtomcrypt-1.17/makefile.shared +@@ -248,15 +248,16 @@ + + objs: $(OBJECTS) + +-$(LIBNAME): $(OBJECTS) testprof/$(LIBTEST) ++$(LIBNAME): $(OBJECTS) + libtool --silent --mode=link gcc $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) + + install: $(LIBNAME) + install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) +- cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) make -f makefile.shared install + libtool --silent --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la + install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) + install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) ++ install -d $(DESTDIR)$(LIBPATH)/pkgconfig ++ install -m 0644 -g $(GROUP) -o $(USER) libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc + + #This rule makes the hash program included with libtomcrypt + hashsum: library +--- libtomcrypt-1.17.orig/libtomcrypt.pc ++++ libtomcrypt-1.17/libtomcrypt.pc +@@ -0,0 +1,10 @@ ++prefix=/usr ++exec_prefix=${prefix} ++libdir=${exec_prefix}/lib ++includedir=${prefix}/include/tomcrypt ++ ++Name: LibTomCrypt ++Description: public domain open source cryptographic toolkit ++Version: 1.17 ++Libs: -L${libdir} -ltomcrypt ++Cflags: -I${includedir} diff --git a/libtomcrypt.spec b/libtomcrypt.spec index 7ef9e25..de80d69 100644 --- a/libtomcrypt.spec +++ b/libtomcrypt.spec @@ -1,32 +1,31 @@ Name: libtomcrypt Version: 1.17 -Release: 15%{?dist} +Release: 16%{?dist} Summary: A comprehensive, portable cryptographic toolkit -Group: System Environment/Libraries + License: Public Domain URL: http://www.libtom.org/?page=features&newsitems=5&whatfile=crypt Source0: http://www.libtom.org/files/crypt-%{version}.tar.bz2 -Requires: libtommath >= 0.41 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: libtommath-devel >= 0.41, libtool +Patch0: %{name}-makefile.patch +Patch1: %{name}-pkgconfig.patch -Patch0: libtomcrypt-makefile.patch +Requires: libtommath >= 0.41 +BuildRequires: libtommath-devel >= 0.41 +BuildRequires: libtool %description -A comprehensive, modular and portable cryptographic toolkit that -provides developers with a vast array of well known published block -ciphers, one-way hash functions, chaining modes, pseudo-random number -generators, public key cryptography and a plethora of other routines. +A comprehensive, modular and portable cryptographic toolkit that provides +developers with a vast array of well known published block ciphers, one-way hash +functions, chaining modes, pseudo-random number generators, public key +cryptography and a plethora of other routines. -Designed from the ground up to be very simple to use. It has a modular -and standard API that allows new ciphers, hashes and PRNGs to be added -or removed without change to the overall end application. It features -easy to use functions and a complete user manual which has many source -snippet examples. +Designed from the ground up to be very simple to use. It has a modular and +standard API that allows new ciphers, hashes and PRNGs to be added or removed +without change to the overall end application. It features easy to use functions +and a complete user manual which has many source snippet examples. %package devel Summary: Development files for %{name} -Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel @@ -35,9 +34,19 @@ developing applications that use %{name}. %package doc Summary: Documentation files for %{name} -Group: Documentation Requires: %{name} = %{version}-%{release} -BuildRequires: tetex-latex, tetex-dvips, ghostscript + +BuildRequires: ghostscript +BuildRequires: tetex-dvips +BuildRequires: tetex-latex +%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 +BuildRequires: texlive-cm +BuildRequires: texlive-fancyhdr +BuildRequires: texlive-latex-bin-bin +BuildRequires: texlive-makeindex-bin +BuildRequires: texlive-metafont-bin +BuildRequires: texlive-texconfig +%endif %description doc The %{name}-doc package contains documentation for use with %{name}. @@ -45,20 +54,16 @@ The %{name}-doc package contains documentation for use with %{name}. %prep %setup -q %patch0 -p1 -b .makefile - +%patch1 -p1 -b .pkgconfig %build # no configure script ships with libtomcrypt. Its only requirement is # ANSI C. And libtommath. Explicitly force it to be built against libtommath export CFLAGS="$RPM_OPT_FLAGS -DLTM_DESC -I%{_includedir}/tommath" -# work around bug #239003 -%ifarch ppc64 -export CFLAGS="$CFLAGS -O0" -%endif + make %{?_smp_mflags} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" -f makefile.shared make %{?_smp_mflags} LIBPATH=%{_libdir} -f makefile docs - %check export CFLAGS="$RPM_OPT_FLAGS -DLTM_DESC -DUSE_LTM -I%{_includedir}/tommath" make %{?_smp_mflags} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" test @@ -68,45 +73,42 @@ make %{?_smp_mflags} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" test # There is no configure script that ships with libtomcrypt but it does # have understand DESTDIR and its installs via that and the # INSTALL_USER and INSTALL_GROUP environment variables. -rm -rf $RPM_BUILD_ROOT +rm -rf %{buildroot} export INSTALL_USER=$(id -un) export INSTALL_GROUP=$(id -gn) export CFLAGS="$RPM_OPT_FLAGS -DLTM_DESC -DUSE_LTM" -make install INCPATH=%{_includedir}/tomcrypt DESTDIR=$RPM_BUILD_ROOT LIBPATH=%{_libdir} EXTRALIBS="-ltommath" -f makefile.shared -find $RPM_BUILD_ROOT -name '*.h' -exec chmod 644 {} ';' +make install INCPATH=%{_includedir}/tomcrypt DESTDIR=%{buildroot} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" -f makefile.shared +find %{buildroot} -name '*.h' -exec chmod 644 {} ';' # remove unneeded files -find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' -find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} ';' -find $RPM_BUILD_ROOT -name 'libtomcrypt_prof*' -exec rm -f {} ';' - - -%clean -rm -rf $RPM_BUILD_ROOT - +find %{buildroot} -name '*.la' -exec rm -f {} ';' +find %{buildroot} -name '*.a' -exec rm -f {} ';' +find %{buildroot} -name 'libtomcrypt_prof*' -exec rm -f {} ';' %post -p /sbin/ldconfig %postun -p /sbin/ldconfig - %files -%defattr(-,root,root,-) %doc LICENSE %{_libdir}/*.so.* %files devel -%defattr(-,root,root,-) %doc LICENSE %{_includedir}/tomcrypt %{_libdir}/*.so +%{_libdir}/pkgconfig/libtomcrypt.pc %files doc -%defattr(-,root,root,-) %doc LICENSE doc/crypt.pdf %changelog +* Mon Jun 03 2013 Simone Caronni - 1.17-16 +- Update SPEC, remove obsolete tags, fix formatting. +- Add patch for pkg config (libtomcrypt.pc). +- Add correct build requirements for Fedora 19+ and RHEL 7+. + * Thu Feb 14 2013 Fedora Release Engineering - 1.17-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild