From 2a5cd6da5a47684d5bee7514edf4397da824acec Mon Sep 17 00:00:00 2001 From: Jan Friesse Date: Mon, 29 Jan 2018 16:21:33 +0100 Subject: [PATCH] Initial import (#1537572) --- .gitignore | 1 + README.md | 3 - corosync-qdevice.spec | 196 ++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 198 insertions(+), 3 deletions(-) create mode 100644 .gitignore delete mode 100644 README.md create mode 100644 corosync-qdevice.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..113143c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/corosync-qdevice-2.90.0.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index c5ee802..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# corosync-qdevice - -The corosync-qdevice package \ No newline at end of file diff --git a/corosync-qdevice.spec b/corosync-qdevice.spec new file mode 100644 index 0000000..8f2e755 --- /dev/null +++ b/corosync-qdevice.spec @@ -0,0 +1,196 @@ +# Conditionals +# Invoke "rpmbuild --without " or "rpmbuild --with " +# to disable or enable specific features +%bcond_with runautogen +%bcond_without systemd + +%global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}} +%global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}} + +Name: corosync-qdevice +Summary: The Corosync Cluster Engine Qdevice +Version: 2.90.0 +Release: 2%{?gitver}%{?dist} +License: BSD +URL: https://github.com/corosync/corosync-qdevice +Source0: https://github.com/corosync/corosync-qdevice/releases/download/v%{version}%{?gittarver}/%{name}-%{version}%{?gittarver}.tar.gz + +# Runtime bits +Requires: corosync >= 2.4.0 +Requires: corosynclib >= 2.4.0 +Requires: nss-tools + +%if %{with systemd} +%{?systemd_requires} +BuildRequires: systemd +BuildRequires: systemd-devel +%else +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/chkconfig +%endif + +# Build bits +BuildRequires: corosynclib-devel +BuildRequires: groff +BuildRequires: libqb-devel +BuildRequires: nss-devel +BuildRequires: sed + +%if %{with runautogen} +BuildRequires: autoconf automake libtool +%endif + +%prep +%setup -q -n %{name}-%{version}%{?gittarver} + +%build +%if %{with runautogen} +./autogen.sh +%endif + +%{configure} \ +%if %{with systemd} + --enable-systemd \ +%endif + --enable-qdevices \ + --enable-qnetd \ + --with-initddir=%{_initrddir} \ + --with-systemddir=%{_unitdir} + +make %{_smp_mflags} + +%install +make install DESTDIR=%{buildroot} + +## tree fixup +# drop docs and html docs for now +rm -rf %{buildroot}%{_docdir}/* +mkdir -p %{buildroot}%{_sysconfdir}/sysconfig +# /etc/sysconfig/corosync-qdevice +install -m 644 init/corosync-qdevice.sysconfig.example \ + %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice +# /etc/sysconfig/corosync-qnetd +install -m 644 init/corosync-qnetd.sysconfig.example \ + %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd + +%if %{with systemd} +sed -i -e 's/^#User=/User=/' \ + %{buildroot}%{_unitdir}/corosync-qnetd.service +%else +sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \ + %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd +%endif + +%clean + +%description +This package contains the Corosync Cluster Engine Qdevice, script for creating +NSS certificates and an init script. + +%post +%if %{with systemd} && 0%{?systemd_post:1} +%systemd_post corosync-qdevice.service +%else +if [ $1 -eq 1 ]; then + /sbin/chkconfig --add corosync-qdevice || : +fi +%endif + +%preun +%if %{with systemd} && 0%{?systemd_preun:1} +%systemd_preun corosync-qdevice.service +%else +if [ $1 -eq 0 ]; then + /sbin/service corosync-qdevice stop &>/dev/null || : + /sbin/chkconfig --del corosync-qdevice || : +fi +%endif + +%postun +%if %{with systemd} && 0%{?systemd_postun:1} +%systemd_postun corosync-qdevice.service +%endif + +%files +%dir %{_sysconfdir}/corosync/qdevice +%dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net +%dir %{_localstatedir}/run/corosync-qdevice +%{_sbindir}/corosync-qdevice +%{_sbindir}/corosync-qdevice-net-certutil +%{_sbindir}/corosync-qdevice-tool +%config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice +%if %{with systemd} +%{_unitdir}/corosync-qdevice.service +%else +%{_initrddir}/corosync-qdevice +%endif +%{_mandir}/man8/corosync-qdevice-tool.8* +%{_mandir}/man8/corosync-qdevice-net-certutil.8* +%{_mandir}/man8/corosync-qdevice.8* + +%package -n corosync-qnetd +Summary: The Corosync Cluster Engine Qdevice Network Daemon +Requires: nss-tools +Requires(pre): shadow-utils + +%if %{with systemd} +%{?systemd_requires} +%endif + +%description -n corosync-qnetd +This package contains the Corosync Cluster Engine Qdevice Network Daemon, +script for creating NSS certificates and an init script. + +%pre -n corosync-qnetd +getent group coroqnetd >/dev/null || groupadd -r coroqnetd +getent passwd coroqnetd >/dev/null || \ + useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd +exit 0 + +%post -n corosync-qnetd +%if %{with systemd} && 0%{?systemd_post:1} +%systemd_post corosync-qnetd.service +%else +if [ $1 -eq 1 ]; then + /sbin/chkconfig --add corosync-qnetd || : +fi +%endif + +%preun -n corosync-qnetd +%if %{with systemd} && 0%{?systemd_preun:1} +%systemd_preun corosync-qnetd.service +%else +if [ $1 -eq 0 ]; then + /sbin/service corosync-qnetd stop &>/dev/null || : + /sbin/chkconfig --del corosync-qnetd || : +fi +%endif + +%postun -n corosync-qnetd +%if %{with systemd} && 0%{?systemd_postun:1} +%systemd_postun corosync-qnetd.service +%endif + +%files -n corosync-qnetd +%dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd +%dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd +%{_bindir}/corosync-qnetd +%{_bindir}/corosync-qnetd-certutil +%{_bindir}/corosync-qnetd-tool +%config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd +%if %{with systemd} +%{_unitdir}/corosync-qnetd.service +%else +%{_initrddir}/corosync-qnetd +%endif +%{_mandir}/man8/corosync-qnetd-tool.8* +%{_mandir}/man8/corosync-qnetd-certutil.8* +%{_mandir}/man8/corosync-qnetd.8* + +%changelog +* Wed Jan 24 2018 Jan Friesse - 2.90.0-2 +- Fix spec file according to advices given in review by + Robert-André Mauchin + +* Tue Jan 23 2018 Jan Friesse - 2.90.0-1 +- First upstream packaged version of corosync for rawhide review. diff --git a/sources b/sources new file mode 100644 index 0000000..2fca435 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (corosync-qdevice-2.90.0.tar.gz) = 4735226cdd5d3fee97194fda215ccddb697d92ad0db21ef6bcb04f9a961bc526fdde8897d02f54c8a03bfed163dc2b549052c7a54ad17913280c442f14af8092