浏览代码

Bug(s) fixed: 172818
Bug Description: Allow ldapserver rpm to be made externally
Reviewed by: Noriko (Thanks!)
Fix Description: Just use a simple sed command to replace the tokens in
the spec.tmpl file. Just assume Fedora branding for this. For some
reason, on FC4, the setup -b step does not work unless I added a second
echo yes to the command. The tar command used by the rpmbuild step must
have all of the command line arguments before the directory to tar. I
moved some things around to make the rpm build process more dsbuild
friendly.
Platforms tested: FC4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none

Rich Megginson 20 年之前
父节点
当前提交
7aded9df4e
共有 3 个文件被更改,包括 18 次插入4 次删除
  1. 11 0
      Makefile
  2. 5 3
      ldap/cm/Makefile
  3. 2 1
      ldapserver.spec.tmpl

+ 11 - 0
Makefile

@@ -346,7 +346,18 @@ redhat-ds.spec: ldapserver.spec.tmpl branding/rhds/brandver.dat $(RELTOOLSPATH)/
 	$(RELTOOLSPATH)/brandver.pl -i branding/rhds/brandver.dat $@
 	mv $@ $(OBJDIR)
 
+ifdef INTERNAL_BUILD
 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 $@
 	mv $@ $(OBJDIR)
+else
+fedora-ds.spec: ldapserver.spec.tmpl
+	sed -e s/@PLATFORM@/$(BUILD_ARCH)/g \
+	-e 's/@COMPANY-PRODUCT-NAME@/Fedora Directory Server/g' \
+	-e 's/@LCASE-COMPANY-NAME-NOSP@/fedora/g' \
+	-e 's/@GEN-VERSION@/1.0/g' \
+	-e 's+@COMPANY-URL@+http://directory.fedora.redhat.com/+g' \
+	ldapserver.spec.tmpl > $@
+	mv $@ $(OBJDIR)
+endif # INTERNAL_BUILD

+ 5 - 3
ldap/cm/Makefile

@@ -712,10 +712,12 @@ ifdef BUILD_RPM
 	startdir=`pwd` ; cd $(BUILD_ROOT) ; builddir=`pwd` ; \
 	cd $$startdir ; cd $(INSTDIR)/.. ; \
 	if [ ! -f $(RPM_FILE_BASE).tar.gz ] ; then \
-		if [ ! -f $(RPM_FILE_BASE) ] ; then \
+		if [ ! -d $(RPM_FILE_BASE) -a ! -f $(RPM_FILE_BASE) ] ; then \
 			ln -s $$builddir $(RPM_FILE_BASE) ; \
-		fi ; tar cfh - --exclude \*/built --exclude \*/CVS $(RPM_FILE_BASE) --exclude \*/branding --exclude \*/RHEL* | gzip > $(RPM_FILE_BASE).tar.gz ; \
-		rm $(RPM_FILE_BASE) ; \
+		fi ; tar cfh - --exclude \*/built --exclude \*/CVS --exclude \*/branding --exclude \*/RHEL* $(RPM_FILE_BASE) | gzip > $(RPM_FILE_BASE).tar.gz ; \
+		if [ -h $(RPM_FILE_BASE) ] ; then \
+			rm $(RPM_FILE_BASE) ; \
+		fi ; \
 	fi
 # execute the RPM build
 	rpmbuild $(RPM_TOPDIR) $(RPM_SOURCEDIR) $(RPM_BUILDDIR) $(RPM_RPMDIR) $(RPM_SRPMDIR) $(RPM_REQUIRES) --define "flavor $(RPM_FLAVOR)" --clean --nodeps -ba $(OBJDIR)/$(RPM_BASE_NAME)-ds.spec

+ 2 - 1
ldapserver.spec.tmpl

@@ -76,7 +76,8 @@ Prefix: /opt/%{name}
 # all we do here is run setup -b to unpack the binaries
 # into the BuildRoot
 # the echo yes is for dsktune to continue
-echo yes | ./setup -b $RPM_BUILD_ROOT/%{prefix}
+# the second echo yes is for some platforms that need it
+(echo yes ; echo yes) | ./setup -b $RPM_BUILD_ROOT/%{prefix}
 
 %clean
 if [ -z "$RPM_INSTALL_PREFIX" ]; then