Kaydet (Commit) 2d91ba9f authored tarafından Your Name's avatar Your Name

hepsi bitti

üst 5959d62f
#!/usr/bin/env python3
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
os.spawnle(os.P_WAIT, "/usr/bin/fc-cache", "/usr/bin/fc-cache", "-r", { "HOME": "/root/" })
def postRemove():
pass
def preRemove():
pass
# -*- coding: utf-8 -*-
import ciksemel
import subprocess
def updateCache(filepath):
doc = ciksemel.parse(filepath)
for item in doc.tags("File"):
path = item.getTagData("Path")
if path.startswith("usr/share/fonts"):
subprocess.call(["/usr/bin/fc-cache"])
return
def setupPackage(metapath, filepath):
updateCache(filepath)
def cleanupPackage(metapath, filepath):
pass
def postCleanupPackage(metapath, filepath):
updateCache(filepath)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import ciksemel
import os
def updateData(filepath):
parse = ciksemel.parse(filepath)
for icon in parse.tags("File"):
path = icon.getTagData("Path")
if path.startswith("usr/share/applications"):
os.system("/usr/bin/update-desktop-database -q")
return
def setupPackage(metapath, filepath):
updateData(filepath)
def cleanupPackage(metapath, filepath):
pass
def postCleanupPackage(metapath, filepath):
updateData(filepath)
#!/usr/bin/env python3
import os
# Update global mime databases, mime database format may change (0.70)
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
os.system("/usr/bin/update-mime-database /usr/share/mime")
#!/usr/bin/env python3
import ciksemel
import os
def updateMimeTypes(filepath):
parse = ciksemel.parse(filepath)
paths = set()
for icon in parse.tags("File"):
path = icon.getTagData("Path")
if "/share/mime/packages/" in path and path.endswith(".xml"):
paths.add("/%s" % path.partition("packages/")[0])
for p in paths:
os.system("/usr/bin/update-mime-database %s" % p)
def setupPackage(metapath, filepath):
updateMimeTypes(filepath)
def cleanupPackage(metapath, filepath):
pass
def postCleanupPackage(metapath, filepath):
updateMimeTypes(filepath)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import ciksemel
import os
def installGconfSchemas(filepath):
os.environ['GCONF_CONFIG_SOURCE'] = 'xml:merged:/etc/gconf/gconf.xml.defaults'
parse = ciksemel.parse(filepath)
schemas = []
for schema in parse.tags("File"):
path = schema.getTagData("Path")
if path.startswith("etc/gconf/schemas"):
schemas.append("/"+path)
if schemas:
os.system("/usr/bin/gconftool-2 --makefile-install-rule %s" % " ".join(schemas))
def uninstallGconfSchemas(filepath):
os.environ['GCONF_CONFIG_SOURCE'] = 'xml:merged:/etc/gconf/gconf.xml.defaults'
parse = ciksemel.parse(filepath)
schemas = []
for schema in parse.tags("File"):
path = schema.getTagData("Path")
if path.startswith("etc/gconf/schemas"):
schemas.append("/"+path)
if schemas:
os.system("/usr/bin/gconftool-2 --makefile-uninstall-rule %s" % " ".join(schemas))
def setupPackage(metapath, filepath):
installGconfSchemas(filepath)
def cleanupPackage(metapath, filepath):
uninstallGconfSchemas(filepath)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import ciksemel
import os
def updateData(filepath):
parse = ciksemel.parse(filepath)
for icon in parse.tags("File"):
path = icon.getTagData("Path")
if path.startswith("usr/lib32/gdk-pixbuf-2.0/2.10.0/loaders"):
os.system("/usr/bin/gdk-pixbuf-query-loaders-32 --update-cache")
return
def setupPackage(metapath, filepath):
updateData(filepath)
def cleanupPackage(metapath, filepath):
pass
def postCleanupPackage(metapath, filepath):
updateData(filepath)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import ciksemel
import os
def updateData(filepath):
parse = ciksemel.parse(filepath)
for icon in parse.tags("File"):
path = icon.getTagData("Path")
if path.startswith("usr/lib/gdk-pixbuf-2.0/2.10.0/loaders"):
os.system("/usr/bin/gdk-pixbuf-query-loaders --update-cache")
return
def setupPackage(metapath, filepath):
updateData(filepath)
def cleanupPackage(metapath, filepath):
pass
def postCleanupPackage(metapath, filepath):
updateData(filepath)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import ciksemel
import os
import fnmatch
def updateData(filepath):
parse = ciksemel.parse(filepath)
iconFound = False
immoduleFound = False
for icon in parse.tags("File"):
path = icon.getTagData("Path")
if path.startswith("usr/share/icons/hicolor") and not iconFound:
os.system("/usr/bin/gtk-update-icon-cache -f /usr/share/icons/hicolor")
iconFound = True
if immoduleFound:
return
if fnmatch.fnmatch(path, "usr/lib/gtk-2.0/*immodules/*.so") and not immoduleFound:
os.system("/usr/bin/gtk-query-immodules-2.0 --update-cache")
immoduleFound = True
if iconFound:
return
if fnmatch.fnmatch(path, "usr/lib32/gtk-2.0/*immodules/*.so") and not immoduleFound:
os.system("/usr/bin/gtk-query-immodules-2.0-32bit --update-cache")
immoduleFound = True
if iconFound:
return
def setupPackage(metapath, filepath):
updateData(filepath)
def cleanupPackage(metapath, filepath):
pass
def postCleanupPackage(metapath, filepath):
updateData(filepath)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import ciksemel
import os
import fnmatch
def updateData(filepath):
parse = ciksemel.parse(filepath)
iconFound = False
immoduleFound = False
for icon in parse.tags("File"):
path = icon.getTagData("Path")
if path.startswith("usr/share/icons/hicolor") and not iconFound:
os.system("/usr/bin/gtk-update-icon-cache -f /usr/share/icons/hicolor")
iconFound = True
if immoduleFound:
return
if fnmatch.fnmatch(path, "usr/lib/gtk-3.0/*immodules/*.so") and not immoduleFound:
os.system("/usr/bin/gtk-query-immodules-3.0 --update-cache")
immoduleFound = True
if iconFound:
return
if fnmatch.fnmatch(path, "usr/lib32/gtk-3.0/*immodules/*.so") and not immoduleFound:
os.system("/usr/bin/gtk-query-immodules-3.0-32bit --update-cache")
immoduleFound = True
if iconFound:
return
def setupPackage(metapath, filepath):
updateData(filepath)
def cleanupPackage(metapath, filepath):
pass
def postCleanupPackage(metapath, filepath):
updateData(filepath)
......@@ -2,7 +2,7 @@
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
def postInstall():
os.system("xmlcatalog --noout --add \
\"system\" \"http://glade.gnome.org/glade-2.0.dtd\" /usr/share/xml/libglade/glade-2.0.dtd")
......
......@@ -39,9 +39,7 @@
<Path fileType="doc">/usr/share/doc</Path>
<Path fileType="data">/usr/share/xml</Path>
</Files>
<Provides>
<SCOM script="package.py">System.Package</SCOM>
</Provides>
<IsA>postOps</IsA>
</Package>
<Package>
<Name>libglade-docs</Name>
......@@ -68,6 +66,13 @@
</Files>
</Package>
<History>
<Update release="2">
<Date>2019-04-12</Date>
<Version>2.6.4</Version>
<Comment>postOps uyumluluğu</Comment>
<Name>Suleyman Poyraz</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update>
<Update release="1">
<Date>2019-04-12</Date>
<Version>2.6.4</Version>
......
# -*- coding: utf-8 -*-
import ciksemel
import os
import subprocess
def byteCompile(filepath):
doc = ciksemel.parse(filepath)
for item in doc.tags("File"):
path = item.getTagData("Path")
if path.endswith(".el") and not os.path.exists("/%sc" % path):
subprocess.call(["/usr/bin/emacs", "--no-init-file", "--no-site-file", "--multibyte", "-batch", "-f", "batch-byte-compile", "/%s" % path])
def removeByteCompiled(filepath):
doc = ciksemel.parse(filepath)
for item in doc.tags("File"):
path = item.getTagData("Path")
if path.endswith(".el"):
try:
# Remove .elc
os.unlink("/%sc" % path)
except OSError:
pass
def setupPackage(metapath, filepath):
byteCompile(filepath)
def cleanupPackage(metapath, filepath):
removeByteCompiled(filepath)
#!/usr/bin/env python3
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
# write layout's config
os.system("rc-update add bluetooth default")
from scom.service import *
import os
serviceType = "local"
serviceDesc = {"en": "Bluetooth Service",
"tr": "Bluetooth Hizmeti"}
serviceDefault = "on"
PIDFILE="/run/bluez.pid"
DAEMON ="/usr/libexec/bluetooth/bluetoothd"
@synchronized
def start():
startService(command=DAEMON,
pidfile=PIDFILE,
detach=True,
donotify=True)
os.system("pidof bluez + /usr/libexec/bluetooth/bluetoothd > /run/bluez.pid")
@synchronized
def stop():
stopService(pidfile=PIDFILE,
donotify=True)
try:
os.unlink(PIDFILE)
except:
pass
def status():
return isServiceRunning(pidfile=PIDFILE)
#!/usr/bin/python
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
os.system("/sbin/scomd_tmpfiles.py /usr/lib/tmpfiles.d/lvm2.conf")
from scom.service import *
serviceType = "server"
serviceDesc = {"en": "RAID monitor daemon",
"tr": "RAID izleme servisi"}
serviceConf = "mdadm"
MSG_ERR_STRTSRVC = {"en": "Couldn't start service.Please edit mdadm.conf file.",
"tr": "Servis başlatılamadı.Lütfen mdadm.conf dosyasını düzenleyiniz.",
}
def check():
try:
f = file("/etc/mdadm.conf")
confLines = [a.lstrip() for a in f]
confLines = filter(lambda x: not (x.startswith("\#") or x == ""), confLines)
check = False
for line in confLines:
if "MAILADDR" or "PROGRAM" in line.split():
check = True
if not check:
fail(MSG_ERR_STRTSRVC)
except:
fail(MSG_ERR_STRTSRVC)
finally:
f.close()
@synchronized
def start():
check()
startService(command="/sbin/mdadm",
args="--monitor --scan --daemonise --pid-file /run/mdadm.pid %s" % config.get("MDADM_OPTS"),
pidfile="/run/mdadm.pid",
donotify=True)
@synchronized
def stop():
stopService(pidfile="/run/mdadm.pid",
donotify=True)
def status():
return isServiceRunning("/run/mdadm.pid")
# -*- coding: utf-8 -*-
serviceType = "local"
serviceDesc = _({"en": "Console Mouse Daemon",
"tr": "Konsol Fare Servisi"})
from scom.service import *
@synchronized
def start():
args = []
args.append("-m %s" % config.get("MOUSEDEV", "/dev/input/mice"))
args.append("-t %s" % config.get("MOUSE", "imps2"))
if "RESPONSIVENESS" in config:
args.append("-r %s " % config.get("RESPONSIVENESS"))
if "REPEAT_TYPE" in config:
args.append("-R%s " % config.get("REPEAT_TYPE"))
args.append(config.get("APPEND", ""))
startService(command="/usr/sbin/gpm",
args=" ".join(args),
donotify=True)
@synchronized
def stop():
stopService(pidfile="/run/gpm.pid",
donotify=True)
def status():
return isServiceRunning("/run/gpm.pid")
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
stale_files = ["/usr/share/hal/fdi/information/10freedesktop/10-camera-libgphoto2-device.fdi",
"/etc/udev/rules.d/60-libgphoto2.rules"]
for f in stale_files:
if os.path.exists(f):
os.unlink(f)
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
os.system("chmod 04771 /usr/bin/cdrecord")
......@@ -7,7 +7,7 @@ OUR_DESC = "docker"
logfile = "/var/log/docker.log"
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
def postInstall():
try:
os.system("/usr/sbin/groupadd %s" % OUR_NAME)
os.system("usermod -a -G docker %s" % os.getusername())
......@@ -21,4 +21,4 @@ def preRemove():
try:
os.system ("groupdel %s" % OUR_NAME)
except:
pass
\ No newline at end of file
pass
......@@ -50,12 +50,17 @@
<AdditionalFile owner="root" permission="0644" target="/etc/conf.d/docker">docker.confd</AdditionalFile>
<AdditionalFile owner="root" permission="0755" target="/etc/init.d/docker">docker.initd</AdditionalFile>
</AdditionalFiles>
<Provides>
<SCOM script="package.py">System.Package</SCOM>
</Provides>
<IsA>postOps</IsA>
</Package>
<History>
<Update release="2">
<Date>2019-11-21</Date>
<Version>19.03.5</Version>
<Comment>postOps uyumluluğu</Comment>
<Name>Süleyman Poyraz</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update>
<Update release="1">
<Date>2019-11-21</Date>
<Version>19.03.5</Version>
......
......@@ -3,8 +3,8 @@
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
def postInstall():
os.system("groupadd -r -g 84 avahi")
os.system("useradd -r -u 84 -g avahi -d / -s /bin/nologin -c avahi avahi")
os.system("useradd -r -u 84 -g avahi -d / -s /sbin/nologin -c avahi avahi")
\ No newline at end of file
......@@ -271,10 +271,7 @@
<AdditionalFiles>
<AdditionalFile owner="root" permission="0644" target="/usr/lib/tmpfiles.d/avahi.conf">avahi.conf</AdditionalFile>
</AdditionalFiles>
<Provides>
<SCOM script="avahi-daemon-service.py">System.Service</SCOM>
<SCOM script="avahi-daemon-package.py">System.Package</SCOM>
</Provides>
<IsA>postOps</IsA>
</Package>
<Package>
......@@ -347,6 +344,13 @@
</Package>
<History>
<Update release="2">
<Date>2019-09-27</Date>
<Version>0.7</Version>
<Comment>First release</Comment>
<Name>postOps uyumluluğu</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update>
<Update release="1">
<Date>2019-09-27</Date>
<Version>0.7</Version>
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import shutil
ownerships = {
"/run/avahi-daemon" : "avahi:avahi",
}
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
for directory,owners in ownerships.items():
if os.path.exists(directory):
os.system("/bin/chown %s %s" % (owners, directory))
if os.path.exists("/etc/localtime"):
if not os.path.isdir("/etc/avahi/etc"):
os.makedirs("/etc/avahi/etc")
shutil.copy("/etc/localtime", "/etc/avahi/etc/localtime")
from scom.service import *
serviceType="server"
serviceDesc = {"en": "Avahi Server",
"tr": "Avahi Hizmeti"}
@synchronized
def start():
startService(command="/usr/sbin/avahi-daemon",
args="-D",
donotify=True)
@synchronized
def stop():
stopService(command="/usr/sbin/avahi-daemon",
args="-k",
donotify=True)
def reload():
stopService(command="/usr/sbin/avahi-daemon",
args="-r",
donotify=True)
def status():
return isServiceRunning("/run/avahi-daemon/pid")
from scom.service import *
import signal
serviceType="server"
serviceDesc = {"en": "Avahi DNS Configuration Daemon",
"tr": "Avahi DNS Yapılandırma Hizmeti"}
PIDFILE = "/run/avahi-dnsconfd.pid"
DAEMON = "/usr/sbin/avahi-dnsconfd"
@synchronized
def start():
startDependencies("avahi")
startService(command=DAEMON,
args="-D",
donotify=True)
@synchronized
def stop():
stopService(pidfile=PIDFILE,
donotify=True)
@synchronized
def reload():
stopService(command=DAEMON,
signal=signal.SIGHUP)
def status():
return isServiceRunning(pidfile=PIDFILE)
......@@ -2,7 +2,7 @@
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
def postInstall():
os.system("/usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas >/dev/null 2>&1")
......@@ -64,9 +64,7 @@
<Path fileType="doc">/usr/share/doc</Path>
<Path fileType="localedata">/usr/share/locale</Path>
</Files>
<Provides>
<SCOM script="package.py">System.Package</SCOM>
</Provides>
<IsA>postOps</IsA>
</Package>
<Package>
......@@ -84,6 +82,13 @@
</Package>
<History>
<Update release="3">
<Date>2019-12-15</Date>
<Version>1.8.24</Version>
<Comment>postOps uyumluluğu</Comment>
<Name>Süleyman Poyraz</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update>
<Update release="2">
<Date>2019-12-15</Date>
<Version>1.8.24</Version>
......
#/usr/bin/python
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
# Set capabilities in order to prevent wireshark from being executed as root
os.system("/bin/chmod 0750 /usr/bin/dumpcap")
os.system("/bin/chown root:wireshark /usr/bin/dumpcap")
os.system("/sbin/setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap")
# -*- coding: utf-8 -*-
serviceType = "server"
serviceDesc = {"en": "RSync Daemon",
"tr": "RSync Servisi"}
serviceConf = "rsyncd"
from scom.service import *
@synchronized
def start():
startService(command="/usr/bin/rsync",
args="--daemon %s" % config.get("RSYNC_OPTS", ""),
pidfile="/run/rsyncd.pid",
donotify=True)
@synchronized
def stop():
stopService(pidfile="/run/rsyncd.pid",
donotify=True)
def status():
return isServiceRunning("/run/rsyncd.pid")
......@@ -2,7 +2,7 @@
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
def postInstall():
os.system("/usr/bin/install-catalog --add /etc/sgml/sgml-docbook-4.5.cat \
/usr/share/sgml/docbook/sgml-dtd-4.5/catalog")
os.system("/usr/bin/install-catalog --add /etc/sgml/sgml-docbook-4.5.cat \
......
......@@ -27,12 +27,17 @@
<Path fileType="doc">/usr/share/doc/docbook-sgml</Path>
<Path fileType="data">/usr/share</Path>
</Files>
<Provides>
<SCOM script="package.py">System.Package</SCOM>
</Provides>
<IsA>postOps</IsA>
</Package>
<History>
<Update release="2">
<Date>2019-09-18</Date>
<Version>4.5</Version>
<Comment>postOps</Comment>
<Name>Süleyman Poyraz</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update>
<Update release="1">
<Date>2019-09-18</Date>
<Version>4.5</Version>
......
......@@ -14,8 +14,6 @@ def install():
% get.installDIR())
inarytools.insinto("/usr/share/xml/docbook/xsl-stylesheets/","VERSION.xsl")
# Don't ship the extensions
inarytools.remove("/usr/share/xml/docbook/xsl-stylesheets/extensions/*")
inarytools.dodoc("AUTHORS", "BUGS", "COPYING", "NEWS", "README",
"RELEASE-NOTES.txt", "TODO", "VERSION")
......@@ -2,7 +2,7 @@
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
def postInstall():
os.system("/usr/bin/build-docbook-catalog")
def preRemove():
pass
......
......@@ -12,10 +12,7 @@
<IsA>data</IsA>
<Summary>Norman Walsh's XSL stylesheets for DocBook XML</Summary>
<Description>These XSL stylesheets allow you to transform any DocBook XML document to other formats such as HTML, FO and XHTML.</Description>
<Archive sha1sum="7487b2acc7106253bb77fcddc7e1a9788601ad23" type="tarbz2">http://sourceforge.net/projects/docbook/files/docbook-xsl/1.79.1/docbook-xsl-1.79.1.tar.bz2</Archive>
<AdditionalFiles>
<AdditionalFile target="Makefile">Makefile</AdditionalFile>
</AdditionalFiles>
<Archive sha1sum="7487b2acc7106253bb77fcddc7e1a9788601ad23" >https://master.dl.sourceforge.net/project/docbook/docbook-xsl/1.79.1/docbook-xsl-1.79.1.tar.bz2</Archive>
<Patches>
<Patch level="1">docbook-xsl-pagesetup.patch</Patch>
<Patch level="1">docbook-xsl-newmethods.patch</Patch>
......@@ -33,11 +30,16 @@
<Path fileType="doc">/usr/share/doc/docbook-xsl</Path>
<Path fileType="data">/usr/share/xml</Path>
</Files>
<Provides>
<SCOM script="package.py">System.Package</SCOM>
</Provides>
<IsA>postOps</IsA>
</Package>
<History>
<Update release="2">
<Date>2018-12-28</Date>
<Version>1.79.1</Version>
<Comment>postOps uyumluluğu</Comment>
<Name>Süleyman POYRAZ</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update>
<Update release="1">
<Date>2018-12-28</Date>
<Version>1.79.1</Version>
......
......@@ -3,7 +3,7 @@
import os
import shutil
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
def postInstall():
os.system("/usr/bin/install-catalog --add \
/etc/sgml/sgml-ent.cat \
......
......@@ -27,11 +27,16 @@
<Path fileType="man">/usr/share/man</Path>
<Path fileType="data">/usr/share/sgml</Path>
</Files>
<Provides>
<SCOM script="package.py">System.Package</SCOM>
</Provides>
<IsA>postOps</IsA>
</Package>
<History>
<Update release="2">
<Date>2018-12-28</Date>
<Version>0.6.3</Version>
<Comment>postOps uyumluluğu</Comment>
<Name>Süleyman POYRAZ</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update>
<Update release="1">
<Date>2018-12-28</Date>
<Version>0.6.3</Version>
......
......@@ -2,7 +2,7 @@
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
def postInstall():
os.system('/usr/bin/xmlcatalog --noout --add "public" \
"-//OMF//DTD Scrollkeeper OMF Variant V1.0//EN" \
"file:///usr/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd" \
......
......@@ -13,7 +13,7 @@
<IsA>app:console</IsA>
<Summary>Documentation metadata library and scrollkeeper wrapper</Summary>
<Description>Rarian is a documentation metadata library based on the freedesktop.org specification and contains well-designed scrollkeeper wrapper.</Description>
<Archive sha1sum="9b3f1bad1cdbb0de51d6f74431b20eb3647edc5a" type="tarbz2">mirrors://gnome/rarian/0.8/rarian-0.8.1.tar.bz2</Archive>
<Archive sha1sum="9b3f1bad1cdbb0de51d6f74431b20eb3647edc5a" type="tarbz2">https://download.gnome.org/sources/rarian/0.8/rarian-0.8.1.tar.bz2</Archive>
<Patches>
<Patch>user-segfault.patch</Patch>
<Patch>01_info_shortnames.patch</Patch>
......@@ -36,13 +36,17 @@
<AdditionalFiles>
<AdditionalFile owner="root" permission="0644" target="/usr/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd">scrollkeeper-omf.dtd</AdditionalFile>
</AdditionalFiles>
<Provides>
<SCOM script="package.py">System.Package</SCOM>
</Provides>
<IsA>postOps</IsA>
</Package>
<History>
<Update release="1">
<Update release="2">
<Date>2019-09-15</Date>
<Version>0.8.1</Version>
<Comment>postOps uyumluluğu</Comment>
<Name>Süleyman Poyraz</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update><Update release="1">
<Date>2019-09-15</Date>
<Version>0.8.1</Version>
<Comment>First release</Comment>
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt
from inary.actionsapi import perlmodules
from inary.actionsapi import inarytools
from inary.actionsapi import get
from inary.actionsapi import shelltools
WorkDir=""
shelltools.export("HOME", get.workDIR())
def setup():
perlmodules.configure()
def build():
perlmodules.make()
# FIXME: test fails
def check():
perlmodules.make("test")
def install():
perlmodules.install()
<!DOCTYPE INARY SYSTEM "https://raw.githubusercontent.com/Zaryob/inary/master/inary-spec.dtd">
<INARY>
<Source>
<Name>perl-ExtUtils-typemap</Name>
<Homepage>https://metacpan.org/pod/ExtUtils::Depends</Homepage>
<Packager>
<Name>Suleyman Poyraz</Name>
<Email>zaryob.dev@gmail.com</Email>
</Packager>
<License>Artistic</License>
<IsA>library</IsA>
<Summary>Easily build XS extensions that depend on XS extensions</Summary>
<Description>This module tries to make it easy to build Perl extensions that use functions and typemaps provided by other perl extensions. This means that a perl extension is treated like a shared library that provides also a C and an XS interface besides the perl one.</Description>
<Archive sha1sum="d75915ec475952cb8f91b6c6625c94365a7fcace">http://search.cpan.org/CPAN/authors/id/S/SM/SMUELLER/ExtUtils-Typemap-1.00.tar.gz</Archive>
<BuildDependencies>
<Dependency>perl-Data-Dumper</Dependency>
<Dependency>perl-ExtUtils-MakeMaker</Dependency>
<Dependency>perl-File-Spec</Dependency>
<Dependency>perl-IO</Dependency>
</BuildDependencies>
</Source>
<Package>
<Name>perl-ExtUtils-typemap</Name>
<RuntimeDependencies>
<Dependency>perl-Data-Dumper</Dependency>
<Dependency>perl-ExtUtils-MakeMaker</Dependency>
<Dependency>perl-File-Spec</Dependency>
<Dependency>perl-IO</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib</Path>
<Path fileType="data">/usr/share/perl</Path>
<Path fileType="doc">/usr/share/doc</Path>
<Path fileType="man">/usr/share/man</Path>
</Files>
</Package>
<History>
<Update release="1">
<Date>2019-04-13</Date>
<Version>1.00</Version>
<Comment>First release</Comment>
<Name>Suleyman Poyraz</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update>
</History>
</INARY>
<?xml version="1.0" ?>
<INARY>
<Source>
<Name>perl-ExtUtils-Depends</Name>
<Summary xml:lang="tr">XS uzantılarına bağlı olan XS uzantılarını kolayca oluşturun</Summary>
<Description xml:lang="tr"> Bu modül, diğer perl uzantıları tarafından sağlanan işlevleri ve yazı tiplerini kullanan Perl uzantılarını oluşturmayı kolaylaştırmaya çalışır. Bu, bir perl uzantısının perl dışında bir C ve XS arayüzü de sağlayan paylaşılan bir kütüphane gibi ele alındığı anlamına gelir.</Description>
</Source>
</INARY>
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/copyleft/gpl.txt
from inary.actionsapi import get
from inary.actionsapi import autotools
from inary.actionsapi import inarytools
from inary.actionsapi import shelltools
def setup():
shelltools.system("sed 's:-D_BSD_SOURCE::' -i Makefile")
def build():
autotools.make("PREFIX=/usr INCLUDEDIR=include \
LIBDIR=lib COMPONENT_TYPE=lib-shared")
def install():
autotools.install('PREFIX=/usr \
INCLUDEDIR=include LIBDIR=lib \
COMPONENT_TYPE=lib-shared install')
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE INARY SYSTEM "https://raw.githubusercontent.com/Zaryob/inary/master/inary-spec.dtd">
<INARY>
<Source>
<Name>utf8proc</Name>
<Homepage>https://github.com/JuliaStrings/utf8proc/</Homepage>
<Packager>
<Name>Suleyman Poyraz</Name>
<Email>zaryob.dev@gmail.com</Email>
</Packager>
<IsA>library</IsA>
<License>GNU</License>
<PartOf>programming.library</PartOf>
<Summary>Provides useful functions commonly found on BSD systems</Summary>
<Description>This library provides useful functions commonly found on BSD systems, and lacking on others like GNU systems, thus making it easier to port projects with strong BSD origins, without needing to embed the same code over and over again on each project.</Description>
<Archive sha1sum="f3595df67a245e7f65d0a368a413898dc273d45e" >https://github.com/JuliaStrings/utf8proc/archive/v2.4.0.tar.gz</Archive>
</Source>
<Package>
<Name>utf8proc</Name>
<Files>
<Path fileType="library">/usr/lib</Path>
<Path fileType="library">/usr/include</Path>
<Path fileType="doc">/usr/share/doc</Path>
</Files>
</Package>
<History>
<Update release="1">
<Date>2019-04-12</Date>
<Version>2.4.0</Version>
<Comment>First release</Comment>
<Name>Suleyman Poyraz</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update>
</History>
</INARY>
from scom.service import *
serviceType = "server"
serviceDesc = _({"en": "GIT Server",
"tr": "GIT Sunucusu"})
serviceDefault = "off"
serviceConf = "git-daemon"
@synchronized
def start():
startService(command="/usr/bin/git",
args="daemon \
--base-path=/pub/scm \
--pid-file=/run/git-daemon.pid \
--user-path=public_git \
--detach \
--export-all \
--syslog \
--verbose %s" % config.get("GITDAEMON_OPTS"),
pidfile="/run/git-daemon.pid",
donotify=True)
@synchronized
def stop():
stopService(pidfile="/run/git-daemon.pid",
donotify=True)
def status():
return isServiceRunning("/run/git-daemon.pid")
......@@ -17,19 +17,11 @@ def setup():
shelltools.export("EXTRA_LDFLAGS", get.LDFLAGS())
autotools.configure("PYTHON=python2 \
--disable-static \
--with-jdk=/usr/lib/jvm/java-7-openjdk \
--enable-javahl \
--with-apr=/usr \
--with-apr-util=/usr \
--with-apache=/usr/lib/apache2/ \
--with-apxs \
--with-serf=/usr \
--with-sqlite=/usr \
--with-zlib=/usr \
--with-jikes=no \
--without-berkeley-db \
--disable-mod-activation")
--prefix=/usr \
--disable-static \
--with-apache-libexecdir \
--with-lz4=internal \
--with-utf8proc=internal")
inarytools.dosed("libtool"," -shared ", " -Wl,--as-needed -shared ")
......@@ -37,15 +29,11 @@ def build():
# svn
autotools.make()
# python bindings
autotools.make("swig-py")
autotools.make('LT_LDFLAGS="-L{}/usr/lib"'.format(get.installDIR()))
# perl bindings (needed by git-svn*)
# Sometimes parallel build breaks perl bindings
autotools.make("-j1 swig-pl")
autotools.make("swig_pydir=/usr/lib/python2.7/site-packages/libsvn \
swig_pydir_extra=/usr/lib/python2.7/site-packages/svnswig-py swig-pl swig-rb")
# java bindings
autotools.make("-j1 javahl")
def install():
# install svn
......@@ -58,7 +46,7 @@ def install():
autotools.rawInstall("DESTDIR=%s" % get.installDIR(), "install-swig-pl")
# install javahl
autotools.rawInstall("DESTDIR=%s" % get.installDIR(), "install-javahl")
#autotools.rawInstall("DESTDIR=%s" % get.installDIR(), "install-javahl")
# Move py/c'into proper dir
inarytools.domove("/usr/lib/svn-python/svn", "/usr/lib/%s/site-packages" % get.curPYTHON())
......
......@@ -2,7 +2,7 @@
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
def postInstall():
os.system("/bin/mkdir -p /var/svn/conf")
os.system("/usr/bin/svnadmin create /var/svn/repos")
......
......@@ -13,7 +13,7 @@
<IsA>service</IsA>
<Summary>A compelling replacement for CVS</Summary>
<Description>SVN is a version controlling system to store files and control their change history in a repository.</Description>
<Archive sha1sum="de406057b0a2201d4dddcd296020a2bbdc2c3833" type="tarbz2">http://archive.apache.org/dist/subversion/subversion-1.9.12.tar.bz2</Archive>
<Archive sha1sum="3815a2dcaf976b3b7371f9f5d83e537f8cb359b4">https://archive.apache.org/dist/subversion/subversion-1.13.0.tar.bz2</Archive>
<BuildDependencies>
<Dependency>apache</Dependency>
<Dependency>ruby-devel</Dependency>
......@@ -23,16 +23,8 @@
<Dependency>cyrus-sasl-devel</Dependency>
<Dependency>python-devel</Dependency>
<Dependency>swig</Dependency>
<Dependency>utf8proc</Dependency>
</BuildDependencies>
<Patches>
<!--Patch level="1">subversion.perl.LD_RUN_PATH.patch</Patch>
<Patch level="1">subversion-1.8.0-kwallet.patch</Patch>
<Patch level="1">subversion-1.8.0-pie.patch</Patch>
<Patch level="1">subversion-1.8.0-rpath.patch</Patch-->
<Patch level="1">subversion-swig-perl-install_vendor.patch</Patch>
<Patch>subversion.rpath.fix.patch</Patch>
<Patch level="1">dont_compile_pyc.patch</Patch>
</Patches>
</Source>
<Package>
......@@ -42,6 +34,7 @@
<Dependency>serf</Dependency>
<Dependency>apr-util</Dependency>
<Dependency>cyrus-sasl</Dependency>
<Dependency>utf8proc</Dependency>
<!--Dependency>libgnome-keyring</Dependency-->
</RuntimeDependencies>
<Files>
......@@ -68,10 +61,7 @@
<!-- system-wide configuration file for auto mimetype setting -->
<AdditionalFile owner="root" permission="0644" target="/etc/subversion/config">subversion.config</AdditionalFile>
</AdditionalFiles>
<Provides>
<SCOM script="service.py">System.Service</SCOM>
<SCOM script="package.py">System.Package</SCOM>
</Provides>
<IsA>postOps</IsA>
</Package>
<Package>
......@@ -108,12 +98,16 @@
<AdditionalFiles>
<AdditionalFile owner="root" permission="0644" target="/etc/apache2/modules.d/47_mod_dav_svn.conf">47_mod_dav_svn.conf</AdditionalFile>
</AdditionalFiles>
<Provides>
<SCOM script="package.py">System.Package</SCOM>
</Provides>
</Package>
<History>
<Update release="2">
<Date>2019-11-18</Date>
<Version>1.13.0</Version>
<Comment>postOps uyumluluğu</Comment>
<Name>Süleyman Poyraz</Name>
<Email>zaryob.dev@gmail.com</Email>
</Update>
<Update release="1">
<Date>2019-11-18</Date>
<Version>1.9.12</Version>
......
from scom.service import *
serviceType = "server"
serviceDesc = {"en": "SVN Server",
"tr": "SVN Sunucusu"}
serviceConf = "svnserve"
PIDFILE = "/var/svn/svnserve.pid"
# Note that "/etc/conf.d/svnserve" passes --root=/var/svn by default
@synchronized
def start():
startService(command="/usr/bin/svnserve",
args="--pid-file=%s %s" % (PIDFILE, config.get("SVNSERVE_OPTS")),
chuid="%s:%s" % (config.get("SVNSERVE_USER"), config.get("SVNSERVE_GROUP")),
donotify=True)
@synchronized
def stop():
stopService(pidfile=PIDFILE,
donotify=True)
def status():
return isServiceRunning(pidfile=PIDFILE)
# -*- coding: utf-8 -*-
from scom.service import *
serviceType = "server"
serviceDesc = {"en": "Secure Shell Server",
"tr": "Güvenli Kabuk Sunucusu"
}
MSG_ERR_NEEDCONF = {"en": "You need /etc/ssh/sshd_config to run sshd.",
"tr": "Sshd'yi çalıştırabilmek için /etc/ssh/sshd_config'e ihtiyaç var.",
}
PID_FILE = "/run/sshd.pid"
RSA1_KEY = "/etc/ssh/ssh_host_key"
RSA_KEY = "/etc/ssh/ssh_host_rsa_key"
DSA_KEY = "/etc/ssh/ssh_host_dsa_key"
def check_config():
import os
if not os.path.exists("/etc/ssh/sshd_config"):
fail(MSG_ERR_NEEDCONF)
if not os.path.exists(RSA1_KEY):
# Default is 2048 bits, and is considered sufficient.
run("/usr/bin/ssh-keygen", "-t", "rsa1",
"-f", "/etc/ssh/ssh_host_key", "-N", "")
if not os.path.exists(DSA_KEY):
run("/usr/bin/ssh-keygen", "-t", "dsa",
"-f", "/etc/ssh/ssh_host_dsa_key", "-N", "")
if not os.path.exists(RSA_KEY):
run("/usr/bin/ssh-keygen", "-t", "rsa",
"-f", "/etc/ssh/ssh_host_rsa_key", "-N", "")
@synchronized
def start():
check_config()
startService(command="/usr/sbin/sshd",
pidfile=PID_FILE,
donotify=True)
@synchronized
def stop():
stopService(pidfile=PID_FILE,
donotify=True)
def status():
return isServiceRunning(PID_FILE)
# -*- coding: utf-8 -*-
from scom.service import *
import os
serviceType = "local"
serviceDefault = "conditional"
serviceDesc = {"en": "Dhcp client",
"tr": "Dhcp istemcisi"}
MSG_BACKEND_WARNING = {
"en" : "dhcp is not enabled by default. You can change this from /etc/dhcpcd.conf.",
"tr" : "dhcp öntanımlı olarak etkin değil. /etc/dhcpcd.conf dosyasından bu ayarı değiştirebilirsiniz."
}
pidfile="/var/run/dhcpcd.pid"
USETHIS=eval(config.get("DEFAULT", "True"))
@synchronized
def start():
if not USETHIS:
fail(MSG_BACKEND_WARNING)
startService(command="/usr/bin/dhcpcd",
args="daemon -q -b %s" % pidfile,
donotify=True)
@synchronized
def stop():
stopService(command="/usr/bin/dhcpcd -x",
donotify=True)
try:
os.unlink(pidfile)
except:
pass
def ready():
if not USETHIS:
fail(MSG_BACKEND_WARNING)
else:
start()
def status():
return isServiceRunning(pidfile=pidfile)
#/usr/bin/python
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
if not os.path.exists("/var/lib/inary/package"):
os.system("mkdir /var/lib/inary/package")
os.system("mv /var/lib/inary/* /var/lib/inary/package/")
os.system("mv /var/lib/inary/package/scripts /var/lib/inary/")
def preRemove():
pass
def preRemove():
pass
import os
import subprocess
import time
import fcntl
class FileLock:
def __init__(self, filename):
self.filename = filename
self.fd = None
def lock(self, shared=False, timeout=-1):
_type = fcntl.LOCK_EX
if shared:
_type = fcntl.LOCK_SH
if timeout != -1:
_type |= fcntl.LOCK_NB
self.fd = os.open(self.filename, os.O_WRONLY | os.O_CREAT, 0o600)
if self.fd == -1:
raise IOError("Cannot create lock file")
while True:
try:
fcntl.flock(self.fd, _type)
return
except IOError:
if timeout > 0:
time.sleep(0.2)
timeout -= 0.2
else:
raise
def unlock(self):
fcntl.flock(self.fd, fcntl.LOCK_UN)
# Config
DIRECTORY_BLACKLIST = "/etc/modprobe.d"
MODULES_DIR = "/lib/modules"
MODULES_CONF = "/etc/modprobe.conf"
MODULES_CONF_DIR = "/etc/modules.d"
MODULES_AUTOLOAD = "/etc/modules.autoload.d/kernel-%s"
MODULES_BLACKLIST = "/etc/modprobe.d/blacklist-compat"
MODULES_SCOM_BLACKLIST = "/etc/modprobe.d/blacklist-scom"
TIMEOUT = 5.0
# l10n
FAIL_TIMEOUT = {
"en": "Request timed out. Try again later.",
"tr": "Talep zaman aşımına uğradı. Daha sonra tekrar deneyin.",
}
FAIL_VERSION = {
"en": "Invalid kernel version.",
"tr": "Geçersiz çekirdek sürümü.",
}
FAIL_PROBE = {
"en": "Unable to load module %s: %s",
"tr": "%s modülü yüklenemedi: %s",
}
FAIL_RMMOD = {
"en": "Unable to unload module %s: %s",
"tr": "%s modülü kaldırılamadı: %s",
}
FAIL_UPDATE = {
"en": "Unable to update modprobe.conf: %s",
"tr": "modprobe.conf güncellenemedi: %s",
}
# Utils
def majorVersion(kernel_version):
"""Parses kernel version and returns major revision."""
version = kernel_version.split(".")
if len(version) < 2:
fail(FAIL_VERSION)
return ".".join(version[0:2])
class Lock:
def __init__(self, _file, shared=False):
lockfile = os.path.join(os.path.dirname(_file), ".%s" % os.path.basename(_file))
try:
self.lock = FileLock(_file)
self.lock.lock(timeout=TIMEOUT, shared=shared)
except IOError:
fail(FAIL_TIMEOUT)
def release(self):
self.lock.unlock()
def listConfig(_file, prefix=None):
"""Parses given module configuration file and returns modules as a list."""
lock = Lock(_file, shared=True)
lines = []
for line in open(_file):
line = line.strip()
if line and not line.startswith("#"):
lines.append(line)
lock.release()
lines = [x.split("#")[0].strip() for x in lines]
if prefix:
lines = [x.replace(prefix, "") for x in lines if x.startswith(prefix)]
return lines
def editConfig(_file, add=[], remove=[], prefix=None):
"""Edits given module list file."""
lock = Lock(_file, shared=False)
newlines = []
if os.path.exists(_file):
for line in open(_file):
module = line.strip()
if prefix and prefix in module:
module = module.split(prefix)[1]
if module in remove:
continue
if module in add:
newlines.append("Added through SCOM")
newlines.append(module)
add.remove(module)
else:
newlines.append(module)
newlines.extend(add)
if prefix:
newlines = ["#Added through SCOM\n%s %s\n" % (prefix, x) for x in newlines if not x.startswith("#")]
open(_file, "w").write("\n".join(newlines))
lock.release()
# Boot.Modules methods
def listAvailable():
"""Returns a list of available modules on the system."""
modules = []
kernel_version = os.uname()[2]
path = os.path.join(MODULES_DIR, kernel_version)
if os.path.exists(path):
for root, dirs, files in os.walk(path):
for _file in files:
if _file.endswith(".ko"):
modname = _file[:-3]
modules.append(modname)
return modules
def listLoaded():
"""Returns loaded modules and their options."""
# Get loaded modules
modules = {}
for module in open("/proc/modules"):
modname = module.split()[0]
modules[modname] = ""
# Get options from modprobe.conf
lock = Lock(MODULES_CONF, shared=True)
for line in open(MODULES_CONF):
line = line.strip()
if line.startswith("options"):
try:
command, modname, arguments = line.split(" ", 2)
except ValueError:
continue
if modname in modules:
modules[modname] = arguments
lock.release()
# Build (module: options) list
list_modules = {}
for module, options in modules.iteritems():
list_modules[module] = options
return list_modules
def setOptions(module, options=""):
"""Sets module options."""
# Lock modprobe.conf
lock = Lock(MODULES_CONF, shared=False)
module_found = False
# Search for module's config file
for _file in os.listdir(MODULES_CONF_DIR):
_file = os.path.join(MODULES_CONF_DIR, _file)
newlines = []
for line in open(_file):
line = line.strip()
if line.startswith("options %s " % module):
if options:
newlines.append("options %s %s" % (module, options))
module_found = True
else:
newlines.append(line)
# Update config file
if module_found:
open(_file, "w").write("\n".join(newlines))
break
# Append module config to "/etc/modules.d/other"
if not module_found:
config_file = os.path.join(MODULES_CONF_DIR, "other")
open(config_file, "a").write("options %s %s" % (module, options))
# Release lock on modprobe.conf
lock.release()
# Update modprobe.conf
updateModules()
def load(module, options=""):
"""Loads given module with options."""
cmd = ["/sbin/modprobe", module]
if options:
cmd.extend(options.split())
pipe = subprocess.Popen(cmd, stderr=subprocess.PIPE)
if pipe.wait() != 0:
fail(FAIL_PROBE % (module, pipe.stderr.read()))
def unload(module):
"""Unloads given module name."""
cmd = ["/sbin/rmmod", module]
pipe = subprocess.Popen(cmd, stderr=subprocess.PIPE)
if pipe.wait() != 0:
fail(FAIL_RMMOD % (module, pipe.stderr.read()))
def listAutoload(kernel_version):
"""Lists specified kernel's autoload list."""
major_release = majorVersion(kernel_version)
modules_autoload = MODULES_AUTOLOAD % major_release
modules = []
if os.path.exists(modules_autoload):
modules = listConfig(modules_autoload)
else:
fail(FAIL_VERSION)
return modules
def addAutoload(module, kernel_version):
"""Adds module to specified kernel's autoload list."""
major_release = majorVersion(kernel_version)
modules_autoload = MODULES_AUTOLOAD % major_release
editConfig(modules_autoload, add=[module])
def removeAutoload(module, kernel_version):
"""Removes module from specified kernel's autoload list."""
major_release = majorVersion(kernel_version)
modules_autoload = MODULES_AUTOLOAD % major_release
if os.path.exists(modules_autoload):
editConfig(modules_autoload, remove=[module])
else:
fail(FAIL_VERSION)
def listBlacklist():
"""Lists blacklisted modules."""
modules = []
if os.path.exists(DIRECTORY_BLACKLIST):
for f in os.listdir(DIRECTORY_BLACKLIST):
modules.extend(listConfig(os.path.join(DIRECTORY_BLACKLIST, f), "blacklist "))
# Make the list unique as there may be some .newconfig in the directory
return list(set(modules))
def addBlacklist(module):
"""Adds a module to blacklist."""
editConfig(MODULES_BLACKLIST, add=[module], prefix="blacklist ")
def removeBlacklist(module):
"""Removes module from blacklist."""
editConfig(MODULES_BLACKLIST, remove=[module], prefix="blacklist ")
def updateModules(kernel_version=None):
"""Updates modprobe.conf"""
# Lock modprobe.conf
lock = Lock(MODULES_CONF, shared=False)
# Run update-modules
pipe = subprocess.Popen(["/sbin/update-modules"], stderr=subprocess.PIPE)
reply = pipe.wait()
# Release lock on modprobe.conf
lock.release()
# Return error message on failure
if reply != 0:
fail(FAIL_UPDATE % pipe.stderr.read())
# Run depmod if necessary
if kernel_version:
subprocess.call(["/sbin/depmod", "-a", kernel_version])
# -*- coding: utf-8 -*-
import inary.sxml.xmlext as xmlext
import subprocess
def domodules(filepath):
doc = xmlext.parse(filepath)
for item in xmlext.getAllNodes("File"):
path = xmlext.getNodeText(item,"Path")
if path.startswith("lib/modules/"):
kernelVersion = path.split("/")[2]
subprocess.call(["/sbin/depmod", "-a", kernelVersion])
return
def setupPackage(metapath, filepath):
domodules(filepath)
def cleanupPackage(metapath, filepath):
pass
def postCleanupPackage(metapath, filepath):
domodules(filepath)
# -*- coding: utf-8 -*-
import os
import inary.sxml.xmlext as xmlext
import subprocess
def doinfo(filepath, remove=False):
# install-info is broken with i18n :(
os.environ["LC_ALL"] = "C"
doc = xmlext.parse(filepath)
for item in xmlext.getAllNodes(doc, "File"):
path = xmlext.getNodeText(item, "Path")
if path.startswith("usr/share/info") and path.endswith((".info", ".info.gz")):
if remove:
subprocess.call(["install-info", "--delete", "/%s" % path, "/usr/share/info/dir"])
else:
subprocess.call(["install-info", "/%s" % path, "/usr/share/info/dir"])
def setupPackage(metapath, filepath):
doinfo(filepath)
def cleanupPackage(metapath, filepath):
doinfo(filepath, True)
def postCleanupPackage(metapath, filepath):
pass
......@@ -34,9 +34,6 @@
<Path fileType="data">/usr/share</Path>
<Path fileType="header">/usr/include/</Path>
</Files>
<Provides>
<SCOM script="postInstall.py">System.Package</SCOM>
</Provides>
</Package>
<History>
......
#!/usr/bin/env python3
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
os.system("rc-update add opentmpfiles-dev default")
os.system("rc-update add opentmpfiles-setup default")
# -*- coding: utf-8 -*-
import ciksemel
def updateIndex():
import os
import subprocess
join = os.path.join
fontsPath = "/usr/share/fonts"
encodingsPath = join(fontsPath, "encodings")
fontsScale = "fonts.scale"
fontsDir = "fonts.dir"
for root, dirs, files in os.walk(fontsPath):
if root.startswith(encodingsPath):
continue
fonts = files[:]
if fontsScale in fonts:
fonts.remove(fontsScale)
os.unlink(join(root, fontsScale))
if fontsDir in fonts:
fonts.remove(fontsDir)
os.unlink(join(root, fontsDir))
if not fonts:
continue
print("Creating %s ..." % join(root, fontsScale))
subprocess.call(["/usr/bin/mkfontscale", "-u", root])
print("Creating %s ..." % join(root, fontsDir))
subprocess.call(["/usr/bin/mkfontdir", root])
def checkPaths(filepath):
doc = ciksemel.parse(filepath)
for item in doc.tags("File"):
path = item.getTagData("Path")
if path.startswith("usr/share/fonts/"):
updateIndex()
break
def setupPackage(metapath, filepath):
checkPaths(filepath)
def cleanupPackage(metapath, filepath):
pass
def postCleanupPackage(metapath, filepath):
checkPaths(filepath)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment