Sophie

Sophie

distrib > Mandriva > 2007.0 > x86_64 > media > contrib-release-src > by-pkgid > d4bdccf9fff0ebb7fcb6227e1f698242 > files > 5

flumotion-0.2.1-6mdv2007.0.src.rpm

%define gstpy 0.7.94
%define pygtk 2.4.0
%define release %mkrel 6

Name:           flumotion
Version: 0.2.1
Release: %release
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.10-init.patch.bz2
Patch1: flumotion-0.2.1-configure.patch.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

Requires:	python >= 2.3
Requires:	gstreamer0.10-plugins-good
Requires:	gstreamer0.10-python >= %gstpy
Requires:	python-twisted-core python-twisted-names
# needed for http-streamer
Requires:	python-twisted-web
Requires:	pygtk2.0 >= %pygtk
Requires:	pygtk2.0-libglade >= %pygtk
Requires:	python-imaging
Requires(pre):  rpm-helper
Requires(post):	openssl
BuildRequires:	python-twisted-core python-twisted-names
BuildRequires:	python-twisted-web
BuildRequires:	gstreamer0.10-python >= %gstpy
BuildRequires:	libgstreamer0.10-devel >= 0.8.5
BuildRequires:	python >= 2.3
BuildRequires:	pygtk2.0-devel >= %pygtk
BuildRequires:	pygtk2.0-libglade >= %pygtk
BuildRequires:	epydoc
BuildRequires:	ImageMagick
BuildRequires:	desktop-file-utils

%description
Flumotion is a free Streaming Server developed by Fluendo Inc.
Available under a dual license, it allows you to stream content using free
codecs, such as Ogg/Vorbis and Ogg/Theora, from a wide range of device, 
like FireWire cameras, ALSA and OSS sound card or TV capture cards

Modular by design, it can also distribute the load on several networked 
computers, and currently focus on live streaming.

Flumotion is written in Python on top of GStreamer and Twisted. 

%package doc 
Summary:    Flumotion server reference documentation
Group:      System/Servers

%description  doc
This package contains the reference documentation
of the Flumotion Streaming Server.

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

%build
./configure --prefix=%_prefix --libdir=%_libdir --sysconfdir=%_sysconfdir --localstatedir=%_var --mandir=%_mandir
%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%{_var}/lib/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

mkdir -p %buildroot%_sysconfdir/sysconfig/
cat > %buildroot%_sysconfdir/sysconfig/%name << EOF
# If you wish to add components to flumotion, use the following
# variable to point to the directory containing the component.
# Multiple paths can be given, provided they are separated with :
#FLU_REGISTRY_PATH=path1:path2

# Control the logging of the server.
# Must be a list of category and level, separated by a comma.
#  level : 1 to 5 ( ERROR, WARN, INFO, DEBUG, LOG )
#  category : see the source code 
#FLU_DEBUG="*:2,admin:4"
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" xdg="true"
EOF
desktop-file-install --vendor="" \
  --remove-category="Application" \
  --add-category="X-MandrivaLinux-System-Configuration-Other" \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications $RPM_BUILD_ROOT%{_datadir}/applications/*


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

rm -f %buildroot%_libdir/flumotion/python/flumotion/extern/pytrayicon/pytrayicon.la

%clean
rm -rf $RPM_BUILD_ROOT

%pre
%_pre_useradd flumotion %{_var}/lib/flumotion /sbin/nologin
/usr/sbin/usermod -G audio,video -d %{_var}/lib/flumotion 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>
<!--
    <port>7531</port>
    <transport>ssl</transport>
    <certificate>default.pem</certificate>
-->
    <component name="manager-bouncer" type="htpasswdcrypt">
      <property name="data"><![CDATA[
user:PSfNpHTkpTx1M
]]></property>
    </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>
 
  <!-- <debug>3</debug> -->

  <manager>
<!--
    <host>localhost</host>
    <port>7531</port>
-->
  </manager>

  <authentication type="plaintext">
    <username>user</username>
    <password>test</password>
  </authentication>
 
  <!-- <feederports>8600-8639</feederports> -->

</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 doc
%doc doc/reference/html

%files
%defattr(-,root,root,-)
%doc ChangeLog COPYING README AUTHORS
%doc conf
%config(noreplace) %{_sysconfdir}/rc.d/init.d/%name
%config(noreplace) %_sysconfdir/logrotate.d/%name
%config(noreplace) %{_sysconfdir}/sysconfig/%name
%{_bindir}/flumotion-manager
%{_bindir}/flumotion-worker
%{_bindir}/flumotion-admin
%{_bindir}/flumotion-tester
%{_bindir}/flumotion-admin-text
%{_bindir}/flumotion-inspect
%{_bindir}/flumotion-job
%{_bindir}/flumotion-launch
%{_bindir}/flumotion-command
%{_sbindir}/flumotion
%{_libdir}/flumotion
%{_datadir}/applications/flumotion-admin.desktop
%{_datadir}/pixmaps/flumotion.png
#gw yes, we need them all at runtime
%_datadir/locale/*/LC_MESSAGES/flumotion.mo
%dir %{_datadir}/flumotion
%{_datadir}/flumotion/*xsl
%{_datadir}/flumotion/glade/
%{_datadir}/flumotion/image
%{_datadir}/flumotion/make-dummy-cert
%{_libdir}/pkgconfig/%name.pc
%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
%attr(750,flumotion,root) %{_var}/lib/flumotion/
%{_menudir}/%{name}
%_liconsdir/%name.png
%_iconsdir/%name.png
%_miconsdir/%name.png
%_mandir/man1/*

%changelog
* Wed Sep 13 2006 Götz Waschk <waschk@mandriva.org> 0.2.1-6mdv2007.0
- fix configure check

* Mon Jul  3 2006 Götz Waschk <waschk@mandriva.org> 0.2.1-5mdv2007.0
- move the user's home to /var/lib/flumotion
- another fix for the default configuration

* Mon Jul  3 2006 Götz Waschk <waschk@mandriva.org> 0.2.1-4mdv2007.0
- update default configuration

* Wed Jun 28 2006 Götz Waschk <waschk@mandriva.org> 0.2.1-3mdv2007.0
- xdg menu
- install all translation files by default

* Tue Jun 27 2006 Götz Waschk <waschk@mandriva.org> 0.2.1-2mdv2007.0
- fix buildrequires

* Tue May 16 2006 Michael Scherer <misc@mandriva.org> 0.2.1-1mdk
- New release 0.2.1

* Wed Feb 15 2006 Götz Waschk <waschk@mandriva.org> 0.1.10-3mdk
- patch in LSB init
- move back to arch-dependant pkgconfig dir

* Wed Dec 21 2005 Michael Scherer <misc@mandriva.org> 0.1.10-2mdk
- fix Requires ( thanks plouf ) 

* Sun Nov 13 2005 Michael Scherer <misc@mandriva.org> 0.1.10-1mdk
- New release 0.1.10

* Tue Aug 02 2005 Michael Scherer <misc@mandriva.org> 0.1.9-2mdk
- fix Requires

* Wed Jul 27 2005 Michael Scherer <misc@mandriva.org> 0.1.9-1mdk
- New release 0.1.9

* Sun Jul 10 2005 Michael Scherer <misc@mandriva.org> 0.1.8-3mdk
- add a config file for initscript ( ease the addition of component, debug level )

* Mon Jul 04 2005 Michael Scherer <misc@mandriva.org> 0.1.8-2mdk
- split the doc package from main
- enhance description
- become archdependant ( tray icon )

* Mon May 23 2005 Götz Waschk <waschk@mandriva.org> 0.1.8-1mdk
- fix file list
- New release 0.1.8

* Sun May 15 2005 Götz Waschk <waschk@mandriva.org> 0.1.7-3mdk
- mkrel
- depend on python-twisted-core

* Thu Apr 28 2005 Götz Waschk <waschk@mandriva.org> 0.1.7-2mdk
- fix pkgconfig file location

* 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