ó Aˇ_Oc@sddlZddlZddlZddlZddlZddlZddlZddlZddlmZddl Z ddl m Z m Z m Z mZdZdZde jfd„ƒYZidd 6d d 6d d 6d d 6Zd „Zd„Zdd„ZdS(i˙˙˙˙N(tStringIO(tusagetlogtversionst deprecates#!/bin/sh # # Startup script for a Twisted service. # # chkconfig: - 85 15 # description: Start-up script for the Twisted service "%(tap_file)s". PATH=/usr/bin:/bin:/usr/sbin:/sbin pidfile=/var/run/%(rpm_file)s.pid rundir=/var/lib/twisted-taps/%(rpm_file)s/ file=/etc/twisted-taps/%(tap_file)s logfile=/var/log/%(rpm_file)s.log # load init function library . /etc/init.d/functions [ -r /etc/default/%(rpm_file)s ] && . /etc/default/%(rpm_file)s # check for required files if [ ! -x /usr/bin/twistd ] then echo "$0: Aborting, no /usr/bin/twistd found" exit 0 fi if [ ! -r "$file" ] then echo "$0: Aborting, no file $file found." exit 0 fi # set up run directory if necessary if [ ! -d "${rundir}" ] then mkdir -p "${rundir}" fi case "$1" in start) echo -n "Starting %(rpm_file)s: twistd" daemon twistd \ --pidfile=$pidfile \ --rundir=$rundir \ --%(twistd_option)s=$file \ --logfile=$logfile status %(rpm_file)s ;; stop) echo -n "Stopping %(rpm_file)s: twistd" kill `cat "${pidfile}"` status %(rpm_file)s ;; restart) "${0}" stop "${0}" start ;; *) echo "Usage: ${0} {start|stop|restart|}" >&2 exit 1 ;; esac exit 0 sźSummary: %(description)s Name: %(rpm_file)s Version: %(version)s Release: 1 License: Unknown Group: Networking/Daemons Source: %(tarfile_basename)s BuildRoot: %%{_tmppath}/%%{name}-%%{version}-root Requires: /usr/bin/twistd BuildArch: noarch %%description %(long_description)s %%prep %%setup %%build %%install [ ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != '/' ] && rm -rf "$RPM_BUILD_ROOT" mkdir -p "$RPM_BUILD_ROOT"/etc/twisted-taps mkdir -p "$RPM_BUILD_ROOT"/etc/init.d mkdir -p "$RPM_BUILD_ROOT"/var/lib/twisted-taps cp "%(tap_file)s" "$RPM_BUILD_ROOT"/etc/twisted-taps/ cp "%(rpm_file)s.init" "$RPM_BUILD_ROOT"/etc/init.d/"%(rpm_file)s" %%clean [ ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != '/' ] && rm -rf "$RPM_BUILD_ROOT" %%post /sbin/chkconfig --add %(rpm_file)s /sbin/chkconfig --level 35 %(rpm_file)s /etc/init.d/%(rpm_file)s start %%preun /etc/init.d/%(rpm_file)s stop /sbin/chkconfig --del %(rpm_file)s %%files %%defattr(-,root,root) %%attr(0755,root,root) /etc/init.d/%(rpm_file)s %%attr(0660,root,root) /etc/twisted-taps/%(tap_file)s %%changelog * %(date)s %(maintainer)s - Created by tap2rpm: %(rpm_file)s (%(version)s) t MyOptionsc BsÖeZddggZdddgdddgdd dgd d dgd d dgdddgdddgddddggZejdiejddddgƒd6ejdƒd6ƒZ d„Z d„Z e Z RS( tquiettqttapfiletts twistd.tapt maintainertmttap2rpmtprotocoltpt descriptiontetlong_descriptiontls Automatically created by tap2rpms set-versiontVs1.0trpmfiletrttypetyttaps8type of configuration: 'tap', 'xml, 'source' or 'python't optActionstxmltsourcetpythons*.rpmcCsĹ|dd krCtjj|dƒ}tjj|ƒd|ds"<    "I55   E