Browse Source

Ticket 48824 - Cleanup rpm.mk and 389 specfile

Description:  Removed the jeamlloc bundling code.
              Set a version requirement for srvcore.
              Set ASAN to off by default.
              Removed incorrect comparison:  %if %0{?VAR:1}  which only
               checks if the VAR is defined, not what it is set to.  So
               those checks always returned true, even if the VAR was set
               to 0.

https://fedorahosted.org/389/ticket/48824

Reviewed by: nhosoi(Thanks!)
Mark Reynolds 9 years ago
parent
commit
347b3fee61
2 changed files with 18 additions and 66 deletions
  1. 3 11
      rpm.mk
  2. 15 55
      rpm/389-ds-base.spec.in

+ 3 - 11
rpm.mk

@@ -4,12 +4,10 @@ RPM_RELEASE ?= $(shell $(PWD)/rpm/rpmverrel.sh release)
 PACKAGE = 389-ds-base
 RPM_NAME_VERSION = $(PACKAGE)-$(RPM_VERSION)
 TARBALL = $(RPM_NAME_VERSION).tar.bz2
-NUNC_STANS_URL ?= $(shell rpmspec -P -D 'use_nunc_stans 1' $(RPMBUILD)/SPECS/389-ds-base.spec | awk '/^Source4:/ {print $$2}')
+NUNC_STANS_URL ?= $(shell rpmspec -P -D 'use_nunc_stans 1' $(RPMBUILD)/SPECS/389-ds-base.spec | awk '/^Source3:/ {print $$2}')
 NUNC_STANS_TARBALL ?= $(shell basename "$(NUNC_STANS_URL)")
-JEMALLOC_URL ?= $(shell rpmspec -P $(RPMBUILD)/SPECS/389-ds-base.spec | awk '/^Source3:/ {print $$2}')
-JEMALLOC_TARBALL ?= $(shell basename "$(JEMALLOC_URL)")
 NUNC_STANS_ON = 1
-BUNDLE_JEMALLOC = 0
+ASAN_ON = 0
 
 clean:
 	rm -rf dist
@@ -27,9 +25,6 @@ tarballs: local-archive
 	if [ $(NUNC_STANS_ON) -eq 1 ]; then \
 	    wget $(NUNC_STANS_URL) ; \
 	fi ; \
-	if [ $(BUNDLE_JEMALLOC) -eq 1 ]; then \
-	    wget $(JEMALLOC_URL) ; \
-	fi
 
 rpmroot:
 	rm -rf $(RPMBUILD)
@@ -40,7 +35,7 @@ rpmroot:
 	mkdir -p $(RPMBUILD)/SRPMS
 	sed -e s/__VERSION__/$(RPM_VERSION)/ -e s/__RELEASE__/$(RPM_RELEASE)/ \
 	-e s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/ \
-	-e s/__BUNDLE_JEMALLOC__/$(BUNDLE_JEMALLOC)/ \
+	-e s/__ASAN_ON__/$(ASAN_ON)/ \
 	rpm/$(PACKAGE).spec.in > $(RPMBUILD)/SPECS/$(PACKAGE).spec
 
 rpmdistdir:
@@ -54,9 +49,6 @@ rpmbuildprep:
 	if [ $(NUNC_STANS_ON) -eq 1 ]; then \
 		cp dist/sources/$(NUNC_STANS_TARBALL) $(RPMBUILD)/SOURCES/ ; \
 	fi
-	if [ $(BUNDLE_JEMALLOC) -eq 1 ]; then \
-		cp dist/sources/$(JEMALLOC_TARBALL) $(RPMBUILD)/SOURCES/ ; \
-	fi
 	cp rpm/$(PACKAGE)-* $(RPMBUILD)/SOURCES/
 
 

+ 15 - 55
rpm/389-ds-base.spec.in

@@ -17,24 +17,16 @@
 # nunc-stans only builds on x86_64 for now
 # To build without nunc-stans, set use_nunc_stans to 0.
 %global use_nunc_stans __NUNC_STANS_ON__
-%if 0%{?use_nunc_stans:1}
+%if %{use_nunc_stans}
 %global nunc_stans_ver 0.1.8
 %endif
 
-# Are we bundling jemalloc?
-%global bundle_jemalloc __BUNDLE_JEMALLOC__
-%if 0%{?bundle_jemalloc:1}
-# The version used in the source tarball
-%global jemalloc_ver 3.6.0
-%endif
-
 # This enables an ASAN build. This should not go to production, so we rename.
 %global use_asan __ASAN_ON__
-%if 0%{?use_asan:1}
+%if %{use_asan}
 %global variant base-asan
 %endif
 
-
 # fedora 15 and later uses tmpfiles.d
 # otherwise, comment this out
 %{!?with_tmpfiles_d: %global with_tmpfiles_d %{_sysconfdir}/tmpfiles.d}
@@ -60,7 +52,7 @@ Provides:         ldif2ldbm
 
 BuildRequires:    nspr-devel
 BuildRequires:    nss-devel
-BuildRequires:    svrcore-devel
+BuildRequires:    svrcore-devel >= 4.1.2
 %if %{use_openldap}
 BuildRequires:    openldap-devel
 %else
@@ -89,7 +81,7 @@ BuildRequires:    tcp_wrappers
 BuildRequires:    pam-devel
 BuildRequires:    systemd-units
 BuildRequires:    systemd-devel
-%if 0%{?use_asan:1}
+%if %{use_asan}
 BuildRequires:    libasan
 %endif
 
@@ -138,7 +130,7 @@ Requires:         perl-Socket
 Requires:         perl-NetAddr-IP
 Requires:         systemd-libs
 
-%if 0%{?use_asan:1}
+%if %{use_asan}
 Requires:    libasan
 Requires:    llvm
 %endif
@@ -147,15 +139,11 @@ Source0:          http://port389.org/sources/%{name}-%{version}%{?prerel}.tar.bz
 # 389-ds-git.sh should be used to generate the source tarball from git
 Source1:          %{name}-git.sh
 Source2:          %{name}-devel.README
-
-%if 0%{?bundle_jemalloc:1}
-Source3:          http://www.port389.org/binaries/jemalloc-%{jemalloc_ver}.tar.bz2
-%endif
-%if 0%{?use_nunc_stans:1}
-Source4:          https://git.fedorahosted.org/cgit/nunc-stans.git/snapshot/nunc-stans-%{nunc_stans_ver}.tar.xz
+%if %{use_nunc_stans}
+Source3:          https://git.fedorahosted.org/cgit/nunc-stans.git/snapshot/nunc-stans-%{nunc_stans_ver}.tar.xz
 %endif
 
-%if 0%{?use_asan:1}
+%if %{use_asan}
 %description
 389 Directory Server is an LDAPv3 compliant server.  The base package includes
 the LDAP server and command line utilities for server administration.
@@ -187,17 +175,11 @@ BuildRequires:    libdb-devel
 BuildRequires:    cyrus-sasl-devel
 BuildRequires:    libicu-devel
 BuildRequires:    pcre-devel
-%if 0%{?use_nunc_stans:1}
+%if %{use_nunc_stans}
 BuildRequires:    libtalloc-devel
 BuildRequires:    libevent-devel
 BuildRequires:    libtevent-devel
 %endif
-%if 0%{?bundle_jemalloc:1}
-BuildRequires:    /usr/bin/xsltproc
-%ifnarch s390
-BuildRequires:    valgrind-devel
-%endif
-%endif
 BuildRequires:    systemd-devel
 
 %description      libs
@@ -240,16 +222,13 @@ The lib389 CI tests that can be run against the Directory Server.
 %prep
 %setup -q -n %{name}-%{version}%{?prerel}
 
-%if 0%{?bundle_jemalloc:1}
+%if %{use_nunc_stans}
 %setup -q -n %{name}-%{version}%{?prerel} -T -D -b 3
 %endif
-%if 0%{?use_nunc_stans:1}
-%setup -q -n %{name}-%{version}%{?prerel} -T -D -b 4
-%endif
 cp %{SOURCE2} README.devel
 
 %build
-%if 0%{?use_nunc_stans:1}
+%if %{use_nunc_stans}
 pushd ../nunc-stans-%{nunc_stans_ver}
 %configure --with-fhs --libdir=%{_libdir}/%{pkgname}
 make %{?_smp_mflags}
@@ -260,13 +239,6 @@ cp nunc-stans.h include/nunc-stans/nunc-stans.h
 popd
 %endif
 
-%if 0%{?bundle_jemalloc:1}
-pushd ../jemalloc-%{jemalloc_ver}
-%configure CFLAGS='%{optflags} -msse2' --libdir=%{_libdir}/%{pkgname}
-make %{?_smp_mflags}
-popd
-%endif
-
 %if %{use_openldap}
 OPENLDAP_FLAG="--with-openldap"
 %endif
@@ -278,7 +250,7 @@ NSSARGS="--with-svrcore-inc=%{_includedir} --with-svrcore-lib=%{_libdir} --with-
 NUNC_STANS_FLAGS="--enable-nunc-stans --with-nunc-stans=../nunc-stans-%{nunc_stans_ver}" 
 %endif
 
-%if 0%{?use_asan:1}
+%if %{use_asan}
 ASAN_FLAGS="--enable-asan --enable-debug"
 %endif
 
@@ -301,7 +273,7 @@ make %{?_smp_mflags}
 %install
 rm -rf $RPM_BUILD_ROOT 
 
-%if 0%{?use_nunc_stans:1}
+%if %{use_nunc_stans}
 pushd ../nunc-stans-%{nunc_stans_ver}
 make DESTDIR="$RPM_BUILD_ROOT" install
 rm -rf $RPM_BUILD_ROOT%{_includedir} $RPM_BUILD_ROOT%{_datadir} \
@@ -309,12 +281,6 @@ rm -rf $RPM_BUILD_ROOT%{_includedir} $RPM_BUILD_ROOT%{_datadir} \
 popd
 %endif
 
-%if 0%{?bundle_jemalloc:1}
-pushd ../jemalloc-%{jemalloc_ver}
-cp --preserve=links lib/libjemalloc.so* $RPM_BUILD_ROOT%{_libdir}/%{pkgname}
-popd
-%endif
-
 make DESTDIR="$RPM_BUILD_ROOT" install
 
 mkdir -p $RPM_BUILD_ROOT/var/log/%{pkgname}
@@ -474,12 +440,9 @@ fi
 %doc LICENSE LICENSE.GPLv3+ LICENSE.openssl README.devel
 %{_includedir}/%{pkgname}
 %{_libdir}/%{pkgname}/libslapd.so
-%if 0%{?use_nunc_stans:1}
+%if %{use_nunc_stans}
 %{_libdir}/%{pkgname}/libnunc-stans.so
 %endif
-%if 0%{?bundle_jemalloc:1}
-%{_libdir}/%{pkgname}/libjemalloc.so
-%endif
 %{_libdir}/pkgconfig/*
 
 %files libs
@@ -488,12 +451,9 @@ fi
 %dir %{_libdir}/%{pkgname}
 %{_libdir}/%{pkgname}/libslapd.so.*
 %{_libdir}/%{pkgname}/libns-dshttpd.so*
-%if 0%{?use_nunc_stans:1}
+%if %{use_nunc_stans}
 %{_libdir}/%{pkgname}/libnunc-stans.so*
 %endif
-%if 0%{?bundle_jemalloc:1}
-%{_libdir}/%{pkgname}/libjemalloc.so*
-%endif
 
 %files tests
 %defattr(-,root,root,-)