diff --git a/drupal7.prov b/drupal7.prov deleted file mode 100755 index eb232f7..0000000 --- a/drupal7.prov +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/python2 - -""" -Automatic provides generator for Drupal 7 modules, profiles, and themes. - -Parsed from *.info files. - -First command line argument is used as version if provided. -""" - -# Copyright 2013-2018 Shawn Iwinski -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -import re -import sys -import os - - -RE_HIDDEN = re.compile(r'hidden\s*=\s*TRUE', re.IGNORECASE) - - -def main(): - version = sys.argv[1] if len(sys.argv) > 1 else None - paths = [path.rstrip() for path in sys.stdin.readlines()] - - for path in paths: - if path.endswith('.info') and not re.search(RE_HIDDEN, open(path).read()): - print 'drupal7(' + os.path.basename(path)[:-len('.info')] + ')', - if version is not None: - print '=', version - else: - print '' - - -if __name__ == '__main__': - main() diff --git a/drupal7.prov.python b/drupal7.prov.python new file mode 100755 index 0000000..bf7ebfc --- /dev/null +++ b/drupal7.prov.python @@ -0,0 +1,61 @@ +#!/usr/bin/python + +""" +Automatic provides generator for Drupal 7 modules, profiles, and themes. + +Parsed from *.info files. + +First command line argument is used as version if provided. +""" + +# Copyright 2013-2019 Shawn Iwinski +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import re +import subprocess +import sys +import os + + +RE_HIDDEN = re.compile(r'hidden\s*=\s*TRUE', re.IGNORECASE) + + +def main(): + version = None + if len(sys.argv) > 1: + version = sys.argv[1] + + paths = [path.rstrip() for path in sys.stdin.readlines()] + + for path in paths: + if path.endswith('.info') and not re.search(RE_HIDDEN, open(path).read()): + print 'drupal7(' + os.path.basename(path)[:-len('.info')] + ')', + if version is not None: + print '=', version + else: + print '' + + # 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.prov.python2 b/drupal7.prov.python2 new file mode 100755 index 0000000..5176f87 --- /dev/null +++ b/drupal7.prov.python2 @@ -0,0 +1,53 @@ +#!/usr/bin/python2 + +""" +Automatic provides generator for Drupal 7 modules, profiles, and themes. + +Parsed from *.info files. + +First command line argument is used as version if provided. +""" + +# Copyright 2013-2019 Shawn Iwinski +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import re +import sys +import os + + +RE_HIDDEN = re.compile(r'hidden\s*=\s*TRUE', re.IGNORECASE) + + +def main(): + version = sys.argv[1] if len(sys.argv) > 1 else None + paths = [path.rstrip() for path in sys.stdin.readlines()] + + for path in paths: + if path.endswith('.info') and not re.search(RE_HIDDEN, open(path).read()): + print 'drupal7(' + os.path.basename(path)[:-len('.info')] + ')', + if version is not None: + print '=', version + else: + print '' + + +if __name__ == '__main__': + main() diff --git a/drupal7.prov.python3 b/drupal7.prov.python3 new file mode 100755 index 0000000..fd62624 --- /dev/null +++ b/drupal7.prov.python3 @@ -0,0 +1,53 @@ +#!/usr/bin/python3 + +""" +Automatic provides generator for Drupal 7 modules, profiles, and themes. + +Parsed from *.info files. + +First command line argument is used as version if provided. +""" + +# Copyright 2013-2019 Shawn Iwinski +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import re +import sys +import os + + +RE_HIDDEN = re.compile(r'hidden\s*=\s*TRUE', re.IGNORECASE) + + +def main(): + version = sys.argv[1] if len(sys.argv) > 1 else None + paths = [path.rstrip() for path in sys.stdin.readlines()] + + for path in paths: + if path.endswith('.info') and not re.search(RE_HIDDEN, open(path).read()): + print('drupal7(' + os.path.basename(path)[:-len('.info')] + ')', end = '') + if version is not None: + print('=', version) + else: + print('') + + +if __name__ == '__main__': + main() diff --git a/drupal7.prov.rpm-lt-4-9-compat b/drupal7.prov.rpm-lt-4-9-compat deleted file mode 100644 index 27eb866..0000000 --- a/drupal7.prov.rpm-lt-4-9-compat +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/python - -""" -Automatic provides generator for Drupal 7 modules, profiles, and themes. - -Parsed from *.info files. - -First command line argument is used as version if provided. -""" - -# Copyright 2013-2018 Shawn Iwinski -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -import re -import subprocess -import sys -import os - - -RE_HIDDEN = re.compile(r'hidden\s*=\s*TRUE', re.IGNORECASE) - - -def main(): - version = None - if len(sys.argv) > 1: - version = sys.argv[1] - - paths = [path.rstrip() for path in sys.stdin.readlines()] - - for path in paths: - if path.endswith('.info') and not re.search(RE_HIDDEN, open(path).read()): - print 'drupal7(' + os.path.basename(path)[:-len('.info')] + ')', - if version is not None: - print '=', version - else: - print '' - - # 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.req b/drupal7.req index d407306..232492b 100755 --- a/drupal7.req +++ b/drupal7.req @@ -4,7 +4,7 @@ # Automatic requires generator for Drupal 7 modules, profiles, and themes. # -# Copyright 2013-2018 Shawn Iwinski +# Copyright 2013-2019 Shawn Iwinski # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to diff --git a/drupal7.req.rpm-lt-4-9-compat b/drupal7.req.rpm-lt-4-9-compat old mode 100644 new mode 100755 index 151c61d..4de319b --- a/drupal7.req.rpm-lt-4-9-compat +++ b/drupal7.req.rpm-lt-4-9-compat @@ -4,7 +4,7 @@ Automatic requires generator for Drupal 7 modules, profiles, and themes. """ -# Copyright 2013-2018 Shawn Iwinski +# Copyright 2013-2019 Shawn Iwinski # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to diff --git a/drupal7.spec b/drupal7.spec index ee1d0a8..a4fb3e1 100644 --- a/drupal7.spec +++ b/drupal7.spec @@ -5,9 +5,23 @@ AutoReqProv: no %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) %define drupaldir %{_datadir}/drupal7 + +%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 +%define python_pkg python3 +%define prov_source %SOURCE12 +%else +%if 0%{?fedora} || 0%{?rhel} >= 6 +%define python_pkg python2 +%define prov_source %SOURCE9 +%else +%define python_pkg python +%define prov_source %SOURCE7 +%endif +%endif + Name: drupal7 Version: 7.67 -Release: 2%{?dist} +Release: 3%{?dist} Summary: An open-source content-management platform License: GPLv2+ and BSD and MIT @@ -19,19 +33,16 @@ Source3: %{name}-cron Source4: %{name}-files-migrator.sh Source5: macros.%{name} Source6: %{name}.attr -Source7: %{name}.prov +Source7: %{name}.prov.python Source8: macros.%{name}.rpm-lt-4-9-compat -Source9: %{name}.prov.rpm-lt-4-9-compat +Source9: %{name}.prov.python2 Source10: %{name}.req Source11: %{name}.req.rpm-lt-4-9-compat +Source12: %{name}.prov.python3 Patch0: %{name}-7.4-scripts-noshebang.patch BuildArch: noarch -%if 0%{?fedora} || 0%{?rhel} >= 6 -BuildRequires: python2 -%else -BuildRequires: python -%endif +BuildRequires: %{python_pkg} Requires: php-gd, php-mbstring, wget, php-pdo, php-xml Requires: crontabs @@ -40,11 +51,6 @@ Requires: php %else Requires: php(httpd) %endif -%if 0%{?fedora} || 0%{?rhel} >= 6 -Requires: python2 -%else -Requires: python -%endif # Virtual provides ## Core @@ -111,6 +117,7 @@ configurable, skinnable, and secure. %package rpmbuild Summary: Rpmbuild files for %{name} +Requires: %{python_pkg} %description rpmbuild %{summary}. @@ -123,6 +130,7 @@ Summary: Rpmbuild files for %{name} chmod -x scripts/drupal.sh chmod -x scripts/password-hash.sh chmod -x scripts/run-tests.sh +chmod -x sites/default/default.settings.php %build @@ -157,14 +165,14 @@ mkdir -p %{buildroot}%{macrosdir} install -pm0644 %{SOURCE5} %{buildroot}%{macrosdir}/macros.%{name} mkdir -p %{buildroot}%{_prefix}/lib/rpm/fileattrs install -pm0644 %{SOURCE6} %{buildroot}%{_prefix}/lib/rpm/fileattrs/%{name}.attr -install -pm0755 %{SOURCE7} %{buildroot}%{_prefix}/lib/rpm/%{name}.prov +install -pm0755 %{prov_source} %{buildroot}%{_prefix}/lib/rpm/%{name}.prov install -pm0755 %{SOURCE10} %{buildroot}%{_prefix}/lib/rpm/%{name}.req # RPM < 4.9 %else mkdir -p %{buildroot}%{macrosdir} install -pm0644 %{SOURCE8} %{buildroot}%{macrosdir}/macros.%{name} mkdir -p %{buildroot}%{_prefix}/lib/rpm/ -install -pm0755 %{SOURCE9} %{buildroot}%{_prefix}/lib/rpm/%{name}.prov +install -pm0755 %{prov_source} %{buildroot}%{_prefix}/lib/rpm/%{name}.prov install -pm0755 %{SOURCE11} %{buildroot}%{_prefix}/lib/rpm/%{name}.req %endif @@ -198,6 +206,9 @@ install -pm0755 %{SOURCE11} %{buildroot}%{_prefix}/lib/rpm/%{name}.req %{_prefix}/lib/rpm/%{name}.req %changelog +* Sun Sep 15 2019 Shawn Iwinski - 7.67-3 +- Use python3 for Fedora >= 29 and EPEL >= 8 + * Wed Jul 24 2019 Fedora Release Engineering - 7.67-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild