[drupal7] Allow use of auto-provides <EL-6.
Jon Ciesla
limb at fedoraproject.org
Tue May 21 18:28:25 UTC 2013
commit 3ad13468ff5c8a0430a74095ed42d726e3a21b81
Author: Jon Ciesla <limburgher at gmail.com>
Date: Tue May 21 13:23:59 2013 -0500
Allow use of auto-provides <EL-6.
drupal7.prov | 5 +++++
drupal7.spec | 18 +++++++++++++++---
macros.drupal7 | 7 +++++++
3 files changed, 27 insertions(+), 3 deletions(-)
---
diff --git a/drupal7.prov b/drupal7.prov
index 5495296..c11cafb 100644
--- a/drupal7.prov
+++ b/drupal7.prov
@@ -26,6 +26,7 @@ Parsed from *.info files.
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
+import subprocess
import sys
import os
@@ -37,6 +38,10 @@ def main():
if path.endswith('.info'):
print 'drupal7(' + os.path.basename(path)[:-len('.info')] + ')'
+ # Invoke the regular RPM provides generator to allow compatibility with RPM < 4.9 (no fileattrs)
+ p = subprocess.Popen(['/usr/lib/rpm/find-provides'], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
+ print p.communicate(input='\n'.join(paths))[0]
+
if __name__ == '__main__':
main()
diff --git a/drupal7.spec b/drupal7.spec
index 2b0d544..7f295ae 100644
--- a/drupal7.spec
+++ b/drupal7.spec
@@ -4,7 +4,7 @@ AutoReqProv: no
%define drupaldir %{_datadir}/drupal7
Name: drupal7
Version: 7.22
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: An open-source content-management platform
Group: Applications/Publishing
@@ -20,6 +20,8 @@ Source6: %{name}.attr
Source7: %{name}.prov
Patch0: %{name}-7.4-scripts-noshebang.patch
Patch1: drupal-7.14-CVE-2012-2922.patch
+# Allow compatibility with RPM < 4.9 (no fileattrs)
+%{!?_fileattrsdir:Patch2: %{name}-rpm-no-fileattrs.patch}
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -45,6 +47,11 @@ Group: Development/Tools
%patch0 -p1
%patch1 -p0
+# Allow compatibility with RPM < 4.9 (no fileattrs)
+cp %{SOURCE5} .
+cp %{SOURCE7} .
+%{!?_fileattrsdir:%patch2}
+
chmod -x scripts/drupal.sh
chmod -x scripts/password-hash.sh
chmod -x scripts/run-tests.sh
@@ -77,10 +84,10 @@ mv %{buildroot}%{_sysconfdir}/%{name}/example.sites.php .
# rpmbuild
mkdir -p %{buildroot}%{_sysconfdir}/rpm/
-install -pm0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/rpm/macros.drupal7
+install -pm0644 macros.%{name} %{buildroot}%{_sysconfdir}/rpm/macros.drupal7
mkdir -p %{buildroot}%{_prefix}/lib/rpm/fileattrs
install -pm0644 %{SOURCE6} %{buildroot}%{_prefix}/lib/rpm/fileattrs/
-install -pm0755 %{SOURCE7} %{buildroot}%{_prefix}/lib/rpm/
+install -pm0755 %{name}.prov %{buildroot}%{_prefix}/lib/rpm/
%clean
rm -rf %{buildroot}
@@ -97,6 +104,8 @@ rm -rf %{buildroot}
%exclude %{drupaldir}/UPGRADE.txt
%exclude %{drupaldir}/COPYRIGHT.txt
%exclude %{drupaldir}/README.txt
+%exclude %{drupaldir}/macros.%{name}
+%exclude %{drupaldir}/%{name}.prov
%dir %{_sysconfdir}/%{name}
%{_sysconfdir}/rpm/macros.drupal7
%config(noreplace) %{_sysconfdir}/%{name}/all
@@ -116,6 +125,9 @@ rm -rf %{buildroot}
%{_prefix}/lib/rpm/%{name}.prov
%changelog
+* Tue May 21 2013 Jon Ciesla <limburgher at gmail.com> - 7.22-4
+- Apply patches to allow auto-provides usage <EL-6
+
* Thu May 09 2013 Jon Ciesla <limburgher at gmail.com> - 7.22-3
- Change rpmconfigdir to %{_prefix}/lib/rpm to support EL-5.
diff --git a/macros.drupal7 b/macros.drupal7
index 51d86bc..3877216 100644
--- a/macros.drupal7
+++ b/macros.drupal7
@@ -2,3 +2,10 @@
%drupal7_modules %{drupal7}/modules
%drupal7_themes %{drupal7}/themes
%drupal7_libraries %{_sysconfdir}/drupal7/all/libraries
+
+# Macro to allow spec compatibility with RPM < 4.9 (no fileattrs)
+%drupal7_find_provides_and_requires %{expand: \
+%global _use_internal_dependency_generator 0
+%global __find_provides %{_rpmconfigdir}/drupal7.prov
+%global __find_requires %{_rpmconfigdir}/drupal7.req
+}
More information about the scm-commits
mailing list