create core package
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Licensed under the GNU General Public License, version 3.
|
||||
# See the file http://www.gnu.org/licenses/gpl.txt
|
||||
#
|
||||
|
||||
from pisi.actionsapi import pythonmodules
|
||||
|
||||
def install():
|
||||
pythonmodules.install()
|
||||
@@ -0,0 +1,23 @@
|
||||
Index: api/comar/service.py
|
||||
===================================================================
|
||||
--- api/comar/service.py (revision 33513)
|
||||
+++ api/comar/service.py (revision 33514)
|
||||
@@ -113,6 +113,18 @@
|
||||
except:
|
||||
pass
|
||||
|
||||
+def stopDependencies(*services):
|
||||
+ """Stop dependencies.
|
||||
+
|
||||
+ Arguments are service names.
|
||||
+ """
|
||||
+ for service in services:
|
||||
+ try:
|
||||
+ call(service, "System.Service", "stop")
|
||||
+ except:
|
||||
+ pass
|
||||
+
|
||||
+
|
||||
# Service control utilities
|
||||
|
||||
def _getPid(pidfile):
|
||||
@@ -0,0 +1,30 @@
|
||||
diff -Naur comar-api-2.4.9.orig/comar/network.py comar-api-2.4.9/comar/network.py
|
||||
--- comar-api-2.4.9.orig/comar/network.py 2014-08-19 20:10:23.926869379 +0200
|
||||
+++ comar-api-2.4.9/comar/network.py 2014-08-19 20:11:42.129866522 +0200
|
||||
@@ -15,8 +15,8 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
-from pardus import iniutils
|
||||
-from pardus import netutils
|
||||
+from pisilinux import iniutils
|
||||
+from pisilinux import netutils
|
||||
|
||||
from comar.service import startService, stopService, loadConfig
|
||||
|
||||
diff -Naur comar-api-2.4.9.orig/setup.py comar-api-2.4.9/setup.py
|
||||
--- comar-api-2.4.9.orig/setup.py 2010-11-11 14:29:05.000000000 +0100
|
||||
+++ comar-api-2.4.9/setup.py 2014-08-19 20:12:26.807864889 +0200
|
||||
@@ -50,9 +50,9 @@
|
||||
class Install(install):
|
||||
def finalize_options(self):
|
||||
# NOTE: for Pardus distribution
|
||||
- if os.path.exists("/etc/pardus-release"):
|
||||
- self.install_platlib = '$base/lib/pardus'
|
||||
- self.install_purelib = '$base/lib/pardus'
|
||||
+ if os.path.exists("/etc/pisilinux-release"):
|
||||
+ self.install_platlib = '$base/lib/pisilinux'
|
||||
+ self.install_purelib = '$base/lib/pisilinux'
|
||||
install.finalize_options(self)
|
||||
|
||||
def run(self):
|
||||
@@ -0,0 +1,30 @@
|
||||
diff -Naur comar-api-2.4.9.orig/comar/network.py comar-api-2.4.9/comar/network.py
|
||||
--- comar-api-2.4.9.orig/comar/network.py 2010-11-11 14:29:05.000000000 +0100
|
||||
+++ comar-api-2.4.9/comar/network.py 2014-08-19 20:06:27.584878014 +0200
|
||||
@@ -146,12 +146,12 @@
|
||||
# Start service
|
||||
startService(command="/usr/sbin/ifplugd",
|
||||
args="%s -i %s" % (args, device),
|
||||
- pidfile="/var/run/ifplugd.%s.pid" % device,
|
||||
+ pidfile="/run/ifplugd.%s.pid" % device,
|
||||
detach=True,
|
||||
donotify=False)
|
||||
else:
|
||||
# Stop service
|
||||
- stopService(pidfile="/var/run/ifplugd.%s.pid" % device, donotify=False)
|
||||
+ stopService(pidfile="/run/ifplugd.%s.pid" % device, donotify=False)
|
||||
|
||||
def plugCheck(device):
|
||||
# Return true if ifplugd is missing
|
||||
diff -Naur comar-api-2.4.9.orig/comar/utility.py comar-api-2.4.9/comar/utility.py
|
||||
--- comar-api-2.4.9.orig/comar/utility.py 2010-11-11 14:29:05.000000000 +0100
|
||||
+++ comar-api-2.4.9/comar/utility.py 2014-08-19 20:06:52.055877120 +0200
|
||||
@@ -31,7 +31,7 @@
|
||||
"""
|
||||
class Handler:
|
||||
def handler(self, *args, **kwargs):
|
||||
- lock = FileLock("/var/lock/subsys/%s.comar" % script())
|
||||
+ lock = FileLock("/run/lock/subsys/%s.comar" % script())
|
||||
lock.lock()
|
||||
self.myfunc(*args, **kwargs)
|
||||
lock.unlock()
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>comar-api</Name>
|
||||
<Homepage>http://www.pisilinux.org</Homepage>
|
||||
<Packager>
|
||||
<Name>PisiLinux Community</Name>
|
||||
<Email>admins@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>GPLv2</License>
|
||||
<IsA>library</IsA>
|
||||
<Summary>Utility functions for Comar scripts</Summary>
|
||||
<Description>Generic utility library for common Comar script operations.</Description>
|
||||
<Archive sha1sum="80afa9f07cd15b9042cce9c1b8f1c4dcd457c552" type="targz">http://source.pisilinux.org/1.0/comar-api-2.4.9.tar.gz</Archive>
|
||||
<BuildDependencies>
|
||||
<Dependency>python</Dependency>
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<Patch level="1">run_dir.patch</Patch>
|
||||
<Patch level="1">pisilinux.patch</Patch>
|
||||
<Patch level="1">add-stopdependencies.patch</Patch>
|
||||
</Patches>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>comar-api</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency>python</Dependency>
|
||||
<Dependency>pisilinux-python</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="library">/usr/lib/pisilinux</Path>
|
||||
<Path fileType="library">/usr/lib/python2.7</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="4" type="critical">
|
||||
<Date>2014-08-20</Date>
|
||||
<Version>2.4.9</Version>
|
||||
<Comment>Fix paths.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="3">
|
||||
<Date>2014-05-11</Date>
|
||||
<Version>2.4.9</Version>
|
||||
<Comment>Release bump.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="2">
|
||||
<Date>2013-08-31</Date>
|
||||
<Version>2.4.9</Version>
|
||||
<Comment>Release bump, clean comar-api.</Comment>
|
||||
<Name>Serdar Soytetir</Name>
|
||||
<Email>kaptan@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="1">
|
||||
<Date>2010-11-29</Date>
|
||||
<Version>2.4.9</Version>
|
||||
<Comment>First release</Comment>
|
||||
<Name>Pisi Linux Admins</Name>
|
||||
<Email>admins@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</PISI>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" ?>
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>comar-api</Name>
|
||||
<Summary xml:lang="tr">Çomar betikleri için yardımcı fonksiyonlar</Summary>
|
||||
<Description xml:lang="tr">Çomar betiklerinde sıkça yapılan ortak işlemler için yardımcı fonksiyonlar kitaplığı.</Description>
|
||||
<Description xml:lang="fr">Librairie utilitaire générique pour les opérations communes de scripts Comar.</Description>
|
||||
</Source>
|
||||
</PISI>
|
||||
Reference in New Issue
Block a user