summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-03-31 22:55:27 +0000
committerRich Megginson <rmeggins@redhat.com>2005-03-31 22:55:27 +0000
commit12efac13b9043e382f02a7397f2942f2ab913852 (patch)
tree05c385994167c9bfa98c2381dbba3c263c17b17d
parentfeaff0bbfa49d25742e8101db1c1112d62ffca6a (diff)
downloadds-12efac13b9043e382f02a7397f2942f2ab913852.tar.gz
ds-12efac13b9043e382f02a7397f2942f2ab913852.tar.xz
ds-12efac13b9043e382f02a7397f2942f2ab913852.zip
I got rid of ldapserver.spec. Instead, the spec file will be created on the fly. The only parameter passed in is the flavor - redhat or fedora. Everything else comes from the brandver.dat file. PLATFORM is derived from BUILD_ARCH in the usual Makefile way. So we could easily support Solaris or whatever else. The Makefile change is to allow you to produce the .spec file without having to build everything else. The change to reltools/brandver.pl allows us to change only the named files rather than every file in the .dat file.
The builddsrpm.sh is now the only thing you need to build the ds rpms: cvs co ldapserver/builddsrpm.sh ; cp ldapserver/builddsrpm.sh . ; ./builddsrpm.sh [redhat|fedora]
-rw-r--r--Makefile7
-rwxr-xr-xbuilddsrpm.sh55
-rw-r--r--ldapserver.spec.tmpl (renamed from ldapserver.spec)39
3 files changed, 62 insertions, 39 deletions
diff --git a/Makefile b/Makefile
index ad44df9a..8e824529 100644
--- a/Makefile
+++ b/Makefile
@@ -296,3 +296,10 @@ else
endif
@echo =========== Finished - LDAP Server L10N Package Build ============
+redhat-ds.spec: ldapserver.spec.tmpl branding/rhds/brandver.dat $(RELTOOLSPATH)/brandver.pl
+ sed -e s/@PLATFORM@/$(BUILD_ARCH)/g ldapserver.spec.tmpl > $@
+ $(RELTOOLSPATH)/brandver.pl -i branding/rhds/brandver.dat $@
+
+fedora-ds.spec: ldapserver.spec.tmpl branding/fedora/brandver.dat $(RELTOOLSPATH)/brandver.pl
+ sed -e s/@PLATFORM@/$(BUILD_ARCH)/g ldapserver.spec.tmpl > $@
+ $(RELTOOLSPATH)/brandver.pl -i branding/fedora/brandver.dat $@
diff --git a/builddsrpm.sh b/builddsrpm.sh
index b56875e2..b4f74ae1 100755
--- a/builddsrpm.sh
+++ b/builddsrpm.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -v
+#!/bin/sh -vx
# --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
@@ -14,31 +14,46 @@ mkdirs() {
done
}
-if [ ! -f $HOME/.rpmmacros ]; then
- echo "This script assumes you want to build as a non-root"
- echo "user and in a non-default place (e.g. your home dir)"
- echo "You must have a $HOME/.rpmmacros file that redefines"
- echo "_topdir e.g."
- echo "%_topdir /home/rmeggins/ds71"
- echo "Please create that file with the above contents and"
- echo "rerun this script."
+flavor=$1
+
+rootdir=`pwd`
+
+if [ ! $flavor ] ; then
+ echo "Error: $0 <flavor>"
+ echo "flavor is either redhat or fedora"
+ echo "use redhat to create a redhat branded DS or use fedora"
+ echo "for the fedora branded DS"
exit 1
fi
-NAME=ldapserver
-VERSION=7.1
+mkdirs SOURCES BUILD SRPMS RPMS
+cd SOURCES
+
+# check out files from this CVS repo
+CVSNAME=ldapserver
# change HEAD to a real static tag when available
CVSTAG=HEAD
-mkdirs SOURCES BUILD SRPMS RPMS
-cd SOURCES
-rm -rf $NAME-$VERSION $NAME-$VERSION.tar.gz
echo "Checking out source code . . ."
-cvs export -r $CVSTAG -d $NAME-$VERSION $NAME > /dev/null 2>&1
+cvs export -r $CVSTAG $CVSNAME > /dev/null 2>&1
+
+echo "Creating the spec file $flavor-ds.spec . . ."
+cd $CVSNAME ; make $flavor-ds.spec ; cp $flavor-ds.spec $rootdir ; cd $rootdir/SOURCES
+
+echo "Get version from spec file . . ."
+VERSION=`grep \^Version $rootdir/$flavor-ds.spec | awk '{print $2}'`
+
echo "Building tarball . . ."
-tar cf - $NAME-$VERSION | gzip > $NAME-$VERSION.tar.gz
-rm -rf $NAME-$VERSION
-cd ..
+mv $CVSNAME $flavor-ds-$VERSION
+tar cfh - $flavor-ds-$VERSION | gzip > $flavor-ds-$VERSION.tar.gz
+rm -rf $flavor-ds-$VERSION
+cd $rootdir
+
+macrosfile=/tmp/macros.$$
+trap "rm -f $macrosfile" 0 1 2 3 15
+
+echo "%_topdir $rootdir" > $macrosfile
+
echo "Executing rpmbuild . . ."
-rpmbuild -ba $NAME.spec
-echo "Finished doing rpmbuild $NAME.spec"
+rpmbuild --macros=$macrosfile -ba $flavor-ds.spec
+echo "Finished doing rpmbuild $flavor-ds.spec"
diff --git a/ldapserver.spec b/ldapserver.spec.tmpl
index 1fdd532e..7a3bf006 100644
--- a/ldapserver.spec
+++ b/ldapserver.spec.tmpl
@@ -2,13 +2,13 @@
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
-Summary: Directory Server
-Name: ldapserver
-Version: 7.1
-Release: 0
-License: GPL
+Summary: @COMPANY-PRODUCT-NAME@
+Name: @LCASE-COMPANY-NAME-NOSP@-ds
+Version: @GEN-VERSION@
+Release: 1.@PLATFORM@
+License: GPL plus extensions
Group: System Environment/Daemons
-URL: http://www.redhat.com
+URL: @COMPANY-URL@
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_builddir}/%{name}-root
BuildPreReq: perl, fileutils, make
@@ -20,7 +20,7 @@ Requires: perl
Prefix: /opt/%{name}
%description
-ldapserver is an LDAPv3 compliant server.
+@COMPANY-PRODUCT-NAME@ is an LDAPv3 compliant server.
# prep and setup expect there to be a Source0 file
# in the SOURCES directory - it will be unpacked
@@ -37,24 +37,22 @@ ldapserver is an LDAPv3 compliant server.
# build the file structure to package under ldapserver/pkg
# instead of MM.DD/platform
# remove BUILD_DEBUG=optimize to build the debug version
-make BUILD_JAVA_CODE=1 BUILD_DEBUG=optimize NO_INSTALLER_TAR_FILES=1 INSTDIR=../../pkg
+# INTERNAL_BUILD=1 uses the internal, proprietary packages
+# like setupsdk, adminsdk, admin server
+# BUILD_MODE=int builds the Redhat branded product
+BUILDMODE=@BUILD-MODE@
+if [ $BUILDMODE = int ]; then
+# brandDirectory makes the product use Redhat branded text and graphics
+ make brandDirectory
+fi
+make INTERNAL_BUILD=1 BUILD_MODE=$BUILDMODE BUILD_JAVA_CODE=1 BUILD_DEBUG=optimize NO_INSTALLER_TAR_FILES=1 INSTDIR=../../pkg
%install
# all we do here is run setup -b to unpack the binaries
# into the BuildRoot
rm -rf $RPM_BUILD_ROOT
cd pkg
-# hack hack hack
-# hack for unbundled jre - please fix!!!!!!
-export NSJRE=/share/builds/components/jdk/1.4.2/Linux/jre
-mkdir tmp
-cd tmp
-mkdir -p bin/base/jre
-cp -r $NSJRE/bin bin/base/jre
-cp -r $NSJRE/lib bin/base/jre
-zip -q -r ../base/nsjre.zip bin
-cd ..
-rm -rf tmp
+# the echo yes is for dsktune to continue
echo yes | ./setup -b $RPM_BUILD_ROOT/%{prefix}
# this is our setup script that sets up the initial
# server instances after installation
@@ -76,6 +74,9 @@ echo ""
echo "Please cd " %{prefix} " and run ./setup/setup"
%changelog
+* Tue Mar 29 2005 Richard Megginson <rich@localhost.localdomain> 7.1-1
+- use INTERNAL_BUILD=1 for internal builds - change rev to 1
+
* Tue Mar 8 2005 Richard Megginson <rich@localhost.localdomain> 7.1-0
- use ${prefix} instead of /opt/ldapserver - prefix is defined as /opt/%{name}