rpms/trytond/F-10 trytond.init, NONE, 1.1 trytond.spec, NONE, 1.1 trytond.sysconfig, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Dan Horák sharkcz at fedoraproject.org
Thu Dec 18 10:46:27 UTC 2008


Author: sharkcz

Update of /cvs/pkgs/rpms/trytond/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22380

Modified Files:
	.cvsignore sources 
Added Files:
	trytond.init trytond.spec trytond.sysconfig 
Log Message:
initial import


--- NEW FILE trytond.init ---
#!/bin/bash
# trytond	This shell script takes care of starting and stopping
#		server for the Tryton application framework
#
# chkconfig: - 95 05
# description: Tryton Server
#
# pidfile: /var/run/trytond.pid
# config: /etc/trytond.conf

### BEGIN INIT INFO
# Provides: trytond
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start and stop trytond
# Description: Tryton Server
### END INIT INFO


PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH

# Source function library.
. /etc/rc.d/init.d/functions

prog="trytond"

PIDFILE=/var/lib/${prog}/${prog}.pid
LOCKFILE=/var/lock/subsys/${prog}
LOGFILE=/var/log/${prog}/${prog}.log
OPTS=

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

OPTS="--pidfile=$PIDFILE --logfile=$LOGFILE $OPTS"

# check if the trytond conf file is present, then use it
if [ -f /etc/trytond.conf ]; then
    OPTS="--config /etc/trytond.conf $OPTS"
fi

RETVAL=0

start() {
    [ -z "/usr/bin/trytond" ] && exit 5
    echo -n $"Starting $prog: "
    daemon --user tryton --check $prog --pidfile $PIDFILE "/usr/bin/setsid /usr/bin/trytond $OPTS &"
    RETVAL=$?
    [ $RETVAL -eq 0 ] && touch $LOCKFILE
    echo
    return $RETVAL
}

stop() {
    echo -n  $"Stopping $prog: "
    killproc  -p $PIDFILE $prog
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
    return $RETVAL
}

restart() {
    stop
    start
}

reload() {
    restart
}

force_reload() {
    restart
}

rh_status() {
    status $prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}

case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
        restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
        exit 1
esac

exit $?



--- NEW FILE trytond.spec ---
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%{!?_initddir: %define _initddir %{_initrddir}}

Name:           trytond
Version:        1.0.1
Release:        2%{?dist}
Summary:        Server for the Tryton application framework

Group:          System Environment/Daemons
License:        GPLv3+
URL:            http://www.tryton.org
Source0:        http://downloads.tryton.org/1.0/%{name}-%{version}.tar.gz
Source10:       %{name}.init
Source11:       %{name}.sysconfig
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  python-devel python-setuptools

Requires:       python-psycopg2 python-lxml python-relatorio mx pydot pytz pyOpenSSL
Requires:       python-openoffice
Requires(pre):  shadow-utils
Requires(post):  chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
Requires(postun): initscripts

Provides:       tryton(kernel) = 1.0


%description
Tryton is a three-tiers high-level general purpose application framework
written in Python and use PostgreSQL as database engine. It is the core base
of an Open Source ERP. It provides modularity, scalability and security.

The core of Tryton (also called Tryton kernel) provides all the necessary
functionalities for a complete application framework: data persistence (i.e
an ORM with extensive modularity), users management (authentication, fine
grained control for data access, handling of concurrent access of resources),
workflow and report engines, web services and internationalisation. Thus
constituting a complete application platform which can be used for any
relevant purpose.


%prep
%setup -q

# remove the shebang line
sed -i -e '1d' trytond/tests/test_db.py


%build
%{__python} setup.py build


%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
install -p -m 640 etc/%{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}

mkdir -p $RPM_BUILD_ROOT%{_initddir}
install -p -m 755 %{SOURCE10} $RPM_BUILD_ROOT%{_initddir}/%{name}

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -p -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}

mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/{lib,log}/%{name}


%clean
rm -rf $RPM_BUILD_ROOT


%pre
getent group tryton > /dev/null || /usr/sbin/groupadd -r tryton
getent passwd tryton > /dev/null || /usr/sbin/useradd -r -g tryton \
       -d %{_localstatedir}/lib/%{name} -s /sbin/nologin tryton
:

%post
/sbin/chkconfig --add %{name} || :

%preun
if [ "$1" -eq 0 ]; then
        /sbin/service %{name} stop &> /dev/null
        /sbin/chkconfig --del %{name}
fi
:

%postun
if [ "$1" -ge 1 ]; then
        /sbin/service %{name} condrestart &> /dev/null || :
fi


%files
%defattr(-,root,root,-)
%doc CHANGELOG COPYRIGHT INSTALL LICENSE README TODO
%{_initddir}/%{name}
%attr(0640,tryton,tryton) %config(noreplace) %{_sysconfdir}/%{name}.conf
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_bindir}/%{name}
%{python_sitelib}/*
%attr(0750,tryton,tryton) %{_localstatedir}/lib/%{name}
%attr(0750,tryton,tryton) %{_localstatedir}/log/%{name}


%changelog
* Tue Dec  2 2008 Dan Horák <dan[at]danny.cz> 1.0.1-2
- add dependency on python-openoffice

* Mon Dec  1 2008 Dan Horák <dan[at]danny.cz> 1.0.1-1
- update to upstream version 1.0.1

* Fri Nov 28 2008 Dan Horák <dan[at]danny.cz> 1.0.0-2
- keep modules in %%python_sitelib after a discussion with upstream, user
  written and non packaged modules will be symlinked there

* Fri Nov 28 2008 Dan Horák <dan[at]danny.cz> 1.0.0-1
- initial Fedora version



--- NEW FILE trytond.sysconfig ---
# place additional options for trytond here
#
#OPTS=""



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/trytond/F-10/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	17 Dec 2008 21:46:28 -0000	1.1
+++ .cvsignore	18 Dec 2008 10:45:56 -0000	1.2
@@ -0,0 +1 @@
+trytond-1.0.1.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/trytond/F-10/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	17 Dec 2008 21:46:28 -0000	1.1
+++ sources	18 Dec 2008 10:45:56 -0000	1.2
@@ -0,0 +1 @@
+c6623abf70994de431115ee0b93c419d  trytond-1.0.1.tar.gz




More information about the fedora-extras-commits mailing list