|
Josef Stribny |
a3ec261 |
# http://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#PIE
|
|
Josef Stribny |
a3ec261 |
%global _hardened_build 1
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
Name: obs-signd
|
|
Josef Stribny |
a3ec261 |
Summary: The OBS sign daemon
|
|
Josef Stribny |
a3ec261 |
License: GPLv2
|
|
Josef Stribny |
a3ec261 |
Group: Applications/System
|
|
Josef Stribny |
a3ec261 |
Url: https://github.com/openSUSE/obs-sign
|
|
Josef Stribny |
a3ec261 |
Version: 2.2.1
|
|
Josef Stribny |
a3ec261 |
Release: 4%{?dist}
|
|
Josef Stribny |
a3ec261 |
# Taken from upstream git
|
|
Josef Stribny |
a3ec261 |
# git clone https://github.com/openSUSE/obs-sign && cd obs-sign
|
|
Josef Stribny |
a3ec261 |
# git checkout 2.2.1
|
|
Josef Stribny |
a3ec261 |
# tar czvf obs-signd-2.2.1.tar.bz2 \
|
|
Josef Stribny |
a3ec261 |
# sign.8 sign.c sign.conf sign.conf.5 signd signd.8 obssignd
|
|
Josef Stribny |
a3ec261 |
Source0: obs-signd-%version.tar.bz2
|
|
Josef Stribny |
a3ec261 |
# Upstream doesn't provide systemd service file
|
|
Josef Stribny |
a3ec261 |
Source1: signd.service
|
|
Josef Stribny |
a3ec261 |
# We renamed the option in gnupg2 to 'file-is-digest'
|
|
Josef Stribny |
a3ec261 |
Patch0: obs-sign-rename-option-files-are-digests-to-file-is-digest.patch
|
|
Josef Stribny |
a3ec261 |
Requires: gnupg2
|
|
Josef Stribny |
a3ec261 |
Requires(post): systemd
|
|
Josef Stribny |
a3ec261 |
Requires(preun): systemd
|
|
Josef Stribny |
a3ec261 |
Requires(postun): systemd
|
|
Josef Stribny |
a3ec261 |
BuildRequires: systemd
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%description
|
|
Josef Stribny |
a3ec261 |
The OpenSUSE Build Service sign client and daemon.
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
This daemon can be used to sign anything via gpg by communicating
|
|
Josef Stribny |
a3ec261 |
with a remote server to avoid the need to host the private key
|
|
Josef Stribny |
a3ec261 |
on the same server.
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%prep
|
|
Josef Stribny |
a3ec261 |
%setup -q -c -n obs-signd-%version
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%patch0 -p1
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%build
|
|
Josef Stribny |
a3ec261 |
gcc %{optflags} -fPIC -pie -o sign sign.c
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%install
|
|
Josef Stribny |
a3ec261 |
mkdir -p %{buildroot}%{_sbindir} %{buildroot}%{_sysconfdir}
|
|
Josef Stribny |
a3ec261 |
install -d -m 0755 %{buildroot}%{_bindir}
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
# binaries and configuration
|
|
Josef Stribny |
a3ec261 |
mkdir -p %{buildroot}%{_sbindir} %{buildroot}%{_bindir} %{buildroot}%{_sysconfdir}
|
|
Josef Stribny |
a3ec261 |
install -m 0755 signd %{buildroot}%{_sbindir}
|
|
Josef Stribny |
a3ec261 |
install -m 0750 sign %{buildroot}%{_bindir}
|
|
Josef Stribny |
a3ec261 |
install -m 0644 sign.conf %{buildroot}%{_sysconfdir}
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
# systemd service
|
|
Josef Stribny |
a3ec261 |
mkdir -p %{buildroot}%{_unitdir}
|
|
Josef Stribny |
a3ec261 |
install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
# man pages
|
|
Josef Stribny |
a3ec261 |
install -d -m 0755 %{buildroot}%{_mandir}/man{5,8}
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
for f in 5 8; do
|
|
Josef Stribny |
a3ec261 |
install -m 0644 sig*.${f} %{buildroot}%{_mandir}/man${f}/
|
|
Josef Stribny |
a3ec261 |
done
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%pre
|
|
Josef Stribny |
a3ec261 |
getent group obsrun >/dev/null || %{_sbindir}/groupadd -r obsrun
|
|
Josef Stribny |
a3ec261 |
getent passwd obsrun >/dev/null || \
|
|
Josef Stribny |
a3ec261 |
%{_sbindir}/useradd -r -s /bin/false -c "User for Open Build Service backend" \
|
|
Josef Stribny |
a3ec261 |
-d %{_libdir}/obs -g obsrun obsrun
|
|
Josef Stribny |
a3ec261 |
exit 0
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%post
|
|
Josef Stribny |
a3ec261 |
%systemd_post signd.service
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%preun
|
|
Josef Stribny |
a3ec261 |
%systemd_preun signd.service
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%postun
|
|
Josef Stribny |
a3ec261 |
%systemd_postun_with_restart signd.service
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%files
|
|
Josef Stribny |
a3ec261 |
%config(noreplace) %{_sysconfdir}/sign.conf
|
|
Josef Stribny |
a3ec261 |
%verify(not mode) %attr(4750,root,obsrun) %{_bindir}/sign
|
|
Josef Stribny |
a3ec261 |
%{_sbindir}/signd
|
|
Josef Stribny |
a3ec261 |
%{_unitdir}/signd.service
|
|
Josef Stribny |
a3ec261 |
%doc %{_mandir}/man*/*
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
%changelog
|
|
Josef Stribny |
a3ec261 |
* Tue Aug 26 2014 Josef Stribny <jstribny@redhat.com> - 2.2.1-4
|
|
Josef Stribny |
a3ec261 |
- Enable Position-independent code (PIC)
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
* Mon Aug 25 2014 Josef Stribny <jstribny@redhat.com> - 2.2.1-3
|
|
Josef Stribny |
a3ec261 |
- Create group or user only if it doesn't exist yet
|
|
Josef Stribny |
a3ec261 |
- Remove explicit gzip of man pages
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
* Fri Aug 22 2014 Josef Stribny <jstribny@redhat.com> - 2.2.1-2
|
|
Josef Stribny |
a3ec261 |
- Use macros where possible
|
|
Josef Stribny |
a3ec261 |
|
|
Josef Stribny |
a3ec261 |
* Fri May 23 2014 Josef Stribny <jstribny@redhat.com> 2.2.1-1
|
|
Josef Stribny |
a3ec261 |
- Initial package
|