Repository: cobbler/cobbler

Issue:
Rpmlint warning
### Describe the bug

Currently the rpmlint complains about a number of things which can be solved with some adjustments.

### To Reproduce

1. Go to https://build.opensuse.org/package/show/home:SchoolGuy:branches:systemsmanagement/cobbler
2. Checkout the project or go to the buildlog
3. Scroll down to the rpmlint report
4. See the warnings

### Expected behavior

Less warnings

### Version

3.1.1.

### Additional context

````
[   17s] RPMLINT report:
[   17s] ===============
[   18s] cobbler.noarch: W: files-duplicate /etc/cobbler/boot_loader_conf/bootcfg_esxi5.template /etc/cobbler/boot_loader_conf/bootcfg_esxi51.template
[   18s] cobbler.noarch: W: files-duplicate /etc/cobbler/boot_loader_conf/bootcfg_esxi60.template /etc/cobbler/boot_loader_conf/bootcfg_esxi55.template:/etc/cobbler/boot_loader_conf/bootcfg_esxi65.template
[   18s] cobbler.noarch: W: files-duplicate /etc/cobbler/boot_loader_conf/gpxe_system_esxi6.template /etc/cobbler/boot_loader_conf/gpxe_system_esxi5.template
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/__pycache__/__init__.cpython-37.opt-1.pyc /usr/lib/python3.7/site-packages/cobbler/__pycache__/__init__.cpython-37.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/__pycache__/cexceptions.cpython-37.opt-1.pyc /usr/lib/python3.7/site-packages/cobbler/__pycache__/cexceptions.cpython-37.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/__pycache__/field_info.cpython-37.pyc /usr/lib/python3.7/site-packages/cobbler/__pycache__/field_info.cpython-37.opt-1.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/actions/__pycache__/__init__.cpython-37.opt-1.pyc /usr/lib/python3.7/site-packages/cobbler/actions/__pycache__/__init__.cpython-37.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/cobbler_collections/__pycache__/__init__.cpython-37.opt-1.pyc /usr/lib/python3.7/site-packages/cobbler/cobbler_collections/__pycache__/__init__.cpython-37.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/items/__pycache__/__init__.cpython-37.pyc /usr/lib/python3.7/site-packages/cobbler/items/__pycache__/__init__.cpython-37.opt-1.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/modules/__pycache__/__init__.cpython-37.pyc /usr/lib/python3.7/site-packages/cobbler/modules/__pycache__/__init__.cpython-37.opt-1.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/modules/authentication/__pycache__/__init__.cpython-37.opt-1.pyc /usr/lib/python3.7/site-packages/cobbler/modules/authentication/__pycache__/__init__.cpython-37.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/modules/authorization/__pycache__/__init__.cpython-37.pyc /usr/lib/python3.7/site-packages/cobbler/modules/authorization/__pycache__/__init__.cpython-37.opt-1.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/modules/authorization/__pycache__/allowall.cpython-37.opt-1.pyc /usr/lib/python3.7/site-packages/cobbler/modules/authorization/__pycache__/allowall.cpython-37.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/modules/installation/__pycache__/__init__.cpython-37.opt-1.pyc /usr/lib/python3.7/site-packages/cobbler/modules/installation/__pycache__/__init__.cpython-37.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/modules/managers/__pycache__/__init__.cpython-37.pyc /usr/lib/python3.7/site-packages/cobbler/modules/managers/__pycache__/__init__.cpython-37.opt-1.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/modules/nsupdate_delete_system_pre.py /usr/lib/python3.7/site-packages/cobbler/modules/nsupdate_add_system_post.py
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/modules/serializers/__pycache__/__init__.cpython-37.pyc /usr/lib/python3.7/site-packages/cobbler/modules/serializers/__pycache__/__init__.cpython-37.opt-1.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/web/__pycache__/__init__.cpython-37.pyc /usr/lib/python3.7/site-packages/cobbler/web/__pycache__/__init__.cpython-37.opt-1.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/web/__pycache__/settings.cpython-37.pyc /usr/lib/python3.7/site-packages/cobbler/web/__pycache__/settings.cpython-37.opt-1.pyc
[   18s] cobbler.noarch: W: files-duplicate /usr/lib/python3.7/site-packages/cobbler/web/templatetags/__pycache__/__init__.cpython-37.opt-1.pyc /usr/lib/python3.7/site-packages/cobbler/web/templatetags/__pycache__/__init__.cpython-37.pyc
[   18s] cobbler.noarch: W: files-duplicate /var/lib/cobbler/templates/esxi5-ks.cfg /var/lib/cobbler/templates/esxi4-ks.cfg
[   18s] cobbler.src:117: W: hardcoded-packager-tag Cobbler Developers <cobbler@lists.fedorahosted.org>
[   18s] The Packager tag is hardcoded in your spec file. It should be removed, so as
[   18s] to use rebuilder's own defaults.
[   18s] 
[   18s] cobbler.noarch: W: incoherent-logrotate-file /etc/logrotate.d/cobblerd
[   18s] Your logrotate file should be named /etc/logrotate.d/<package name>.
[   18s] 
[   18s] cobbler.noarch: W: missing-dependency-to-logrotate for logrotate script /etc/logrotate.d/cobblerd
[   18s] This package installs a file in /etc/logrotate.d/ but doesn't require
[   18s] logrotate to be installed. Because logrotate is not part of the essential
[   18s] packages, your package should explicitely depend on logrotate to make sure
[   18s] that your logrotate job is executed. If it is an optional feature of your
[   18s] package, recommend or suggest logrotate.
[   18s] 
[   18s] cobbler.noarch: W: non-executable-script /usr/lib/python3.7/site-packages/cobbler/web/manage.py 644 /usr/bin/python3 
[   18s] cobbler.noarch: W: non-executable-script /usr/share/bash-completion/completions/cobbler 644 /usr/bin/env bash
[   18s] cobbler.noarch: W: non-executable-script /usr/share/cobbler/bin/settings-migration-v1-to-v2.sh 644 /bin/bash 
[   18s] This text file contains a shebang or is located in a path dedicated for
[   18s] executables, but lacks the executable bits and cannot thus be executed.  If
[   18s] the file is meant to be an executable script, add the executable bits,
[   18s] otherwise remove the shebang or move the file elsewhere.
[   18s] 
[   18s] cobbler.noarch: W: percent-in-%pre
[   18s] The %pre scriptlet contains a "%" in a context which might indicate it being
[   18s] fallout from an rpm macro/variable which was not expanded during build.
[   18s] Investigate whether this is the case and fix if appropriate.
[   18s] 
[   18s] cobbler.noarch: W: script-without-shebang /srv/www/cobbler/svc/services.py
[   18s] This text file has executable bits set or is located in a path dedicated for
[   18s] executables, but lacks a shebang and cannot thus be executed.  If the file is
[   18s] meant to be an executable script, add the shebang, otherwise remove the
[   18s] executable bits or move the file elsewhere.
[   18s] 
[   18s] cobbler.noarch: W: self-obsoletion cobbler-nsupdate < 3.0.99 obsoletes cobbler-nsupdate = v3.1.1-0
[   18s] The package obsoletes itself.  This is known to cause errors in various tools
[   18s] and should thus be avoided, usually by using appropriately versioned Obsoletes
[   18s] and/or Provides and avoiding unversioned ones.
[   18s] 
[   18s] cobbler.noarch: W: suse-missing-rclink cobblerd
[   18s] The package contains an init script or systemd service file but lacks the
[   18s] symlink /usr/sbin/rcFOO -> /usr/sbin/service
[   18s] 
[   18s] cobbler.noarch: W: systemd-service-without-service_add_post cobblerd.service
[   18s] The package contains a systemd service but doesn't contain a %post with a call
[   18s] to service_add_post.
[   18s] 
[   18s] cobbler.noarch: W: systemd-service-without-service_add_pre cobblerd.service
[   18s] The package contains a systemd service but doesn't contain a %pre with a call
[   18s] to service_add_pre.
[   18s] 
[   18s] 3 packages and 0 specfiles checked; 0 errors, 33 warnings.
````



Discussion:

Resolving patch:
diff --git a/cobbler/web/manage.py b/cobbler/web/manage.py
old mode 100644
new mode 100755
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@
 
 from builtins import OSError
 
-VERSION = "3.1.1"
+VERSION = "3.1.2"
 OUTPUT_DIR = "config"
 
 log = logging.getLogger("setup.py")
@@ -484,11 +484,8 @@ def run(self):
         http_user = "wwwrun"
         httpd_service = "apache2.service"
         defaultpath = "/etc/sysconfig/"
-    elif os.path.exists("/etc/debian_version"):
-        if os.path.exists("/etc/apache2/conf-available"):
-            webconfig = "/etc/apache2/conf-available"
-        else:
-            webconfig = "/etc/apache2/conf.d"
+    elif distro.id() in ("debian", "ubuntu"):
+        webconfig = "/etc/apache2/conf-available"
         webroot = "/var/www/"
         http_user = "www-data"
         defaultpath = "/etc/default/"
diff --git a/svc/services.py b/svc/services.py
old mode 100755
new mode 100644


Test patch: