diff --git a/security/svrcore/Makefile b/security/svrcore/Makefile index 01a6df23dce5..9162aac77ba8 100644 --- a/security/svrcore/Makefile +++ b/security/svrcore/Makefile @@ -78,6 +78,8 @@ include $(CORE_DEPTH)/coreconf/rules.mk # (7) Execute "local" rules. (OPTIONAL). # ####################################################################### +INCLUDES += -I. + all release:: @echo ---- Finished ---- diff --git a/security/svrcore/svrcore-config.in b/security/svrcore/svrcore-config.in new file mode 100644 index 000000000000..e182cebe2771 --- /dev/null +++ b/security/svrcore/svrcore-config.in @@ -0,0 +1,106 @@ +#!/bin/sh + +prefix=@prefix@ + +major_version=@MOD_MAJOR_VERSION@ +minor_version=@MOD_MINOR_VERSION@ +patch_version=@MOD_PATCH_VERSION@ + +usage() +{ + cat <&2 +fi + +lib_svrcore=yes + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + ;; + --prefix) + echo_prefix=yes + ;; + --includedir=*) + includedir=$optarg + ;; + --includedir) + echo_includedir=yes + ;; + --libdir=*) + libdir=$optarg + ;; + --libdir) + echo_libdir=yes + ;; + --version) + echo ${major_version}.${minor_version}.${patch_version} + ;; + --cflags) + echo_cflags=yes + ;; + --libs) + echo_libs=yes + ;; + svrcore) + lib_svrcore=yes + ;; + *) + usage 1 1>&2 + ;; + esac + shift +done + +# Set variables that may be dependent upon other variables +if test -z "$includedir"; then + includedir=@includedir@ +fi +if test -z "$libdir"; then + libdir=@libdir@ +fi + +if test "$echo_prefix" = "yes"; then + echo $prefix +fi + +if test "$echo_includedir" = "yes"; then + echo $includedir +fi + +if test "$echo_libdir" = "yes"; then + echo $libdir +fi + +if test "$echo_cflags" = "yes"; then + echo -I$includedir +fi + +if test "$echo_libs" = "yes"; then + libdirs="-L$libdir" + if test -n "$lib_svrcore"; then + libdirs="$libdirs -lsvrcore${major_version}" + fi + echo $libdirs +fi diff --git a/security/svrcore/svrcore.pc.in b/security/svrcore/svrcore.pc.in new file mode 100644 index 000000000000..df466d8618b5 --- /dev/null +++ b/security/svrcore/svrcore.pc.in @@ -0,0 +1,11 @@ +prefix=%prefix% +exec_prefix=%exec_prefix% +libdir=%libdir% +includedir=%includedir% + +Name: svrcore-devel +Description: Svrcore - development files for secure PIN handling using NSS crypto +Version: %SVRCORE_VERSION% +Requires: nspr >= %NSPR_VERSION% , nss >= %NSS_VERSION% +Libs: -lsvrcore +Cflags: -I${includedir} diff --git a/security/svrcore/svrcore.spec b/security/svrcore/svrcore.spec new file mode 100644 index 000000000000..907c2bd5f5e9 --- /dev/null +++ b/security/svrcore/svrcore.spec @@ -0,0 +1,139 @@ +%define nspr_version 4.6 +%define nss_version 3.11 + +Summary: Svrcore - development files for secure PIN handling using NSS crypto +Name: svrcore-devel +Version: 4.0.1 +Release: 1 +License: MPL/GPL/LGPL +URL: http://www.mozilla.org/projects/security/pki/ +Group: Development/Libraries +Requires: nspr-devel >= %{nspr_version}, nss-devel >= %{nspr_version} +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: nspr-devel >= %{nspr_version}, nss-devel >= %{nss_version} +BuildRequires: pkgconfig +BuildRequires: gawk +Provides: svrcore-devel + +Source0: %{name}-%{version}.tar.gz + +%description +svrcore provides applications with several ways to handle secure PIN storage +e.g. in an application that must be restarted, but needs the PIN to unlock +the private key and other crypto material, without user intervention. svrcore +uses the facilities provided by NSS. + +%prep +%setup -q + +%build + +# Enable compiler optimizations and disable debugging code +BUILD_OPT=1 +export BUILD_OPT + +# Generate symbolic info for debuggers +XCFLAGS=$RPM_OPT_FLAGS +export XCFLAGS + +#export NSPR_INCLUDE_DIR=`nspr-config --includedir` +#export NSPR_LIB_DIR=`nspr-config --libdir` + +PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 +PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 + +export PKG_CONFIG_ALLOW_SYSTEM_LIBS +export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS + +NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nspr | sed 's/-I//'` + +export NSPR_INCLUDE_DIR + +NSS_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nss | sed 's/-I//'` + +export NSS_INCLUDE_DIR + +%ifarch x86_64 ppc64 ia64 s390x +USE_64=1 +export USE_64 +%endif + +cd mozilla/security/svrcore +# This make assumes the build is still using the mozilla/security/coreconf stuff, +# which does all kinds of crazy stuff with copying files around, looking for +# dependencies, etc. +make EXPORTS="" RELEASE="" REQUIRES="" MODULE="" IMPORTS="" OBJDIR=. INSTALL=true + +# Set up our package file +%{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir}/pkgconfig +%{__cat} svrcore.pc.in | sed -e "s,%%libdir%%,%{_libdir},g" \ + -e "s,%%prefix%%,%{_prefix},g" \ + -e "s,%%exec_prefix%%,%{_prefix},g" \ + -e "s,%%includedir%%,%{_includedir}/nss3,g" \ + -e "s,%%NSPR_VERSION%%,%{nspr_version},g" \ + -e "s,%%NSS_VERSION%%,%{nss_version},g" \ + -e "s,%%SVRCORE_VERSION%%,%{version},g" > \ + $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/svrcore.pc + +VMAJOR=`echo %{version}|cut -f1 -d.` +VMINOR=`echo %{version}|cut -f2 -d.` +VPATCH=`echo %{version}|cut -f3 -d.` + +%{__mkdir_p} $RPM_BUILD_ROOT/%{_bindir} +%{__cat} svrcore-config.in | sed -e "s,@libdir@,%{_libdir},g" \ + -e "s,@prefix@,%{_prefix},g" \ + -e "s,@exec_prefix@,%{_prefix},g" \ + -e "s,@includedir@,%{_includedir},g" \ + -e "s,@MOD_MAJOR_VERSION@,$VMAJOR,g" \ + -e "s,@MOD_MINOR_VERSION@,$VMINOR,g" \ + -e "s,@MOD_PATCH_VERSION@,$VPATCH,g" \ + > $RPM_BUILD_ROOT/%{_bindir}/svrcore-config + +chmod 755 $RPM_BUILD_ROOT/%{_bindir}/svrcore-config + + +%install + +# There is no make install target so we'll do it ourselves. + +%{__mkdir_p} $RPM_BUILD_ROOT/%{_includedir} +%{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir} +%{__mkdir_p} $RPM_BUILD_ROOT/%{_bindir} + +cd mozilla/security/svrcore +# Copy the binary libraries we want +for file in libsvrcore.a +do + %{__install} -m 644 $file $RPM_BUILD_ROOT/%{_libdir} +done + +# Copy the include files +for file in svrcore.h +do + %{__install} -m 644 $file $RPM_BUILD_ROOT/%{_includedir} +done + + +%clean +%{__rm} -rf $RPM_BUILD_ROOT + + +%post +/sbin/ldconfig >/dev/null 2>/dev/null + + +%postun +/sbin/ldconfig >/dev/null 2>/dev/null + + +%files +%defattr(0644,root,root) +%{_libdir}/pkgconfig/svrcore.pc +%{_libdir}/libsvrcore.a +%attr(0755,root,root) %{_bindir}/svrcore-config +%{_includedir}/svrcore.h + +%changelog +* Mon Dec 19 2005 Rich Megginson - 4.01-1 +- Initial revision +