Current Path : /usr/lib/python2.7/dist-packages/twisted/scripts/ |
Current File : //usr/lib/python2.7/dist-packages/twisted/scripts/tap2rpm.pyc |
oUNc @ s d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z m Z d Z d Z d e j f d YZ i d d 6d d 6d d 6d d 6Z d Z d Z d d Z d S( iN( t StringIO( t usaget logs #!/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 B s e Z d d g d d g g Z d d d g d d d g d d d g d d d g d d d g d d d g d d d g d d d d g g Z e j d i e j d d d d g d 6e j d d 6 Z d Z RS(! t unsignedt ut quiett qt tapfilet ts twistd.tapt maintainert mt tap2rpmt protocolt pt descriptiont et long_descriptiont ls Automatically created by tap2rpms set-versiont Vs 1.0t rpmfilet rt typet yt taps8 type of configuration: 'tap', 'xml, 'source' or 'python't optActionst xmlt sourcet pythons *.rpmc C s | d d k rC t j j | d } t j j | d | d <n | d d k rk d | d f | d <n | d d k r d | d f | d <n t | d | d <d | d | d f | d <d S( sP Calculate the default values for certain command-line options. R R i R s A TCP server for %sR s twisted-%sR t twistd_options %s-%ss set-versions release-nameN( t Nonet ost patht basenamet splitextt type_dict( t selft base_tapfile( ( s; /usr/lib/python2.7/dist-packages/twisted/scripts/tap2rpm.pyt postOptions s N( t __name__t __module__t optFlagsR t optParametersR t Completionst CompleteListt CompleteFilest compDataR&