[Bug 1471056] Review Request: postsrsd - Sender Rewriting Scheme (SRS) daemon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=1471056

Robert-André Mauchin <zebob.m@xxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zebob.m@xxxxxxxxx



--- Comment #2 from Robert-André Mauchin <zebob.m@xxxxxxxxx> ---
Hello/Quack,

Several issues:

 - Please don't use tabs, use spaces

 - What do you package a snapshot of the git, instead of the latest stable
version? Please justify this.

 - If you do want to package the snapshot, the Version and Release tag are
wrong. First you should define a %commitdate

%global commit date 20170118

  Then fix you Version and Release:

Version:    1.4
Release:    2.%{commitdate}git%{shortcommit0}%{?dist}

  Don't forget to also change the changelog to reflect this:

* Fri Apr 14 2017 Marc Dequènes (Duck) <duck@xxxxxxxxxx> -
1.4-2.20170118gita77bf99

 - The Group: tag is not used in Fedora. See
https://fedoraproject.org/wiki/Packaging:Guidelines#Tags_and_Sections
If you also package for RHEL, put it inside a condition.


 - The Source0 format is wrong, change it to:

Source0:   
https://github.com/roehling/%{name}/archive/%{commit0}/%{name}-%{commit0}.tar.gz

  - Requires:    /usr/bin/base64 is not needed I think, since it is provided by
coreutils

  - Don't use:

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="$(RPM_OPT_FLAGS)"
-DCMAKE_INSTALL_PREFIX=/usr -DGENERATE_SRS_SECRET=OFF -DUSE_SELINUX=ON

  Instead please use the %cmake macro which takes care of the path and add your
custom option afterwards:

cd build && %cmake .. -DGENERATE_SRS_SECRET=OFF -DUSE_SELINUX=ON

  - Similarly, please use %make_build and %make_install macro:

%make_build -C build

%make_install -C build

  - # proper location for systemd config ⇒ This is not the propre location,
service file must be placed in the special dir %{_unitdir}:

mkdir -p %{buildroot}/%{_unitdir}
mv %{buildroot}/etc/systemd/system/postsrsd.service
%{buildroot}/%{_unitdir}/postsrsd.service


  You also need to change the path in your sed patch:

sed -ri -e 's/postsrsd\/default/postsrsd.default/' \
        -e
"s/(\[Install\])/RuntimeDirectory=postsrsd\nRuntimeDirectoryMode=0750\n\n\1/"
%{buildroot}/%{_unitdir}/postsrsd.service


  And fix it in %files too:

%{_unitdir}/postsrsd.service

  - systemd service files requires special scriplets to be run in %post, %preun
and %postun. See:
https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets#Systemd


%post
%systemd_post %{name}.service

%preun
%systemd_preun %{name}.service

%postun
%systemd_postun_with_restart %{name}.service

  You also need to add a BR with a special macro:

%{?systemd_requires}
BuildRequires: systemd

  - You *must* add the LICENSE file with %license in %files:

%license LICENSE

  - %doc should contain the relevant README files:

%doc README.md README_UPGRADE.md README.exim.md

  - Don't use /usr/sbin, use %{_sbindir}

%{_sbindir}/postsrsd


  - Don't use /usr/share/doc but:

%{_docdir}/postsrsd

  - Same with man:

%{_mandir}/man8/postsrsd.8*

  - The whole SELinux part looks fishy. Let's do it the Fedora way. First add
the Requires:

Requires(post): policycoreutils, initscripts
Requires(preun): policycoreutils, initscripts
Requires(postun): policycoreutils

  Then we add the correct scriplets in %post, %preun and %postun:

%post
if [ "$1" -le "1" ]; then # Fist install
    semodule -i %{_datadir}/selinux/packages/%{name}/postsrsd.pp 2>/dev/null ||
:
    fixfiles -R postsrsd restore || :
    /sbin/service postsrsd condrestart > /dev/null 2>&1  || :
fi

%preun
if [ "$1" -lt "1" ]; then # Final removal
    semodule -r postsrsd 2>/dev/null || :
    fixfiles -R postsrsd restore || :
    /sbin/service postsrsd condrestart > /dev/null 2>&1 || :
fi

%postun
if [ "$1" -ge "1" ]; then # Upgrade
    # Replaces the module if it is already loaded
    semodule -i %{_datadir}/selinux/packages/%{name}/postsrsd.pp 2>/dev/null ||
:
    # no need to restart the daemon
fi


  Once you fix all this, please check if the package is working as expected as
I'm not well versed in SELinux.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux