diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9ed2b45 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/targetd-0.8.6.tar.gz diff --git a/.targetd.metadata b/.targetd.metadata new file mode 100644 index 0000000..2a3a015 --- /dev/null +++ b/.targetd.metadata @@ -0,0 +1 @@ +2f81d5a2f64ecebc2a12ebc3f09da1d04e2275c2 SOURCES/targetd-0.8.6.tar.gz diff --git a/SOURCES/targetd.service b/SOURCES/targetd.service new file mode 100644 index 0000000..a4cf4e9 --- /dev/null +++ b/SOURCES/targetd.service @@ -0,0 +1,11 @@ +[Unit] +Description=targetd storage array API daemon +Requires=target.service +After=target.service + +[Service] +ExecStart=/usr/bin/targetd + +[Install] +WantedBy=multi-user.target + diff --git a/SOURCES/targetd.yaml b/SOURCES/targetd.yaml new file mode 100644 index 0000000..61c534a --- /dev/null +++ b/SOURCES/targetd.yaml @@ -0,0 +1,22 @@ +# See http://www.yaml.org/spec/1.2/spec.html for more on YAML. +# +# A sample /etc/target/targetd.yaml file. +# + +# No default password, please pick a good one. + +password: + +# defaults below; uncomment and edit +#block_pools: [vg-targetd/thin_pool] # just 1 by default, but can be more +#fs_pools: [] # Path to btrfs FS, eg. /my_btrfs_mount +#user: admin +#target_name: iqn.2003-01.org.example.mach1:1234 + +# log level (debug, info, warning, error, critical) +#log_level: info + +#ssl: false +# if ssl is activated: +#ssl_cert: /etc/target/targetd_cert.pem +#ssl_key: /etc/target/targetd_key.pem diff --git a/SPECS/targetd.spec b/SPECS/targetd.spec new file mode 100644 index 0000000..4b1c6f6 --- /dev/null +++ b/SPECS/targetd.spec @@ -0,0 +1,136 @@ +Name: targetd +License: GPLv3 +Group: System Environment/Libraries +Summary: Service to make storage remotely configurable +Version: 0.8.6 +Release: 1%{?dist} +URL: https://github.com/open-iscsi/targetd +Source: https://github.com/open-iscsi/targetd/releases/download/v%{version}/targetd-%{version}.tar.gz +Source1: targetd.service +Source2: targetd.yaml +BuildArch: noarch +BuildRequires: systemd, python-devel +Requires: python-rtslib PyYAML python-setproctitle +Requires: lvm2-python-libs >= 2.02.99, nfs-utils, btrfs-progs +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + + +%description +targetd turns the machine into a remotely-configurable storage appliance. +It supports an HTTP/jsonrpc-2.0 interface to let a remote +administrator allocate volumes from an LVM volume group, and export +those volumes over iSCSI. + +%prep +%setup -q + +%build +%{__python2} setup.py build +gzip --stdout targetd.8 > targetd.8.gz + +%install +mkdir -p %{buildroot}%{_mandir}/man8/ +mkdir -p %{buildroot}%{_unitdir} +mkdir -p %{buildroot}%{_sysconfdir}/target/ +install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/targetd.service +install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/target/targetd.yaml +install -m 644 targetd.8.gz %{buildroot}%{_mandir}/man8/ +%{__python2} setup.py install --skip-build --root %{buildroot} + +%post +if [ $1 -eq 1 ] ; then + # Initial installation + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +fi + +%preun +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable targetd.service > /dev/null 2>&1 || : + /bin/systemctl stop targetd.service > /dev/null 2>&1 || : +fi + +%postun +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + /bin/systemctl try-restart targetd.service >/dev/null 2>&1 || : +fi + +%files +%{_bindir}/targetd +%{_unitdir}/targetd.service +%{python2_sitelib}/* +%doc LICENSE README.md API.md client +%{_mandir}/man8/targetd.8.gz +%config(noreplace) %{_sysconfdir}/target/targetd.yaml + +%changelog +* Thu Apr 27 2017 Tony Asleson - 0.8.6-1 +- Update to latest version + +* Fri Feb 17 2017 Tony Asleson - 0.8.5-1 +- Update to latest version +- Be explicit in using python2 + +* Mon Feb 10 2014 Andy Grover - 0.7.1-1 +- Upddate to latest version +- Update service file for switching dependency to rtslib from targetcli + +* Mon Jan 27 2014 Andy Grover - 0.6.1-3 +- Update Source/URL + +* Fri Dec 27 2013 Daniel Mach - 0.6.1-2 +- Mass rebuild 2013-12-27 + +* Thu Aug 8 2013 Andy Grover 0.6.1-1 +- Update to latest version, make needed changes +- Drop patches: + * require-password.patch + * use-std-ssl.patch +- Change requires from python-lvm to lvm2-python-libs + +* Mon Aug 5 2013 Peter Robinson 0.3.1-7 +- Add systemd to BuildReq to fix FTBFS + +* Sun Aug 04 2013 Fedora Release Engineering - 0.3.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Apr 16 2013 Andy Grover - 0.3.1-5 +- Update require-password.patch +- Change target.yaml to not include a commented-out default password + +* Tue Apr 16 2013 Andy Grover - 0.3.1-4 +- Remove dependency on python-tlslite + +* Mon Apr 15 2013 Andy Grover - 0.3.1-3 +- Add patch + * use-std-ssl.patch + * require-password.patch + +* Fri Feb 15 2013 Fedora Release Engineering - 0.3.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Oct 17 2012 Andy Grover - 0.3.1-1 +- New upstream version + +* Mon Sep 24 2012 Andy Grover - 0.3-1 +- New upstream version + +* Fri Sep 7 2012 Andy Grover - 0.2.4-1 +- New upstream version + +* Tue Aug 28 2012 Andy Grover - 0.2.3-1 +- New upstream version +- Add new dependency python-tlslite + +* Sat Jul 21 2012 Fedora Release Engineering - 0.2.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jun 25 2012 Andy Grover - 0.2.2-2 +- Add proper pkg requires + +* Mon Jun 25 2012 Andy Grover - 0.2.2-1 +- Initial packaging