Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec file cleanup #103

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 41 additions & 23 deletions contrib/spec/openarc.spec.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
%global systemd (0%{?fedora} >= 18) || (0%{?rhel} >= 7)
%global tmpfiles (0%{?fedora} >= 15) || (0%{?rhel} >= 7)

%global pre_rel Beta0

Summary: An open source library and milter for providing ARC service
Name: openarc
Version: @VERSION@
Release: 1%{?dist}
Release: %{?pre_rel:0.}1%{?pre_rel:.%pre_rel}%{?dist}
License: BSD and Sendmail
URL: https://github.com/mskucherawy/OpenARC
URL: https://github.com/trusteddomainproject/OpenARC

Source0: https://github.com/trusteddomainproject/OpenARC/archive/v%{version}%{?pre_rel:.%pre_rel}/%{name}-%{version}%{?pre_rel:.%pre_rel}.tar.gz

BuildRequires: libtool
BuildRequires: libtool gcc
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(libbsd)

Expand All @@ -19,6 +23,9 @@ BuildRequires: sendmail-milter-devel
BuildRequires: sendmail-devel
%endif

BuildRequires: autoconf
BuildRequires: automake

Requires: lib%{name}%{?_isa} = %{version}-%{release}
Requires: libopenarc = %{version}-%{release}
Requires(pre): shadow-utils
Expand All @@ -33,8 +40,6 @@ Requires(preun): chkconfig, initscripts
Requires(postun): initscripts
%endif

Source0: openarc-%{version}.tar.gz
Prefix: %{_prefix}

%description
The Trusted Domain Project is a community effort to develop and maintain a
Expand All @@ -57,38 +62,50 @@ This package contains the static libraries, headers, and other support files
required for developing applications against libopenarc.

%prep
%autosetup -p1
%autosetup -n OpenARC-%{version}%{?pre_rel:.%pre_rel} -p1

%build
autoreconf --install
%configure --disable-static
%make_build

make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}
%make_install
mkdir -p -m 0700 %{buildroot}%{_sysconfdir}/%{name}
mkdir -p -m 0700 %{buildroot}%{_localstatedir}/run/%{name}
rm -r %{buildroot}%{_prefix}/share/doc/openarc
rm %{buildroot}/%{_libdir}/*.la


cat > %{buildroot}%{_sysconfdir}/openarc.conf <<EOF
## See openarc.conf(5) or %{_docdir}/%{name}-%{version}/openarc.conf.sample for more
PidFile %{_localstatedir}/run/openarc/openarc.pid
## See openarc.conf(5) or %{_docdir}/%{name}%{?rhel:-%{version}}/openarc.conf.sample for more
PidFile %{_localstatedir}/run/%{name}/%{name}.pid
Syslog yes
#Umask 002
UserID openarc:openarc
Socket inet:8894@localhost
Socket local:%{_localstatedir}/run/%{name}/%{name}.sock
SignHeaders to,subject,message-id,date,from,mime-version,dkim-signature
PeerList %{_sysconfdir}/%{name}/PeerList
MilterDebug 6
EnableCoredumps yes

## After setting Mode to "sv", running
## opendkim-genkey -D %{_sysconfdir}/openarc -s key -d `hostname --domain`
## and putting %{_sysconfdir}/openarc
#Mode sv
#Canonicalization relaxed/simple
#Domain example.com # change to domain
#Selector key
#KeyFile %{_sysconfdir}/openarc/key.private
#SignatureAlgorithm rsa-sha256
EOF

# Don't sign or validate connections from localhost
cat > %{buildroot}%{_sysconfdir}/%{name}/PeerList <<EOF
127.0.0.1/32
[::1]/128
EOF
chmod 0640 %{buildroot}%{_sysconfdir}/%{name}/PeerList

%if %systemd
install -d -m 0755 %{buildroot}%{_unitdir}
Expand Down Expand Up @@ -156,15 +173,14 @@ fi
exit 0
%endif

%post -n libopenarc -p /sbin/ldconfig

%postun -n libopenarc -p /sbin/ldconfig

%ldconfig_scriptlets -n libopenarc

%files
%defattr(-,root,root)
%doc LICENSE LICENSE.Sendmail README RELEASE_NOTES
%license LICENSE LICENSE.Sendmail
%doc README RELEASE_NOTES openarc/openarc.conf.sample
%config(noreplace) %{_sysconfdir}/openarc.conf
%dir %attr(-,%{name},%{name}) %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/PeerList

%if %{tmpfiles}
%{_tmpfilesdir}/%{name}.conf
Expand All @@ -182,17 +198,19 @@ exit 0


%files -n libopenarc
%doc LICENSE LICENSE.Sendmail
%defattr(-,root,root)
%{_libdir}/*.so.*
%license LICENSE LICENSE.Sendmail
%{_libdir}/*.so.0
%{_libdir}/*.so.0.0.0

%files -n libopenarc-devel
%defattr(-,root,root)
%doc LICENSE LICENSE.Sendmail
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc

%changelog
* Wed Jul 11 2018 Xavier Bachelot <[email protected]> 1.0.0-0.1.Beta0
- Specfile clean up.
- Update to 1.0.0 beta 0.

* Sun Jul 23 2017 Matt Domsch <[email protected]> 0.1.0-1
- update to Fedora Packaging Guidelines