Makefile.am | 12 ++++++++----
Makefile.in | 13 +++++++++----
rpm/389-ds-base.spec.in | 33 +++++++++++++++++----------------
3 files changed, 34 insertions(+), 24 deletions(-)
New commits:
commit 22ec6b2f3d1344dcb729a46bb46bf7233f1ce1ce
Author: William Brown <firstyear(a)redhat.com>
Date: Sat Jan 2 16:22:47 2016 +1000
Ticket 48397 - Fix cwd and rpmsources target
Bug Description: The rpmbuild directory is placed into CWD instead of the build
directory.
The sources for the rpm must be manually downloaded.
Fix Description: Move the rpmbuild directory target to the autotools build
directory.
Add a new make target that, rpmsources that will fetch the required sources.
https://fedorahosted.org/389/ticket/48397
Author: wibrown
Review by: mreynolds
diff --git a/Makefile.am b/Makefile.am
index da09653..213922f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1950,7 +1950,7 @@ git-archive:
# RPM-related tasks
-RPMBUILD ?= $(PWD)/rpmbuild
+RPMBUILD ?= $(abs_builddir)/rpmbuild
rpmroot:
$(MKDIR_P) $(RPMBUILD)/BUILD
@@ -1965,6 +1965,9 @@ rpmbrprep: dist-bzip2 rpmroot
cp $(srcdir)/rpm/389-ds-base-devel.README $(RPMBUILD)/SOURCES
sed -e "s/__VERSION__/$(RPM_VERSION)/" -e
"s/__RELEASE__/$(RPM_RELEASE)/" -e
"s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/" <
$(abs_builddir)/rpm/389-ds-base.spec > $(RPMBUILD)/SPECS/389-ds-base.spec
+# Requires rpmdevtools. Consider making this a dependancy of rpms.
+rpmsources: rpmbrprep
+ spectool -g -S -C $(RPMBUILD)/SOURCES $(RPMBUILD)/SPECS/389-ds-base.spec
rpms: rpmbrprep
cd $(RPMBUILD); \
diff --git a/Makefile.in b/Makefile.in
index d808112..745d6a8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -10788,7 +10788,7 @@ git-archive:
# RPM-related tasks
-RPMBUILD ?= $(PWD)/rpmbuild
+RPMBUILD ?= $(abs_builddir)/rpmbuild
rpmroot:
$(MKDIR_P) $(RPMBUILD)/BUILD
@@ -10803,6 +10803,10 @@ rpmbrprep: dist-bzip2 rpmroot
cp $(srcdir)/rpm/389-ds-base-devel.README $(RPMBUILD)/SOURCES
sed -e "s/__VERSION__/$(RPM_VERSION)/" -e
"s/__RELEASE__/$(RPM_RELEASE)/" -e
"s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/" <
$(abs_builddir)/rpm/389-ds-base.spec > $(RPMBUILD)/SPECS/389-ds-base.spec
+# Requires rpmdevtools. Consider making this a dependancy of rpms.
+rpmsources: rpmbrprep
+ spectool -g -S -C $(RPMBUILD)/SOURCES $(RPMBUILD)/SPECS/389-ds-base.spec
+
rpms: rpmbrprep
cd $(RPMBUILD); \
rpmbuild --define "_topdir $(RPMBUILD)" -ba SPECS/389-ds-base.spec
commit 0eb6f5b9a6f76c507ca8c7febf856713588ee5d0
Author: William Brown <firstyear(a)redhat.com>
Date: Sat Jan 2 09:24:24 2016 +1000
Ticket 48397 - ds make rpms doesn't work in a prefixed build env
Bug Description: if you run a prefixed build, make rpms does not work.
Additionally, rpmbuild throws invalid %if errors with this .spec
Fix Description: This fixes the build paths to work regardless of prefix build
or not. This also fixes the rpm if macros to work, and the missing dirsrvtests
from the dist component of Makefile.am
https://fedorahosted.org/389/ticket/48397
Author: wibrown
Review by: mreynolds
diff --git a/Makefile.am b/Makefile.am
index bca6489..da09653 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -474,6 +474,7 @@ dist_noinst_DATA = \
$(srcdir)/VERSION.sh \
$(srcdir)/wrappers/*.in \
$(srcdir)/wrappers/systemd.template.sysconfig \
+ $(srcdir)/dirsrvtests \
$(NULL)
#------------------------
@@ -1960,9 +1961,9 @@ rpmroot:
rpmbrprep: dist-bzip2 rpmroot
cp $(distdir).tar.bz2 $(RPMBUILD)/SOURCES
- cp $(builddir)/rpm/389-ds-base-git.sh $(RPMBUILD)/SOURCES
- cp $(builddir)/rpm/389-ds-base-devel.README $(RPMBUILD)/SOURCES
- sed -e "s/__VERSION__/$(RPM_VERSION)/" -e
"s/__RELEASE__/$(RPM_RELEASE)/" -e
"s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/" < $(builddir)/rpm/389-ds-base.spec
> $(RPMBUILD)/SPECS/389-ds-base.spec
+ cp $(srcdir)/rpm/389-ds-base-git.sh $(RPMBUILD)/SOURCES
+ cp $(srcdir)/rpm/389-ds-base-devel.README $(RPMBUILD)/SOURCES
+ sed -e "s/__VERSION__/$(RPM_VERSION)/" -e
"s/__RELEASE__/$(RPM_RELEASE)/" -e
"s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/" <
$(abs_builddir)/rpm/389-ds-base.spec > $(RPMBUILD)/SPECS/389-ds-base.spec
rpms: rpmbrprep
diff --git a/Makefile.in b/Makefile.in
index c5637ab..d808112 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1886,6 +1886,7 @@ dist_noinst_DATA = \
$(srcdir)/VERSION.sh \
$(srcdir)/wrappers/*.in \
$(srcdir)/wrappers/systemd.template.sysconfig \
+ $(srcdir)/dirsrvtests \
$(NULL)
@@ -10798,9 +10799,9 @@ rpmroot:
rpmbrprep: dist-bzip2 rpmroot
cp $(distdir).tar.bz2 $(RPMBUILD)/SOURCES
- cp $(builddir)/rpm/389-ds-base-git.sh $(RPMBUILD)/SOURCES
- cp $(builddir)/rpm/389-ds-base-devel.README $(RPMBUILD)/SOURCES
- sed -e "s/__VERSION__/$(RPM_VERSION)/" -e
"s/__RELEASE__/$(RPM_RELEASE)/" -e
"s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/" < $(builddir)/rpm/389-ds-base.spec
> $(RPMBUILD)/SPECS/389-ds-base.spec
+ cp $(srcdir)/rpm/389-ds-base-git.sh $(RPMBUILD)/SOURCES
+ cp $(srcdir)/rpm/389-ds-base-devel.README $(RPMBUILD)/SOURCES
+ sed -e "s/__VERSION__/$(RPM_VERSION)/" -e
"s/__RELEASE__/$(RPM_RELEASE)/" -e
"s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/" <
$(abs_builddir)/rpm/389-ds-base.spec > $(RPMBUILD)/SPECS/389-ds-base.spec
rpms: rpmbrprep
cd $(RPMBUILD); \
diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in
index 68d7830..7dfa0b5 100644
--- a/rpm/389-ds-base.spec.in
+++ b/rpm/389-ds-base.spec.in
@@ -14,13 +14,13 @@
# 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 %{use_nunc_stans}
+%if 0%{?use_nunc_stans:1}
%global nunc_stans_ver 0.1.7
%endif
# Are we bundling jemalloc?
%global bundle_jemalloc __BUNDLE_JEMALLOC__
-%if %{bundle_jemalloc}
+%if 0%{?bundle_jemalloc:1}
# The version used in the source tarball
%global jemalloc_ver 3.6.0
%endif
@@ -128,10 +128,10 @@ Source0:
http://port389.org/sources/%{name}-%{version}%{?prerel}.tar.bz
Source1: %{name}-git.sh
Source2: %{name}-devel.README
-%if %{bundle_jemalloc}
+%if 0%{?bundle_jemalloc:1}
Source3:
http://www.port389.org/binaries/jemalloc-%{jemalloc_ver}.tar.bz2
%endif
-%if %{use_nunc_stans}
+%if 0%{?use_nunc_stans:1}
Source4:
https://git.fedorahosted.org/cgit/nunc-stans.git/snapshot/nunc-stans-%{nu...
%endif
@@ -158,12 +158,12 @@ BuildRequires: libdb-devel
BuildRequires: cyrus-sasl-devel
BuildRequires: libicu-devel
BuildRequires: pcre-devel
-%if %{use_nunc_stans}
+%if 0%{?use_nunc_stans:1}
BuildRequires: libtalloc-devel
BuildRequires: libevent-devel
BuildRequires: libtevent-devel
%endif
-%if %{bundle_jemalloc}
+%if 0%{?bundle_jemalloc:1}
BuildRequires: /usr/bin/xsltproc
%ifnarch s390
BuildRequires: valgrind-devel
@@ -208,16 +208,16 @@ The lib389 CI tests that can be run against the Directory Server.
%prep
%setup -q -n %{name}-%{version}%{?prerel}
-%if %{bundle_jemalloc}
+%if 0%{?bundle_jemalloc:1}
%setup -q -n %{name}-%{version}%{?prerel} -T -D -b 3
%endif
-%if %{use_nunc_stans}
+%if 0%{?use_nunc_stans:1}
%setup -q -n %{name}-%{version}%{?prerel} -T -D -b 4
%endif
cp %{SOURCE2} README.devel
%build
-%if %{use_nunc_stans}
+%if 0%{?use_nunc_stans:1}
pushd ../nunc-stans-%{nunc_stans_ver}
%configure --with-fhs --libdir=%{_libdir}/%{pkgname}
make %{?_smp_mflags}
@@ -228,7 +228,7 @@ cp nunc-stans.h include/nunc-stans/nunc-stans.h
popd
%endif
-%if %{bundle_jemalloc}
+%if 0%{?bundle_jemalloc:1}
pushd ../jemalloc-%{jemalloc_ver}
%configure CFLAGS='%{optflags} -msse2' --libdir=%{_libdir}/%{pkgname}
make %{?_smp_mflags}
@@ -262,7 +262,7 @@ make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
-%if %{use_nunc_stans}
+%if 0%{?use_nunc_stans:1}
pushd ../nunc-stans-%{nunc_stans_ver}
make DESTDIR="$RPM_BUILD_ROOT" install
rm -rf $RPM_BUILD_ROOT%{_includedir} $RPM_BUILD_ROOT%{_datadir} \
@@ -270,7 +270,7 @@ rm -rf $RPM_BUILD_ROOT%{_includedir} $RPM_BUILD_ROOT%{_datadir} \
popd
%endif
-%if %{bundle_jemalloc}
+%if 0%{?bundle_jemalloc:1}
pushd ../jemalloc-%{jemalloc_ver}
cp --preserve=links lib/libjemalloc.so* $RPM_BUILD_ROOT%{_libdir}/%{pkgname}
popd
@@ -294,6 +294,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/%{pkgname}/plugins/*.la
# make sure perl scripts have a proper shebang
sed -i -e 's|#{{PERL-EXEC}}|#!/usr/bin/perl|'
$RPM_BUILD_ROOT%{_datadir}/%{pkgname}/script-templates/template-*.pl
+# Why are we not making this a proper python package?
pushd ../%{name}-%{version}%{?prerel}
cp -r dirsrvtests $RPM_BUILD_ROOT/%{_sysconfdir}/%{pkgname}
find $RPM_BUILD_ROOT/%{_sysconfdir}/%{pkgname}/dirsrvtests -type f -name '*.pyc'
-delete
@@ -434,10 +435,10 @@ fi
%doc LICENSE LICENSE.GPLv3+ LICENSE.openssl README.devel
%{_includedir}/%{pkgname}
%{_libdir}/%{pkgname}/libslapd.so
-%if %{use_nunc_stans}
+%if 0%{?use_nunc_stans:1}
%{_libdir}/%{pkgname}/libnunc-stans.so
%endif
-%if %{bundle_jemalloc}
+%if 0%{?bundle_jemalloc:1}
%{_libdir}/%{pkgname}/libjemalloc.so
%endif
%{_libdir}/pkgconfig/*
@@ -448,10 +449,10 @@ fi
%dir %{_libdir}/%{pkgname}
%{_libdir}/%{pkgname}/libslapd.so.*
%{_libdir}/%{pkgname}/libns-dshttpd.so*
-%if %{use_nunc_stans}
+%if 0%{?use_nunc_stans:1}
%{_libdir}/%{pkgname}/libnunc-stans.so*
%endif
-%if %{bundle_jemalloc}
+%if 0%{?bundle_jemalloc:1}
%{_libdir}/%{pkgname}/libjemalloc.so*
%endif