Hi,
the specfiles seem to be a bit outdated for openca 1.0.2 and
openca-tools 1.1.0. Attached you will find adapted specfiles also
containig distri detection for centos. They "workforme", I didn't check
other distris, but they should work.
Regards, Helmut
--
Dipl. Ing. Helmut Manck
Senior Consultant
eonas IT-Beratung und Entwicklung GmbH
Greifenhagener Str. 54
10437 Berlin
Germany
# OpenCA RPM File
# (c) 2006 by Massimiliano Pala and OpenCA Team
# OpenCA Licensed Software
%define __find_requires %{nil}
%define debug_package %{nil}
# %define _unpackaged_files_terminate_build 0
# %define _missing_doc_files_terminate_build 0
# Basic Definitions
%define httpd_usr apache
%define httpd_grp apache
%define nobody nobody
%define nogroup nobody
%define openca_usr root
%define openca_grp nobody
%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0)
%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
%define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0)
%define is_centos %(test -e /etc/redhat-release && grep -q CentOS
/etc/redhat-release && echo 1 || echo 0)
%define dist redhat
%define disttag el
%if %is_mandrake
%define dist mandrake
%define disttag mdk
%endif
%if %is_suse
%define dist suse
%define disttag suse
%define nogroup nogroup
%define httpd_usr wwwwrun
%define httpd_grp nogroup
%endif
%if %is_fedora
%define dist fedora
%define disttag rhfc
%endif
%if %is_centos
%define dist centos
%define disttag el
%endif
%define distver %(release="`rpm -q --queryformat='%{VERSION}' %{dist}-release
2> /dev/null | tr . : | sed s/://g`" ; if test $? != 0 ; then release="" ; fi ;
echo "$release")
%define packer %(finger -lp `echo "$USER"` | head -n 1 | cut -d ' ' -f 2)
%define ver 1.0.2
%define RELEASE 1
%define rel %{?CUSTOM_RELEASE}%{!?CUSTOM_RELEASE:%RELEASE}
%define prefix /opt/openca
%define mand /opt/openca/man
%define sslprefix /usr
%define openssl_req 0.9.7
%define openldap_req 2.2
%define openca_tools_req 1.1.0
%define openca_common_req 0.9.3
Summary: Open Source Certification Authority Software (PKI)
Name: openca-base
Version: %ver
Release: %rel.%{disttag}%{distver}
License: OpenCA License (BSD Style)
Group: Security/PKI
Source: openca-base-%{ver}.tar.gz
Packager: %packer
Vendor: OpenCA Labs
BuildRoot: /var/tmp/openca-base-1.0.1
URL: http://www.openca.org/
Docdir: %{prefix}/doc
Prefix: %{prefix}
BuildRequires: openca-tools, httpd
## BuildRoot: %{_tmppath}/%{name}-%{ver}-%{rel}-buildroot
%description
The OpenCA package implements a full featured Certification Authority
to issue and managed digital certificates.
%define openca_prefix %{prefix}
%define httpd_fs_prefix %{prefix}/var/www
%define openssl_prefix /usr
%package common
Summary: Basic Components for OpenCA
Group: Security/PKI
AutoReq: no
Requires: openssl >= %openssl_req, openca-tools >= %openca_tools_req,
perl-XML-Parser
%description common
%package ca
Summary: CA Components for OpenCA
Group: Security/PKI
Requires: openca-base-common >= %openca_common_req
%description ca
%package bp
Summary: Batch Components for OpenCA
Group: Security/PKI
Requires: openca-base-common >= %openca_common_req
%description bp
%package ldap
Summary: LDAP Components for OpenCA
Group: Security/PKI
Requires: openca-base-common >= %openca_common_req
%description ldap
%package pub
Summary: Pub Components for OpenCA
Group: Security/PKI
Requires: openca-base-common >= %openca_common_req
%description pub
%package ra
Summary: RA Components for OpenCA
Group: Security/PKI
Requires: openca-base-common >= %openca_common_req
%description ra
%package scep
Summary: SCEP Components for OpenCA
Group: Security/PKI
Requires: openca-base-common >= %openca_common_req
%description scep
%prep
#echo %_target
#echo %_target_alias
#echo %_target_cpu
#echo %_target_os
#echo %_target_vendor
echo Building %{name}-%{version}-%{release}
%setup -q -n %{name}-%{version}
if [ ! -f configure ]; then
CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh
fi
./configure \
--prefix=%{prefix} \
--with-build-dir=/var/tmp/openca-base-1.0.1/ \
--with-openca-user=%{openca_usr} \
--with-openca-group=%{openca_grp} \
--with-ca-organization="OpenCA PKI Services" \
--with-ldap-port=389 \
--with-ldap-root="cn=Manager,o=OpenCA,c=IT" \
--with-ldap-root-pwd="openca" \
--with-openssl-prefix=%{openssl_prefix} \
--enable-openscep \
--with-db-type=mysql \
--with-db-name=openca \
--with-db-host=localhost \
--with-db-port=3306 \
--with-db-user=openca \
--with-db-passwd="openca" \
--with-service-mail-account="[EMAIL PROTECTED]" \
--with-language=en_EN
## --enable-package-build \
## --with-openssl-engine=LunaCA3 \
## --with-hsm-utility=/usr/luna/bin/ca3util \
## --with-hsm-slot=1 \
## --with-hsm-appid=10:11 \
# CFLAGS="$RPM_OPT_FLAGS" sh configs/[EMAIL PROTECTED]@ "$RPM_BUILD_ROOT"
%build
make
%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
# make install-common install-modules install-ca install-batch install-ldap
install-pub install-ra install-scep install-node
make install-online install-offline
%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
%files common
%defattr(-, -, -)
%{openca_prefix}/bin/*
%{openca_prefix}/etc/openca/loa.xml
%{openca_prefix}/etc/openca/log.xml
%{openca_prefix}/etc/openca/token.xml
%{openca_prefix}/etc/openca/config.xml
%{openca_prefix}/etc/openca/ldap.xml.template
%{openca_prefix}/etc/openca/menu.xml.template
%{openca_prefix}/etc/openca/backup.xml.template
%{openca_prefix}/etc/openca/browser_req.xml.template
%{openca_prefix}/etc/openca/auth_browser_req.xml.template
%{openca_prefix}/etc/openca/server_req.xml.template
%{openca_prefix}/etc/openca/datasources.xml.template
%{openca_prefix}/etc/openca/configure_etc.sh
%{openca_prefix}/etc/init.d/openca
%{openca_prefix}/etc/openca/openca_start.template
%{openca_prefix}/etc/openca/openca_stop.template
%{openca_prefix}/etc/openca/utf8_latin1_selector.sh.template
%{openca_prefix}/etc/openca/bp/*
%{openca_prefix}/etc/openca/database/*
%{openca_prefix}/etc/openca/openssl/*
%{openca_prefix}/etc/openca/rbac/*
%{openca_prefix}/etc/openca/agreements/*
%{openca_prefix}/etc/openca/contrib/*
%{openca_prefix}/lib/*
%{openca_prefix}/var/openca/bp/*
%{openca_prefix}/var/openca/mail/*
%{openca_prefix}/etc/openca/access_control/node.xml.template
%{openca_prefix}/etc/openca/servers/node.conf.template
%{openca_prefix}/etc/openca/menus/node-menu.xml.template
%{httpd_fs_prefix}/html/pki/node/*
%{httpd_fs_prefix}/cgi-bin/pki/node/*
%defattr( -, %{httpd_usr}, %{httpd_grp})
%dir %{openca_prefix}/var/openca/log
%dir %{openca_prefix}/var/openca/crypto
%dir %{openca_prefix}/var/openca/crypto/cacerts
%dir %{openca_prefix}/var/openca/crypto/chain
%dir %{openca_prefix}/var/openca/crypto/certs
%dir %{openca_prefix}/var/openca/crypto/keys
%dir %{openca_prefix}/var/openca/crypto/reqs
%dir %{openca_prefix}/var/openca/tmp
%dir %{openca_prefix}/var/openca/db
%{openca_prefix}/var/openca/crypto/cacerts/*
%{openca_prefix}/var/openca/crypto/chain/*
%{openca_prefix}/var/openca/crypto/crlnumber
%{openca_prefix}/var/openca/crypto/index.txt
%{openca_prefix}/var/openca/crypto/keys/bp_key.pem
%{openca_prefix}/var/openca/crypto/keys/keybackup_key.pem
%{openca_prefix}/var/openca/crypto/keys/log_key.pem
%{openca_prefix}/var/openca/crypto/serial
%{openca_prefix}/var/openca/crypto/index.txt.attr
%{openca_prefix}/var/openca/log/*
%files ca
%defattr(-, -, -)
%{httpd_fs_prefix}/html/pki/ca/*
%{httpd_fs_prefix}/cgi-bin/pki/ca/*
%{openca_prefix}/var/openca/session/cookie/ca
%{openca_prefix}/etc/openca/access_control/ca.xml.template
%{openca_prefix}/etc/openca/servers/ca.conf.template
%{openca_prefix}/etc/openca/menus/ca-menu.xml.template
%files bp
%defattr(-, -, -)
%{httpd_fs_prefix}/html/pki/batch/*
%{httpd_fs_prefix}/cgi-bin/pki/batch/*
%{openca_prefix}/var/openca/session/cookie/batch
%{openca_prefix}/etc/openca/access_control/batch.xml.template
%{openca_prefix}/etc/openca/servers/batch.conf.template
%{openca_prefix}/etc/openca/menus/batch-menu.xml.template
%files ldap
%defattr(-, -, -)
%{httpd_fs_prefix}/html/pki/ldap/*
%{httpd_fs_prefix}/cgi-bin/pki/ldap/*
%dir %{openca_prefix}/var/openca/session/cookie/ldap
%{openca_prefix}/etc/openca/access_control/ldap.xml.template
%{openca_prefix}/etc/openca/servers/ldap.conf.template
%{openca_prefix}/etc/openca/menus/ldap-menu.xml.template
%files pub
%defattr(-, -, -)
%{httpd_fs_prefix}/html/pki/pub/*
%{httpd_fs_prefix}/cgi-bin/pki/pub/*
%{openca_prefix}/var/openca/session/cookie/pub
%{openca_prefix}/etc/openca/access_control/pub.xml.template
%{openca_prefix}/etc/openca/servers/pub.conf.template
%{openca_prefix}/etc/openca/menus/pub-menu.xml.template
%files ra
%defattr(-, -, -)
%{httpd_fs_prefix}/html/pki/ra/*
%{httpd_fs_prefix}/cgi-bin/pki/ra/*
%{openca_prefix}/var/openca/session/cookie/ra
%{openca_prefix}/etc/openca/access_control/ra.xml.template
%{openca_prefix}/etc/openca/servers/ra.conf.template
%{openca_prefix}/etc/openca/menus/ra-menu.xml.template
%files scep
%defattr(-, -, -)
%{httpd_fs_prefix}/cgi-bin/pki/scep/*
%{openca_prefix}/var/openca/session/cookie/scep
%{openca_prefix}/etc/openca/access_control/scep.xml.template
%{openca_prefix}/etc/openca/servers/scep.conf.template
%post
%post ca
echo
echo "Entering POST Install Configuration of OpenCA..."
cd %{openca_prefix}/etc/openca && sh configure_etc.sh CA
echo "Done."
%post ra
echo
echo "Entering POST Install Configuration of OpenCA..."
cd %{openca_prefix}/etc/openca && sh configure_etc.sh RA
echo "Done."
%post pub
echo
echo "Entering POST Install Configuration of OpenCA..."
cd %{openca_prefix}/etc/openca && sh configure_etc.sh Pub
echo "Done."
%post ldap
echo
echo "Entering POST Install Configuration of OpenCA..."
cd %{openca_prefix}/etc/openca && sh configure_etc.sh LDAP
echo "Done."
%post scep
echo
echo "Entering POST Install Configuration of OpenCA..."
cd %{openca_prefix}/etc/openca && sh configure_etc.sh SCEP
echo "Done."
%post bp
echo
echo "Entering POST Install Configuration of OpenCA..."
cd %{openca_prefix}/etc/openca && sh configure_etc.sh BP
echo "Done."
%post common
echo
echo -n "Linking startup script (openca) in init.d/ dir ... "
ln -s %{openca_prefix}/etc/init.d/openca /etc/init.d/openca
echo "Done."
%postun common
echo "Removing init.d/openca link ... "
rm -f /etc/init.d/openca
echo "Done."
echo -n "Removing empty directories ... "
rmdir %{prefix}/bin 2>/dev/null
rmdir %{openca_prefix}/lib/openca/perl_modules 2>/dev/null
rm -rf %{openca_prefix}/lib/openca/mails/* 2>/dev/null
rmdir %{openca_prefix}/lib/openca/mails 2>/dev/null
rmdir %{openca_prefix}/lib/openca 2>/dev/null
echo "Done."
echo
echo "Please check the %{prefix} directory for remaining files."
echo
%changelog
* Mon Sep 18 2006 Massimiliano Pala <[EMAIL PROTECTED]>
-First Packaging for OpenCA-Base
# OpenCA Base Tools RPM File
# (c) 2006 by Massimiliano Pala and OpenCA Team
# OpenCA Licensed Software
# %define __find_requires %{nil}
%define debug_package %{nil}
# %define _unpackaged_files_terminate_build 0
# %define _missing_doc_files_terminate_build 0
%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0)
%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
%define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0)
%define is_centos %(test -e /etc/fedora-release && grep -q CentOS
/etc/redhat-release && echo 1 || echo 0)
%define dist redhat
%define disttag el
%if %is_mandrake
%define dist mandrake
%define disttag mdk
%endif
%if %is_suse
%define dist suse
%define disttag suse
%define nogroup nogroup
%define httpd_usr wwwwrun
%define httpd_grp nogroup
%endif
%if %is_fedora
%define dist fedora
%define disttag rhfc
%endif
%if %is_centos
%define dist centos
%define disttag el
%endif
%define distver %(release="`rpm -q --queryformat='%{VERSION}' %{dist}-release
2> /dev/null | tr . : | sed s/://g`" ; if test $? != 0 ; then release="" ; fi ;
echo "$release")
#%define distver 5
%define packer %(finger -lp `echo "$USER"` | head -n 1 | cut -d ' ' -f 2)
%define ver 1.1.0
%define RELEASE 1
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
%define prefix /usr
%define mand /usr/man
%define sslprefix /usr/local/openssl
%define openssl_req 0.9.7
%define openldap_req 2.2
Summary: OpenCA Base Tools
Name: openca-tools
Version: %ver
Release: %rel.%{disttag}%{distver}
License: OpenCA License (BSD Style)
Group: Network/Daemons
Source: openca-tools-%{ver}.tar.gz
BuildRoot: /var/tmp/openca-tools-%{ver}-root
URL: http://www.openca.org/projects/ocspd
Packager: %packer
Docdir: %{prefix}/doc
Prefix: %prefix
BuildRequires: openssl-devel >= %openssl_req
Requires: openssl >= %openssl_req
%description
OpenCA Tools provide command line facilities for (1) digital
signatures generation and verifications and for (2) SCEP message
handling.
%prep
%setup
%ifarch alpha
ARCH_FLAGS="--host=alpha-redhat-linux"
%endif
if [ ! -f configure ]; then
CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh $ARCH_FLAGS --prefix=%{prefix}
--with-openssl-prefix=%{sslprefix} --enable-openssl-engine --mandir=%{mand}
--disable-shared
else
CFLAGS="$RPM_OPT_FLAGS" ./configure $ARCH_FLAGS --prefix=%{prefix}
--with-openssl-prefix=%{sslprefix} --enable-openssl-engine --mandir=%{mand}
--disable-shared
fi
%build
if [ "$SMP" != "" ]; then
(make "MAKE=make -k -j $SMP"; exit 0)
make
else
make
fi
%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{prefix} mandir=$RPM_BUILD_ROOT%{mand} install
%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%doc AUTHORS COPYING INSTALL ChangeLog NEWS README VERSION
%{prefix}/bin/*
%{mand}/*
%post
%postun
%changelog
* Mon Oct 9 2006 Massimiliano Pala <[EMAIL PROTECTED]>
- New Package building for openca-tools
- Fixed VERSION and PACKAGE_VERSION variables
* Mon Sep 18 2006 Massimiliano Pala <[EMAIL PROTECTED]>
-First Package version (removed tools from OpenCA-Base)
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openca-Users mailing list
Openca-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openca-users