Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 34083b574937c54fe5785adf4fb269eb > files > 4

flumotion-0.1.7-1mdk.src.rpm

%define gstpy 0.7.94
%define pygtk 2.4.0
Name:           flumotion
Version: 0.1.7
Release: 1mdk
Summary:        Flumotion - the Fluendo Streaming Server

Group:          System/Servers
License:	GPL
URL:            http://www.flumotion.net/
Source:         http://www.flumotion.net/src/flumotion/%{name}-%{version}.tar.bz2
Source1:	flumotion-make-dummy-cert.bz2
Patch:	flumotion-0.1.2-init.patch.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

Requires:	python >= 2.3
Requires:	gstreamer >= 0.8.5
Requires:	gstreamer-vorbis >= 0.8.5
Requires:	gstreamer-python >= %gstpy
Requires:	python-twisted >= 1.3.0-3mdk
Requires:	pygtk2.0 >= %pygtk
Requires:	pygtk2.0-libglade >= %pygtk
Requires:	python-imaging
Requires(pre):  rpm-helper
Requires(post):	openssl
BuildRequires:	python-twisted >= 1.3.0
BuildRequires:	gstreamer-python >= %gstpy
BuildRequires:	gstreamer-devel >= 0.8.5
BuildRequires:	python >= 2.3
BuildRequires:	pygtk2.0-devel >= %pygtk
BuildRequires:	pygtk2.0-libglade >= %pygtk
BuildRequires:	epydoc
BuildRequires:	ImageMagick
BuildArch: noarch

%description
Fluendo Streaming Server.

%prep
%setup -q
%patch -p1 -b .init

%build
./configure --prefix=%_prefix --libdir=%_libdir --sysconfdir=%_sysconfdir --localstatedir=%_var
%make

%install
rm -rf $RPM_BUILD_ROOT

%makeinstall_std
bzcat %SOURCE1 > %buildroot%_datadir/%name/make-dummy-cert
chmod 755 %buildroot%_datadir/%name/make-dummy-cert
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/flumotion/managers/default/flows
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/flumotion/workers

# install service files
install -d $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
install -m 755 \
	doc/redhat/%name \
	$RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d

# create a .flumotion in the new home
# FIXME: needs to be done more gracefully

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/flumotion/.flumotion

# create log directory
install -d $RPM_BUILD_ROOT%_var/log/flumotion
install -d $RPM_BUILD_ROOT%{_var}/run/flumotion
install -d $RPM_BUILD_ROOT%{_var}/cache/flumotion

mkdir -p %buildroot%_sysconfdir/logrotate.d/
cat > %buildroot%_sysconfdir/logrotate.d/%name << EOF
%_var/log/flumotion/*.log {
    notifempty
    missingok
    monthly
    compress
    postrotate
    	/bin/kill -HUP \$(cat /var/run/flumotion/*.pid 2> /dev/null) 2> /dev/null || true
    endscript
}
EOF

# menu
mkdir -p %{buildroot}/%{_menudir}
cat > %{buildroot}/%{_menudir}/%{name} <<EOF
?package(%{name}): \
command="%{_bindir}/flumotion-admin" \
title="Flumotion Administration" \
longtitle="Configure and manage the Flumotion streaming server" \
section="System/Configuration/Other" \
needs="x11" \
icon="%name.png" \
startup_notify="true"
EOF
mkdir -p %buildroot{%_liconsdir,%_iconsdir,%_miconsdir}
ln -s %_datadir/pixmaps/%name.png %buildroot%_liconsdir/%name.png
convert -scale 32 data/%name.png %buildroot%_iconsdir/%name.png
convert -scale 16 data/%name.png %buildroot%_miconsdir/%name.png


%clean
rm -rf $RPM_BUILD_ROOT

%pre
%_pre_useradd flumotion %{_datadir}/flumotion /sbin/nologin
/usr/sbin/usermod -G audio,video flumotion

%post
%update_menus
%_post_service flumotion
# generate a default .pem certificate ?
PEM_FILE="%{_sysconfdir}/flumotion/default.pem"
if ! test -e ${PEM_FILE}
then
  sh %{_datadir}/%name/make-dummy-cert ${PEM_FILE}
  chown :flumotion ${PEM_FILE}
  chmod 640 ${PEM_FILE}
fi

# create a default planet config if no manager configs present
# the default login will be user/test
# FIXME: still need a way of specifying we really do not want a default manager
if ! ls %{_sysconfdir}/flumotion/managers/*/*.xml >/dev/null 2>&1
then
  cat > %{_sysconfdir}/flumotion/managers/default/planet.xml <<EOF
<planet>
 
  <manager>
    <host>localhost</host>
    <component name="manager-bouncer" type="htpasswdcrypt">
      <data><![CDATA[
user:PSfNpHTkpTx1M
]]></data>
    </component>
  </manager>
 
</planet>
EOF
fi

# create a default worker config if no worker configs present
# the default login will be user/test
# FIXME: still need a way of specifying we really do not want a default worker
if ! test -e %{_sysconfdir}/flumotion/*/default.xml
then
  cat > %{_sysconfdir}/flumotion/workers/default.xml <<EOF
<worker>
 
  <manager>
  </manager>

  <authentication type="plaintext">
    <username>user</username>
    <password>test</password>
  </authentication>
 
</worker>
EOF

fi

%preun
%_preun_service flumotion

%postun
%clean_menus
%_postun_userdel flumotion
# if removal and not upgrade, clean up user and config
if [ $1 -eq 0 ]
then
  /usr/sbin/userdel flumotion

  rm -rf %{_sysconfdir}/flumotion/*
  rm -rf %{_var}/lock/flumotion*
  rm -rf %{_var}/run/flumotion*
fi

%files
%defattr(-,root,root,-)
%doc ChangeLog COPYING README AUTHORS
%doc doc/reference/html
%doc conf
%config(noreplace) %{_sysconfdir}/rc.d/init.d/%name
%config(noreplace) %_sysconfdir/logrotate.d/%name
%{_bindir}/flumotion-manager
%{_bindir}/flumotion-worker
%{_bindir}/flumotion-admin
%{_bindir}/flumotion-tester
%{_sbindir}/flumotion
%{_libdir}/flumotion
%{_datadir}/applications/flu-admin.desktop
%{_datadir}/pixmaps/flumotion.png
%dir %{_datadir}/flumotion
%{_datadir}/flumotion/glade/
%{_datadir}/flumotion/image
%{_datadir}/flumotion/make-dummy-cert
%{_libdir}/pkgconfig/%name.pc
%dir %attr(750,flumotion,root) %{_datadir}/flumotion/.flumotion
%attr(750,flumotion,root) %{_sysconfdir}/flumotion
%attr(750,flumotion,root) %{_var}/run/flumotion
%attr(750,flumotion,root) %{_var}/log/flumotion
%attr(750,flumotion,root) %{_var}/cache/flumotion
%{_menudir}/%{name}
%_liconsdir/%name.png
%_iconsdir/%name.png
%_miconsdir/%name.png


%changelog
* Thu Apr 07 2005 Götz Waschk <waschk@linux-mandrake.com> 0.1.7-1mdk
- New release 0.1.7

* Fri Feb 18 2005 Götz Waschk <waschk@linux-mandrake.com> 0.1.6-2mdk
- fix buildrequires

* Thu Feb 17 2005 Götz Waschk <waschk@linux-mandrake.com> 0.1.6-1mdk
- add menu entry
- add new files
- new source URL
- new version

* Mon Jan 24 2005 Lenny Cartier <lenny@mandrakesoft.com> 0.1.5-1mdk
- 0.1.5

* Sun Dec 19 2004 Götz Waschk <waschk@linux-mandrake.com> 0.1.4-1mdk
- fix buildrequires
- new version

* Wed Dec 15 2004 Götz Waschk <waschk@linux-mandrake.com> 0.1.3-5mdk
- fix logrotate script

* Fri Dec  3 2004 Götz Waschk <waschk@linux-mandrake.com> 0.1.3-4mdk
- add flumotion user to the audio and video groups

* Wed Dec  1 2004 Götz Waschk <waschk@linux-mandrake.com> 0.1.3-3mdk
- fix deps

* Thu Nov 18 2004 Götz Waschk <waschk@linux-mandrake.com> 0.1.3-2mdk
- fix buildrequires

* Mon Nov 15 2004 Götz Waschk <waschk@linux-mandrake.com> 0.1.3-1mdk
- merge fixes from official spec file
- requires new gstreamer-python
- New release 0.1.3

* Sun Nov 14 2004 Götz Waschk <waschk@linux-mandrake.com> 0.1.2-1mdk
- initial package, I could use some help to make it actually work

* Fri Nov 05 2004 Christian Schaller <christian at fluendo com>
- Add call to chkconfig script in post and preun parts to get our service into 
  the service list

* Fri Nov 05 2004 Thomas Vander Stichele <thomas at apestaart dot org>
- use DESTDIR install to fix python compiles

* Mon Jun 07 2004 Thomas Vander Stichele <thomas at apestaart dot org>
- first package