Accepting request 489392 from home:dmdiss:samba_stable_git_migration_v2

- Generate source tarball directly from Git using OBS tar_scm
  + use version string derived from parent Git tag and commit hash
    - remove obsolete vendor-files/tools/package-data version ID
  + explicitly generate ctdb manpages, needed without "make dist"

OBS-URL: https://build.opensuse.org/request/show/489392
OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/samba?expand=0&rev=559
This commit is contained in:
Aurelien Aptel
2017-04-20 12:26:04 +00:00
committed by Git OBS Bridge
parent 9bcb70be0d
commit 3c207d7687
9 changed files with 55 additions and 138 deletions

View File

@@ -130,16 +130,6 @@ BuildRequires: libpcp-devel
BuildRequires: libcephfs-devel
BuildRequires: librados-devel
%endif
%define samba_ver 4.6.2
%define samba_ver_suffix %nil
%if "%{samba_ver_suffix}" == ""
%define samba_source_location https://ftp.samba.org/pub/samba/stable/samba-%{version}.tar.gz
%define samba_source_signature_location https://ftp.samba.org/pub/samba/stable/samba-%{version}.tar.asc
%else
%define samba_source_location https://ftp.samba.org/pub/samba/rc/samba-%{version}%{samba_ver_suffix}.tar.gz
%define samba_source_signature_location https://ftp.samba.org/pub/samba/rc/samba-%{version}%{samba_ver_suffix}.tar.asc
%endif
%define samba_ver_full %{samba_ver}%{samba_ver_suffix}
%if 0%{?suse_version} && 0%{?suse_version} < 1031
%define libsmbclient_name libsmbclient
%else
@@ -156,7 +146,7 @@ BuildRequires: librados-devel
%define BRANCH %{version}
%global with_mitkrb5 1
%global with_dc 0
Version: 4.6.2
Version: 4.6.2+git.19.c267455e57b
Release: 0
Url: https://www.samba.org/
Obsoletes: samba-gplv3 < %{version}
@@ -168,11 +158,8 @@ Recommends: logrotate
Summary: A SMB/CIFS File, Print, and Authentication Server
License: GPL-3.0+
Group: Productivity/Networking/Samba
Source: %{samba_source_location}
Source5: %{samba_source_signature_location}
Source6: samba.keyring
Source: samba-%{version}.tar.bz2
Source1: vendor-files.tar.bz2
Source2: patches.tar.bz2
Source4: baselibs.conf
Source100: samba-client-rpmlintrc
Requires: /usr/bin/getent
@@ -1052,21 +1039,11 @@ that RADOS locks can be used for CTDB split-brain avoidance.
%prep
%setup -n samba-%{samba_ver_full} -q
# patches
%setup -T -D -a 2 -n samba-%{samba_ver_full} -q
for patch in $( patches/tools/guards %{guards_symbols} <patches/series); do
if ! patch -s -E -p0 --no-backup-if-mismatch -i patches/$patch; then
echo "*** Patch $patch failed ***"
exit 1
fi
done
%setup -n samba-%{version} -q
# vendor-files (config, scripts, tools)
%setup -T -D -a 1 -n samba-%{samba_ver_full} -q
%setup -T -D -a 1 -n samba-%{version} -q
install -m 0644 -p vendor-files/docu/rfc3454.txt source4/heimdal/lib/wind/
# Create and add vendor suffix
test -f vendor-files/tools/package-data && \
. vendor-files/tools/package-data
if test "%{_project}" != "openSUSE:Factory"; then
vendor_tag_release=$( grep -m 1 ^Release: ${RPM_SOURCE_DIR}/samba.spec | \
while read tag release; do \
@@ -1075,8 +1052,9 @@ if test "%{_project}" != "openSUSE:Factory"; then
else
vendor_tag_release=""
fi
vendor_tag=$( echo -n "${vendor_tag_release}"; \
echo -n "${SAMBA_PACKAGE_SVN_VERSION:+${SAMBA_PACKAGE_SVN_VERSION}-}" )
# ensure Git commit portion of version string is retained
vendor_tag=$(echo -n %{version} | sed "s/.*+git/git/"; \
echo -n "${vendor_tag_release}" )
# Create product suffix
test 0%{?centos_version} -gt 0 && product_version=%{?centos_version}
test 0%{?fedora_version} -gt 0 && product_version=%{?fedora_version}
@@ -1163,6 +1141,10 @@ autoconf && ./configure
XML_CATALOG_FILES="file:///etc/xml/catalog file://$(pwd)/build/catalog.xml" make htmlman
popd
pushd ctdb
XML_CATALOG_FILES="file:///etc/xml/catalog file://$(pwd)/build/catalog.xml" make manpages
popd
pushd pidl
%{__perl} Makefile.PL INSTALLDIRS=vendor
popd
@@ -1349,16 +1331,16 @@ install -m 0644 config/sysconfig.firewall.samba-client \
# Add logrotate settings for nmbd and smbd only on systems newer than 8.1.
%if 0%{?suse_version} && 0%{?suse_version} < 811
LOGROTATE_FILES="samba-winbind"
rm -f "${RPM_BUILD_DIR}/samba-%{samba_ver_full}/filelist-samba"
touch "${RPM_BUILD_DIR}/samba-%{samba_ver_full}/filelist-samba"
rm -f "${RPM_BUILD_DIR}/samba-%{version}/filelist-samba"
touch "${RPM_BUILD_DIR}/samba-%{version}/filelist-samba"
%else
LOGROTATE_FILES="samba samba-winbind"
%endif
for file in ${LOGROTATE_FILES}; do
install -m 0644 logrotate/${file} %{buildroot}/%{_sysconfdir}/logrotate.d/${file}
rm -f "${RPM_BUILD_DIR}/samba-%{samba_ver_full}/filelist-${file}"
touch "${RPM_BUILD_DIR}/samba-%{samba_ver_full}/filelist-${file}"
echo "%config(noreplace) %{_sysconfdir}/logrotate.d/${file}" >>${RPM_BUILD_DIR}/samba-%{samba_ver_full}/filelist-${file}
rm -f "${RPM_BUILD_DIR}/samba-%{version}/filelist-${file}"
touch "${RPM_BUILD_DIR}/samba-%{version}/filelist-${file}"
echo "%config(noreplace) %{_sysconfdir}/logrotate.d/${file}" >>${RPM_BUILD_DIR}/samba-%{version}/filelist-${file}
done
install -m 0644 docu/README.SUSE %{buildroot}/%{DOCDIR}/
# SUSEhelp files
@@ -1392,14 +1374,14 @@ for file in $( find %{buildroot}%{DOCDIR} -maxdepth 1); do
case "${file#%{buildroot}}" in
%{DOCDIR}|%{DOCDIR}/README.%{VENDOR}|%{DOCDIR}/docbook) continue ;;
esac
echo "%doc ${file#%{buildroot}}" >>"${RPM_BUILD_DIR}/samba-%{samba_ver_full}/filelist-samba-doc"
echo "%doc ${file#%{buildroot}}" >>"${RPM_BUILD_DIR}/samba-%{version}/filelist-samba-doc"
done
for file in $( find %{buildroot}%{_libdir}/samba/vfs/ -mindepth 1 ); do
# if built we don't want vfs_ceph in the base package
case "${file#%{buildroot}}" in
%{_libdir}/samba/vfs/ceph.so) continue ;;
esac
echo "${file#%{buildroot}}" >>${RPM_BUILD_DIR}/samba-%{samba_ver_full}/filelist-samba
echo "${file#%{buildroot}}" >>${RPM_BUILD_DIR}/samba-%{version}/filelist-samba
done
# only package Man pages for VFS modules that we ship
for file in %{buildroot}%{_mandir}/man8/vfs_*; do
@@ -1424,7 +1406,7 @@ for file in %{buildroot}%{_mandir}/man8/vfs_*; do
;;
esac
# wildcard suffix to account for subsequent gzip
echo "${file#%{buildroot}}*" >>${RPM_BUILD_DIR}/samba-%{samba_ver_full}/filelist-samba
echo "${file#%{buildroot}}*" >>${RPM_BUILD_DIR}/samba-%{version}/filelist-samba
done
# copy the schema
install -m 0644 examples/LDAP/samba.schema %{buildroot}/%{_sysconfdir}/openldap/schema/samba3.schema
@@ -1433,7 +1415,7 @@ install -m 0644 examples/LDAP/samba-nds.schema %{buildroot}/%{_datadir}/samba/LD
%if 0%{?suse_version} == 0 || 0%{?suse_version} > 1000 && 0%{?suse_version} < 1120
while read file; do
rm -r "%{buildroot}/${file#%* }"
done <"${RPM_BUILD_DIR}/samba-%{samba_ver_full}/filelist-samba-doc"
done <"${RPM_BUILD_DIR}/samba-%{version}/filelist-samba-doc"
for file in %{_datadir}/susehelp; do
rm -r "%{buildroot}/${file}"
done