diff --git a/ceph-iscsi-3.0+1551350485.g157b5fd.tar.gz b/ceph-iscsi-3.0+1551350485.g157b5fd.tar.gz deleted file mode 100644 index d3caefd..0000000 --- a/ceph-iscsi-3.0+1551350485.g157b5fd.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5daa65bb7ae3ff91cf703c1f4b4997ec36c57ca01e2361c5bfd7a38709cd517c -size 121611 diff --git a/ceph-iscsi-3.0+1551360670.gda1fd9b.tar.gz b/ceph-iscsi-3.0+1551360670.gda1fd9b.tar.gz new file mode 100644 index 0000000..3088d52 --- /dev/null +++ b/ceph-iscsi-3.0+1551360670.gda1fd9b.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4fd47f9e3d52badad56034b15216f278fa5105b131cf73e7e5ad9c86d56632b +size 120874 diff --git a/ceph-iscsi.spec b/ceph-iscsi.spec index 097e2ec..11ef687 100644 --- a/ceph-iscsi.spec +++ b/ceph-iscsi.spec @@ -14,59 +14,57 @@ # # Please submit bugfixes or comments via http://tracker.ceph.com/ # -%if 0%{?rhel} == 7 -%global with_python2 1 +%if 0%{?fedora} || 0%{?rhel} +%global _remote_tarball_prefix https://github.com/ceph/ceph-iscsi/archive/%{version}/ %endif - Name: ceph-iscsi -Version: 3.0+1551350485.g157b5fd +Version: 3.0+1551360670.gda1fd9b Release: 1%{?dist} Group: System/Filesystems Summary: Python modules for Ceph iSCSI gateway configuration management -%if 0%{?suse_version} + License: GPL-3.0-or-later -%else -License: GPLv3+ -%endif URL: https://github.com/ceph/ceph-iscsi -Source0: %{version}/%{name}-%{version}.tar.gz +Source0: %{name}-%{version}.tar.gz +%if 0%{?suse_version} +Source98: checkin.sh +Source99: README-checkin.txt +%endif %if 0%{?suse_version} Source98: checkin.sh Source99: README-checkin.txt %endif -BuildArch: noarch -Obsoletes: ceph-iscsi-config -Obsoletes: ceph-iscsi-cli +BuildArch: noarch -%if 0%{?with_python2} -BuildRequires: python2-devel -BuildRequires: python2-setuptools -Requires: python-rados >= 10.2.2 -Requires: python-rbd >= 10.2.2 -Requires: python-netifaces >= 0.10.4 -Requires: python-rtslib >= 2.1.fb67 -Requires: rpm-python >= 4.11 -Requires: python-cryptography -Requires: python-flask >= 0.10.1 -%else -BuildRequires: python3-devel -BuildRequires: python3-setuptools +Obsoletes: ceph-iscsi-config +Obsoletes: ceph-iscsi-cli + +%if 0%{?fedora} || 0%{?rhel} +Requires: python-rados >= 10.2.2 +Requires: python-rbd >= 10.2.2 +Requires: python-netifaces >= 0.10.4 +Requires: python-rtslib >= 2.1.fb67 +Requires: rpm-python >= 4.11 +Requires: python-cryptography +Requires: python-flask >= 0.10.1 +BuildRequires: python-devel +BuildRequires: python-setuptools +%endif +%if 0%{?suse_version} Requires: python3-rados >= 10.2.2 Requires: python3-rbd >= 10.2.2 Requires: python3-netifaces >= 0.10.4 Requires: python3-rtslib >= 2.1.fb67 -Requires: python3-cryptography Requires: python3-rpm >= 4.11 -%if 0%{?suse_version} +Requires: python3-cryptography +Requires: python3-Flask >= 0.10.1 BuildRequires: python-rpm-macros BuildRequires: fdupes -Requires: python3-Flask >= 0.10.1 -%else -Requires: python3-flask >= 0.10.1 -%endif +BuildRequires: python3-devel +BuildRequires: python3-setuptools %endif BuildRequires: systemd @@ -88,48 +86,32 @@ performance statistics, supporting monitoring and visualisation tools like Grafana. %prep -%autosetup -p1 +%setup -q %build -%if 0%{?with_python2} +%if 0%{?fedora} || 0%{?rhel} %{__python2} setup.py build -%else +%endif %if 0%{?suse_version} %python3_build -%else -%{py3_build} -%endif %endif %install -%if 0%{?with_python2} +%if 0%{?fedora} || 0%{?rhel} %{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-scripts %{_bindir} -%else +%endif %if 0%{?suse_version} %python3_install %python_expand %fdupes %{buildroot}%{$python_sitelib} -%else -%{py3_install} -%endif %endif mkdir -p %{buildroot}%{_unitdir} install -m 0644 .%{_unitdir}/rbd-target-gw.service %{buildroot}%{_unitdir} install -m 0644 .%{_unitdir}/rbd-target-api.service %{buildroot}%{_unitdir} +mkdir -p %{buildroot}%{_sysconfdir}/systemd/system/rbd-target-gw.service.d +install -m 0644 .%{_sysconfdir}/systemd/system/rbd-target-gw.service.d/dependencies.conf %{buildroot}%{_sysconfdir}/systemd/system/rbd-target-gw.service.d/ mkdir -p %{buildroot}%{_mandir}/man8 install -m 0644 gwcli.8 %{buildroot}%{_mandir}/man8/ gzip %{buildroot}%{_mandir}/man8/gwcli.8 -mkdir -p %{buildroot}%{_unitdir}/rbd-target-gw.service.d -install -m 0644 .%{_sysconfdir}/systemd/system/rbd-target-gw.service.d/dependencies.conf %{buildroot}%{_unitdir}/rbd-target-gw.service.d/ -%if 0%{?suse_version} -mkdir -p %{buildroot}%{_sbindir} -ln -s service %{buildroot}%{_sbindir}/rcrbd-target-gw -ln -s service %{buildroot}%{_sbindir}/rcrbd-target-api -%endif - -%pre -%if 0%{?suse_version} -%service_add_pre rbd-target-gw.service rbd-target-api.service -%endif %post %if 0%{?fedora} || 0%{?rhel} @@ -141,9 +123,9 @@ ln -s service %{buildroot}%{_sbindir}/rcrbd-target-api %service_add_post rbd-target-gw.service rbd-target-api.service %endif -%preun +%pre %if 0%{?suse_version} -%service_del_preun rbd-target-gw.service rbd-target-api.service +%service_add_pre rbd-target-gw.service rbd-target-api.service %endif %postun @@ -154,15 +136,20 @@ ln -s service %{buildroot}%{_sbindir}/rcrbd-target-api %service_del_postun rbd-target-gw.service rbd-target-api.service %endif +%preun +%if 0%{?suse_version} +%service_del_preun rbd-target-gw.service rbd-target-api.service +%endif -%files +%files -n ceph-iscsi %license LICENSE %license COPYING %doc README %doc iscsi-gateway.cfg_sample -%if 0%{?with_python2} +%if 0%{?fedora} || 0%{?rhel} %{python2_sitelib}/* -%else +%endif +%if 0%{?suse_version} %{python3_sitelib}/* %endif %{_bindir}/gwcli @@ -170,15 +157,10 @@ ln -s service %{buildroot}%{_sbindir}/rcrbd-target-api %{_bindir}/rbd-target-api %{_unitdir}/rbd-target-gw.service %{_unitdir}/rbd-target-api.service +%{_sysconfdir}/systemd/system/rbd-target-gw.service.d %{_mandir}/man8/gwcli.8.gz %attr(0770,root,root) %dir %{_localstatedir}/log/rbd-target-gw %attr(0770,root,root) %dir %{_localstatedir}/log/rbd-target-api -%dir %{_unitdir}/rbd-target-gw.service.d -%{_unitdir}/rbd-target-gw.service.d/dependencies.conf -%if 0%{?suse_version} -%{_sbindir}/rcrbd-target-gw -%{_sbindir}/rcrbd-target-api -%endif %changelog diff --git a/checkin.sh b/checkin.sh index ef40a27..d450fa7 100644 --- a/checkin.sh +++ b/checkin.sh @@ -97,7 +97,7 @@ echo "Extracting spec file" VERSION=$(grep ^Version *spec | sed -r "s/^Version:\s+//") VERSION="${VERSION}+$(date +%s).${GIT_SHA1}" sed -i -e 's/^Version:.*/Version: '$VERSION'/' $PROJECT.spec -sed -i -e 's#^Source0:.*#Source0: %{version}/%{name}-%{version}.tar.gz#' $PROJECT.spec +sed -i -e 's#^Source0:.*#Source0: %{name}-%{version}.tar.gz#' $PROJECT.spec sed -i -e '/Source0/a %if 0%{?suse_version}\nSource98: checkin.sh\nSource99: README-checkin.txt\n%endif' $PROJECT.spec cp $PROJECT.spec $THIS_DIR echo "Version number is ->$VERSION<-"