Bug 787387 - provide contrib/sysconfig/asterisk
Summary: provide contrib/sysconfig/asterisk
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: asterisk
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jeffrey C. Ollie
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-04 17:22 UTC by Mr-4
Modified: 2012-02-16 22:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-16 22:32:04 UTC
Type: ---


Attachments (Terms of Use)

Description Mr-4 2012-02-04 17:22:37 UTC
Description of problem:
Build fails because this is not provided in the source RPM file

Version-Release number of selected component (if applicable):
10.0.0 - The latest version from RAWHIDE (fc17)

How reproducible:
Always

Steps to Reproduce:
1. On FC14 rpm -ivh asterisk-10.0.0-1.fc17.1.src.rpm
2. cd rpmbuild/SPECS
3. rpmbuild -bb asterisk.spec
  
Actual results:
Build fails at the following line in asterisk.spec:
install -D -p -m 0644 contrib/sysconfig/asterisk %{buildroot}%{_sysconfdir}/sysconfig/asterisk as well as
%config(noreplace) %{_sysconfdir}/sysconfig/asterisk 
because the file is not in the source tree

Expected results:
Build to succeed

Additional info:

Comment 1 Jeffrey C. Ollie 2012-02-16 15:31:53 UTC
It's no surprise that the Fedora 17 SRPM fails to rebuild on Fedora 14 - newer spec files assume that you are using systemd and do not install the sysconfig file because the Asterisk systemd service file does not use the sysconfig file.  If you really must use Fedora 14 you're on your own since it's no longer a supported release.  I'd suggest starting with the RHEL6 SRPM since that RHEL6 still uses the SysV init scripts.

Comment 2 Mr-4 2012-02-16 16:48:34 UTC
(In reply to comment #1)
> It's no surprise that the Fedora 17 SRPM fails to rebuild on Fedora 14 - newer
> spec files assume that you are using systemd and do not install the sysconfig
> file because the Asterisk systemd service file does not use the sysconfig file.
You don't really believe that, do you?

If that was the case why do I see the following in that "Fedora 17 SRPM":

%if 0%{?fedora} >= 16
%global systemd 1
%else
%global systemd 0
%endif

[...]

%if %{systemd}
BuildRequires: systemd-units
%endif

[...]

%if %{systemd}
Requires(post):   systemd-units
Requires(post):   systemd-sysv
Requires(preun):  systemd-units
Requires(postun): systemd-units
%else
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
%endif

[...]

%if %{systemd}
install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/asterisk.service
rm -f %{buildroot}%{_sbindir}/safe_asterisk
%else
install -D -p -m 0755 contrib/init.d/rc.redhat.asterisk %{buildroot}%{_initrddir}/asterisk
install -D -p -m 0644 contrib/sysconfig/asterisk %{buildroot}%{_sysconfdir}/sysconfig/asterisk
%endif

[...]

%if %{systemd}
if [ $1 -eq 1 ] ; then
	/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%else
/sbin/chkconfig --add asterisk
%endif

%preun
%if %{systemd}
if [ "$1" -eq "0" ]; then
	# Package removal, not upgrade
	/bin/systemctl --no-reload disable asterisk.service > /dev/null 2>&1 || :
	/bin/systemctl stop asterisk.service > /dev/null 2>&1 || :
fi
%else
if [ "$1" -eq "0" ]; then
	# Package removal, not upgrade
        /sbin/service asterisk stop > /dev/null 2>&1 || :
        /sbin/chkconfig --del asterisk
fi
%endif

%if %{systemd}
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
    # Package upgrade, not uninstall
    /bin/systemctl try-restart asterisk.service >/dev/null 2>&1 || :
fi

%triggerun -- asterisk < 1.8.2.4-2
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply asterisk
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save asterisk >/dev/null 2>&1 ||:

# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del asterisk >/dev/null 2>&1 || :
/bin/systemctl try-restart asterisk.service >/dev/null 2>&1 || :
%endif

[...]

%if %{systemd}
%{_unitdir}/asterisk.service
%else
%{_initrddir}/asterisk
%config(noreplace) %{_sysconfdir}/sysconfig/asterisk
%endif

[...]

%if !%{systemd}
%{_sbindir}/safe_asterisk
%endif


Either eliminate all systemd conditionals and do not support anything other than systemd or support the SysV properly - you can't have your cake and eat it. Whichever way you look at it, it is a bug - BUG reopened!

Comment 3 Jeffrey C. Ollie 2012-02-16 22:32:04 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > It's no surprise that the Fedora 17 SRPM fails to rebuild on Fedora 14 - newer
> > spec files assume that you are using systemd and do not install the sysconfig
> > file because the Asterisk systemd service file does not use the sysconfig file.
> You don't really believe that, do you?

Uh, why wouldn't I believe what I just wrote?

> If that was the case why do I see the following in that "Fedora 17 SRPM":

Part of it is laziness, and part of what you see is the need to support upgrades from pre-systemd versions of Fedora.

> Either eliminate all systemd conditionals and do not support anything other
> than systemd or support the SysV properly - you can't have your cake and eat
> it. Whichever way you look at it, it is a bug - BUG reopened!

The Fedora 16+ spec files will likely never support being recompiled on Fedora 15 and older.  The systemd conditionals will be removed over time as I get to them - right now I have other things to deal with that take precedence.


Note You need to log in before you can comment on or make changes to this bug.