[Fedora-directory-commits] mod_admserv makerpm.sh, NONE, 1.1 mod_admserv.spec, NONE, 1.1

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Thu Nov 3 18:57:51 UTC 2005


Author: rmeggins

Update of /cvs/dirsec/mod_admserv
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25822

Added Files:
	makerpm.sh mod_admserv.spec 
Log Message:
added spec file for building mod_admserv rpm


--- NEW FILE makerpm.sh ---
#!/bin/sh -xv

# This script provides an example of how to build the various flavors
# of the mod_admserv rpm.  If you don't have a source tarball, you
# can create one from checking out the source tree (which you presumably
# have if you have checked out this script) and putting it in
# SOURCES/mod_admserv-1.0.tar.gz.  The things you need to define below
# are:
# RPM_PLATFORM - one of RHEL3, RHEL4, FC3, FC4, etc. - should correspond
# to our internal build platform naming convention
# FLAVOR - use dbg for debug builds and opt for optimized builds
# NSPRDIR - directory holding NSPR include and lib directories
# NSSDIR - directory holding NSS include and lib directories
# LDAPSDKDIR - directory holding Mozilla C LDAP SDK include and lib directories
# ADMINUTILDIR - directory holding Adminutil include and lib directories

mkdirs() {
        for d in "$@" ; do
                if [ -d $d ]; then
                        mv $d $d.deleted
                        rm -rf $d.deleted &
                fi
                mkdir -p $d
        done
}

#mkdirs SOURCES BUILD SRPMS RPMS
#cd SOURCES
#cvs -d $FEDCVSROOT co -d mod_admserv-1.0 mod_admserv
#tar cf - mod_admserv-1.0 | gzip > mod_admserv-1.0.tar.gz
#rm -rf mod_admserv-1.0
#cd ..

# define PLATFORM to be RHEL3, RHEL4, FC3, FC4, etc.
RPM_PLATFORM=RHEL4
# define FLAVOR to be dbg or opt for debug or optimized build
FLAVOR=dbg
# root dir for RPM built and temp files
ABS_TOPDIR=`pwd`
arch=`uname -i`
#mkdirs RPMS/$arch

# now define the locations of our components
NSPRDIR=/share/builds/components/nspr/v4.4.1/RHEL4_x86_gcc3_DBG.OBJ
NSSDIR=/share/builds/components/nss/NSS_3_9_3_RTM/RHEL4_x86_gcc3_DBG.OBJ
LDAPSDKDIR=/share/builds/components/ldapsdk50/v5.16/RHEL4_x86_gcc3_DBG.OBJ
ADMINUTILDIR=/home/rich/adminutil/adminutil/built/adminutil/RHEL4_x86_gcc3_DBG.OBJ

rpmbuild --define "_topdir $ABS_TOPDIR" --define "_sourcedir $ABS_TOPDIR/SOURCES" --define "_rpmdir $ABS_TOPDIR/RPMS" --define "_srcrpmdir $ABS_TOPDIR/SRPMS" --define "ARCH $arch" --define "flavor $FLAVOR" --define "platform $RPM_PLATFORM" --define "nsprincdir $NSPRDIR/include" --define "nsprlibdir $NSPRDIR/lib" --define "nssincdir $NSSDIR/include" --define "nsslibdir $NSSDIR/lib" --define "ldapsdkincdir $LDAPSDKDIR/include" --define "ldapsdklibdir $LDAPSDKDIR/lib" --define "adminutildir $ADMINUTILDIR" --nodeps -ba mod_admserv.spec


--- NEW FILE mod_admserv.spec ---
# BEGIN COPYRIGHT BLOCK
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
%define product fedora
%define flavor 
%define _build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.%{flavor}.rpm
Summary: mod_admserv
Name: mod_admserv
Version: 1.0
Release: 1.%{platform}
License: Apache 2.0
Group: System Environment/Daemons
URL: http://directory.fedora.redhat.com/
Source: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPreReq: httpd-devel,apr-devel
# Without Autoreq: 0, rpmbuild finds all sorts of crazy
# dependencies that we don't care about, and refuses to install
Autoreq: 0
# Don't automatically generate provides list
AutoProv: 0
# Without Requires: something, rpmbuild will abort!
Requires: httpd,apr
Provides: mod_admserv
Prefix: /opt/%{product}-ds/bin/admin/lib

%description
An Apache 2.0 module for implementing the admin server functionality required by Red Hat and Fedora Admin Server and Directory Server

%prep
%setup -q

%build
%ifarch x86_64 ppc64 ia64 s390x
mycflags=-m64
%endif

if [ %{flavor} = 'dbg' ]; then
    flag=-g
else
    flag=-O2
fi

# configure requires nspr, nss, ldapsdk, adminutil
# if can't find apxs, use --with-apxs=/path/to/apxs
./configure --with-apr-config --with-nspr-inc=%{nsprincdir} --with-nspr-lib=%{nsprlibdir} --with-nss-inc=%{nssincdir} --with-nss-lib=%{nsslibdir} --with-ldapsdk-inc=%{ldapsdkincdir} --with-ldapsdk-lib=%{ldapsdklibdir} --with-adminutil=%{adminutildir}
CFLAGS="$flag $mycflags" make

%install
# we don't really want to install this in the system Apache modules dir
%{__mkdir_p} $RPM_BUILD_ROOT/%{prefix}
install -m 755 .libs/libmodadmserv.so $RPM_BUILD_ROOT%{prefix}

%clean
rm -rf $RPM_BUILD_ROOT/$RPM_INSTALL_PREFIX

%files
# rather than listing individual files, we just package (and own)
# the entire ldapserver directory - if we change this to put
# files in different places, we won't be able to do this anymore
%defattr(-,root,root,-)
%{prefix}/libmodadmserv.so

%changelog
* Thu Nov  3 2005 Richard Megginson <rmeggins at redhat.com> - 1.0
- Initial version






More information about the Fedora-directory-commits mailing list