Sophie

Sophie

distrib > Fedora > 16 > x86_64 > media > updates-src > by-pkgid > c924a2321df34207d46b35eb685fbe54 > files > 3

udpxy-1.0.21-1.fc16.src.rpm

%global buildversion 21
%global realversion 1.0-Chipmunk-build%{buildversion}

Name:           udpxy
Version:        1.0.21
Release:        1%{?dist}
Summary:        UDP-to-HTTP multicast traffic relay daemon

Group:          Applications/Internet
License:        GPLv3+
URL:            http://sourceforge.net/projects/udpxy/
Source0:        http://downloads.sourceforge.net/%{name}/%{name}.%{realversion}.tgz
Source1:        udpxy.service

BuildRequires:  systemd-units

Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units

%description
udpxy is a UDP-to-HTTP multicast traffic relay daemon:
it forwards UDP traffic from a given multicast subscription
to the requesting HTTP client.

%prep
%setup -q -n %{name}-1.0-Chipmunk-%{buildversion}

sed -i "s|CFLAGS += -W -Wall -Werror --pedantic|CFLAGS += %{optflags}|g" Makefile

%build
make %{?_smp_mflags}


%install
rm -rf %{buildroot}

sed -i "s|INSTALLROOT := /usr/local|INSTALLROOT := %{buildroot}/usr|g" Makefile
sed -i 's|ln -s $(INSTALLROOT)/bin/$(EXEC)|ln -s $(EXEC)|g' Makefile

make install

install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service

%post
if [ $1 -eq 1 ] ; then
    # Initial installation
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi

%preun
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
    /bin/systemctl --no-reload disable udpxy.service > /dev/null 2>&1 || :
    /bin/systemctl stop udpxy.service > /dev/null 2>&1 || :
fi

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


%files
%defattr(-,root,root,-)
%doc README CHANGES gpl.txt udpxy-manual-RU.rtf
%{_bindir}/%{name}
%{_bindir}/udpxrec
%{_unitdir}/%{name}.service


%changelog
* Fri Nov 25 2011 Alexey Kurov <nucleo@fedoraproject.org> - 1.0.21-1
- udpxy 1.0-Chipmunk-build21

* Mon Jun 20 2011 Alexey Kurov <nucleo@fedoraproject.org> - 1.0.20-1
- udpxy 1.0-Chipmunk-BLD20

* Sun May 22 2011 Alexey Kurov <nucleo@fedoraproject.org> - 1.0.19-1
- udpxy 1.0-Chipmunk-19
- service disabled by default
- SysV init script replaced with systemd unit
- options from sysconfdir moved to unit file

* Sun Aug  1 2010 Alexey Kurov <nucleo@fedoraproject.org> - 1.0.16-1
- Initial RPM release