Josef Stribny a3ec261
# http://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#PIE
Josef Stribny a3ec261
%global _hardened_build 1
73fa3d1
%global commit 5c320501dc048bbcf56480dfc5780fb43dd20de5
391df68
%global shortcommit %(c=%{commit}; echo ${c:0:7})
73fa3d1
%global snapdate 20210907
391df68
%global snapshotrel .%{snapdate}git%{shortcommit}
9095768
# To make rpmdev-bumpspec work properly
769d301
%global baserelease 6
Josef Stribny a3ec261
Josef Stribny a3ec261
Name:             obs-signd
Josef Stribny a3ec261
Summary:          The OBS sign daemon
88e9194
License:          GPL-2.0-only
9095768
URL:              https://github.com/openSUSE/obs-sign
92c9de1
Version:          2.6.1
4cb70bb
Release:          4%{?dist}
92c9de1
#Release:          %%{baserelease}%%{?snapshotrel}%%{?dist}
73fa3d1
Source0:          https://github.com/openSUSE/obs-sign/archive/refs/tags/obs-sign-%{version}.tar.gz
Josef Stribny a3ec261
# We renamed the option in gnupg2 to 'file-is-digest'
391df68
Patch0:           0001-Rename-option-files-are-digests-to-file-is-digest.patch
efb0017
# https://github.com/openSUSE/obs-sign/pull/6
9095768
Patch1:           0002-fixes-user-id-matching-to-provide-unique-results.patch
92c9de1
# https://github.com/openSUSE/obs-sign/pull/36
013aef2
Patch2:           0003-Implement-allow-unprivileged-ports-for-the-client.patch
Josef Stribny a3ec261
Requires:         gnupg2
281f005
Requires(pre):    shadow-utils
589ff6a
BuildRequires:    perl-generators
Josef Stribny a3ec261
BuildRequires:    systemd
034b5e0
BuildRequires:    gcc
8eba7f0
BuildRequires:    make
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
73fa3d1
%autosetup -n obs-sign-%{version}
Josef Stribny a3ec261
Josef Stribny a3ec261
%build
4ce1758
%make_build CFLAGS="%{build_cflags}" LDFLAGS="%{build_ldflags}" sign
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}
391df68
install -m 0644 dist/signd.service %{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
9095768
%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
769d301
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-4
769d301
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
769d301
4acddf2
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-4
4acddf2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
4acddf2
4cb70bb
* Wed Jan 04 2023 msuchy <msuchy@redhat.com> - 2.6.1-4
4cb70bb
- use patches from dist-git and not from lookaside cache
4cb70bb
4d8bf97
* Wed Jan 04 2023 Jakub Kadlcik <frostyx@email.cz> - 2.6.1-3
9015754
- Fix typo in patch, it should be "--file-is-digest" not "--file-is-digests"
9015754
88e9194
* Wed Nov 30 2022 Miroslav Suchý <msuchy@redhat.com> 2.6.1-2
88e9194
- use SPDX format for license
88e9194
92c9de1
* Mon Nov 14 2022 Miroslav Suchý <msuchy@redhat.com> 2.6.1-1
92c9de1
- rebase patches
92c9de1
- rebase obs-sign to 2.6.1
92c9de1
f3d1f9a
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.10-4.20210907git5c32050
f3d1f9a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
92c9de1
                                                                                          
013aef2
* Tue May 24 2022 Pavel Raiskup <praiskup@redhat.com> - 2.5.10-3.20210907git5c32050
013aef2
- implemented 'unprivileged-client-port' option for the OpenShift environments
013aef2
b6c91aa
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.10-2.20210907git5c32050
b6c91aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
b6c91aa
73fa3d1
* Tue Sep 07 2021 Silvie Chlupova <schlupov@redhat.com> - 2.5.10-1
73fa3d1
- rebase to 2.5.10
73fa3d1
671f854
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.4-7.20190913git5675e23
671f854
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
671f854
a1eb484
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.5.4-6.20190913git5675e23
a1eb484
- Rebuilt for updated systemd-rpm-macros
a1eb484
  See https://pagure.io/fesco/issue/2583.
a1eb484
c9e5e08
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.4-5.20190913git5675e23
c9e5e08
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
c9e5e08
8eba7f0
* Tue Dec  1 15:23:34 CET 2020 msuchy <msuchy@redhat.com> - 2.5.4-4.20190913git5675e23
8eba7f0
- Add make to BR - https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
8eba7f0
e8d5e71
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.4-3.20190913git5675e23
e8d5e71
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
e8d5e71
70c800c
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.4-2.20190913git5675e23
70c800c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
70c800c
9095768
* Thu Jan 02 2020 Neal Gompa <ngompa13@gmail.com> - 2.5.4-1.20190913git5675e23
9095768
- Rebase to 2.5.4 post-release snapshot
9095768
- Drop systemd scriptlet requires per updated packaging policy
9095768
- Drop useless verification exception
9095768
d6c52af
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.3-2.20190613gitc3d5984
d6c52af
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d6c52af
4ce1758
* Mon Jun 24 2019 Jakub Kadlčík <jkadlcik@redhat.com> - 2.5.3-1.20180614gitc3d5984
4ce1758
- update to new upstream version 2.5.3
4ce1758
- use Makefile that is provided by upstream nowadays
4ce1758
ce4b514
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-6.20180614git65f9cab
ce4b514
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
ce4b514
67d987a
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-5.20180614git65f9cab
67d987a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
67d987a
391df68
* Mon Jun 25 2018 Miroslav Suchý <msuchy@redhat.com> 2.4.2-4.20180614git65f9cab
391df68
- re-add BR gcc
391df68
391df68
* Thu Jun 21 2018 Miroslav Suchý <msuchy@redhat.com> 2.4.2-3.20180614git65f9cab
391df68
- update to snapshot of 20180614
391df68
391df68
* Thu Jun 21 2018 Miroslav Suchý <msuchy@redhat.com>
391df68
- rebase patches
391df68
- update to snapshot of 20180614
391df68
391df68
* Tue May 22 2018 Miroslav Suchý <msuchy@redhat.com> 2.4.2-1
391df68
- rebase to 2.4.2
391df68
391df68
* Mon Feb 19 2018 Miroslav Suchý <msuchy@redhat.com> 2.2.1-14
391df68
- fix broken build 
391df68
391df68
* Mon Feb 19 2018 Miroslav Suchý <msuchy@redhat.com> 2.2.1-13
391df68
- BR gcc
d25fde0
- require shadow-utils because of adding user
d25fde0
3e9ffe8
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-12
3e9ffe8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
3e9ffe8
6fb6708
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-11
6fb6708
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
6fb6708
1173afc
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-10
1173afc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
1173afc
7963283
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-9
7963283
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
7963283
dbd8c3d
* Tue Apr 26 2016 Miroslav Suchy <msuchy@redhat.com> - 2.2.1-8
dbd8c3d
- fix id matching (Patch1)
dbd8c3d
4314733
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-7
4314733
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
4314733
b6444cb
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.1-6
b6444cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
b6444cb
Josef Stribny fb37d4d
* Fri Oct 03 2014 Josef Stribny <jstribny@redhat.com> - 2.2.1-5
Josef Stribny fb37d4d
- Add install section to unit file
Josef Stribny fb37d4d
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