Mailinglist Archive: opensuse-buildservice (124 mails)

< Previous Next >
[opensuse-buildservice] spec File für Centos
  • From: Günther J. Niederwimmer <gjn@xxxxxxxxxxx>
  • Date: Mon, 15 Aug 2016 16:15:50 +0200
  • Message-id: <3133092.iOoJX4tAH5@techz>
Hallo Liste,
Eine Anfänger Frage.

ich würde gerne ein Test File Bauen für CentOS 7
Das funktioniert auch soweit aber ;-).....

Da es für Cento 7 ist würde ich gerne das "el7" im rpm file haben, etwa so
mod_nss-1.0.14.el7_xx.x86_64.rpm

damit man es leichter zuordnen kann

ich bekomme aber nur ein
mod_nss-1.0.14-6.1.x86_64.rpm

wo ist da der Hund begraben, ich hänge mal das spec File an.
//
Name: mod_nss
Version: 1.0.14
Release: 1%{?dist}
Summary: SSL/TLS module for the Apache HTTP server
Group: System Environment/Daemons
License: ASL 2.0
URL: https://fedorahosted.org/mod_nss/
Source: http://fedorahosted.org/released/mod_nss/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: nspr-devel &gt;= 4.9.2, nss-devel &gt;= 3.14.0.0
BuildRequires: httpd-devel, apr-devel, apr-util-devel
BuildRequires: pkgconfig
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
# Needed for make check
BuildRequires: openssl
BuildRequires: python-nose
BuildRequires: python-requests
# BuildRequires: python-ndg_httpsclient
Requires: httpd-mmn = %{_httpd_mmn}
Requires(post): httpd, nss-tools
Requires: nss%{?_isa} &gt;= 3.14.0.0
# Although the following change reverses the desire of Bugzilla Bug #601939,
it
# was provided to suppress the dangling symlink warning of Bugzilla Bug
#906089
# as exposed via &#39;rpmlint&#39;.
Requires: %{_libdir}/libnssckbi.so

# Change configuration to not conflict with mod_ssl
Patch1: mod_nss-conf.patch
# Generate a password-less NSS database
Patch2: mod_nss-gencert.patch

%description
The mod_nss module provides strong cryptography for the Apache Web
server via the Secure Sockets Layer (SSL) and Transport Layer
Security (TLS) protocols using the Network Security Services (NSS)
security library.

%prep
%setup -q
%patch1 -p1 -b .conf
%patch2 -p1 -b .gencert

# Touch expression parser sources to prevent regenerating it
touch nss_expr_*.[chyl]

%build

CFLAGS=&quot;$RPM_OPT_FLAGS&quot;
APXS=%{_httpd_apxs}

export CFLAGS APXS

NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --variable=includedir nspr`
NSPR_LIB_DIR=`/usr/bin/pkg-config --variable=libdir nspr`

NSS_INCLUDE_DIR=`/usr/bin/pkg-config --variable=includedir nss`
NSS_LIB_DIR=`/usr/bin/pkg-config --variable=libdir nss`

NSS_BIN=`/usr/bin/pkg-config --variable=exec_prefix nss`

autoreconf -i -f
%configure \
--with-nss-lib=$NSS_LIB_DIR \
--with-nss-inc=$NSS_INCLUDE_DIR \
--with-nspr-lib=$NSPR_LIB_DIR \
--with-nspr-inc=$NSPR_INCLUDE_DIR \
--with-apr-config --enable-ecc

make %{?_smp_mflags} all

%install
# The install target of the Makefile isn&#39;t used because that uses apxs
# which tries to enable the module in the build host httpd instead of in
# the build root.
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf
mkdir -p $RPM_BUILD_ROOT%{_httpd_confdir}
mkdir -p $RPM_BUILD_ROOT%{_libdir}/httpd/modules
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8

%if &quot;%{_httpd_modconfdir}&quot; != &quot;%{_httpd_confdir}&quot;
# httpd &gt;= 2.4.x
mkdir -p $RPM_BUILD_ROOT%{_httpd_modconfdir}
sed -n /^LoadModule/p nss.conf &gt; 10-nss.conf
sed -i /^LoadModule/d nss.conf
install -m 644 10-nss.conf $RPM_BUILD_ROOT%{_httpd_modconfdir}
%endif

install -m 644 gencert.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 644 nss_pcache.8 $RPM_BUILD_ROOT%{_mandir}/man8/

install -m 644 nss.conf $RPM_BUILD_ROOT%{_httpd_confdir}

install -m 755 .libs/libmodnss.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules/
install -m 755 nss_pcache $RPM_BUILD_ROOT%{_libexecdir}/
# Provide a compatibility link to prevent disruption of customized
deployments.
#
# NOTE: This link may be deprecated in a future release of
&#39;mod_nss&#39;.
#
ln -s %{_libexecdir}/nss_pcache $RPM_BUILD_ROOT%{_sbindir}/nss_pcache
install -m 755 gencert $RPM_BUILD_ROOT%{_sbindir}/
ln -s ../../../%{_libdir}/libnssckbi.so
$RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/
touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/secmod.db
touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/cert8.db
touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/key3.db
touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/install.log

perl -pi -e &quot;s:$NSS_LIB_DIR:$NSS_BIN:&quot;
$RPM_BUILD_ROOT%{_sbindir}/gencert

%check
make check

%clean
rm -rf $RPM_BUILD_ROOT

%post
umask 077

if [ &quot;$1&quot; -eq 1 ] ; then
if [ ! -e %{_sysconfdir}/httpd/alias/key3.db ]; then
%{_sbindir}/gencert %{_sysconfdir}/httpd/alias &gt;
%{_sysconfdir}/httpd/alias/install.log 2&gt;&amp;1
echo &quot;&quot;
echo &quot;%{name} certificate database generated.&quot;
echo &quot;&quot;
fi

# Make sure that the database ownership is setup properly.
/bin/find %{_sysconfdir}/httpd/alias -user root -name &quot;*.db&quot; -
exec /bin/chgrp apache {} \;
/bin/find %{_sysconfdir}/httpd/alias -user root -name &quot;*.db&quot; -
exec /bin/chmod g+r {} \;
fi

%files
%defattr(-,root,root,-)
%doc README LICENSE docs/mod_nss.html
%{_mandir}/man8/*
%config(noreplace) %{_httpd_confdir}/nss.conf
%if &quot;%{_httpd_modconfdir}&quot; != &quot;%{_httpd_confdir}&quot;
%config(noreplace) %{_httpd_modconfdir}/10-nss.conf
%endif
%{_libdir}/httpd/modules/libmodnss.so
%dir %{_sysconfdir}/httpd/alias/
%ghost %attr(0640,root,apache) %config(noreplace)
%{_sysconfdir}/httpd/alias/secmod.db
%ghost %attr(0640,root,apache) %config(noreplace)
%{_sysconfdir}/httpd/alias/cert8.db
%ghost %attr(0640,root,apache) %config(noreplace)
%{_sysconfdir}/httpd/alias/key3.db
%ghost %config(noreplace) %{_sysconfdir}/httpd/alias/install.log
%{_sysconfdir}/httpd/alias/libnssckbi.so
%{_libexecdir}/nss_pcache
%{_sbindir}/nss_pcache
%{_sbindir}/gencert
//

Danke für die Hilfe,
--
mit freundlichen Grüßen / best regards,

Günther J. Niederwimmer
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >