diff options
author | Tomas Chvatal (scarabeus) <tomas.chvatal@gmail.com> | 2008-10-30 23:54:38 +0100 |
---|---|---|
committer | Tomas Chvatal (scarabeus) <tomas.chvatal@gmail.com> | 2008-10-30 23:54:38 +0100 |
commit | 417ca9f05458c7b4bfe3529de3cc8e7ae659c5ca (patch) | |
tree | eb4070cae0ef882c82a5efe089af96722706a155 /net-im/jabbim/files | |
parent | Initial commit (diff) | |
download | scarabeus-417ca9f05458c7b4bfe3529de3cc8e7ae659c5ca.tar.gz scarabeus-417ca9f05458c7b4bfe3529de3cc8e7ae659c5ca.tar.bz2 scarabeus-417ca9f05458c7b4bfe3529de3cc8e7ae659c5ca.zip |
Initial commit for my messy stuff.
Diffstat (limited to 'net-im/jabbim/files')
-rw-r--r-- | net-im/jabbim/files/0.4.3/Makefile | 66 | ||||
-rw-r--r-- | net-im/jabbim/files/0.4.3/install-files.py | 69 | ||||
-rw-r--r-- | net-im/jabbim/files/0.4.3/installation-blacklist | 22 | ||||
-rw-r--r-- | net-im/jabbim/files/0.4.3/jabbim.in | 3 |
4 files changed, 160 insertions, 0 deletions
diff --git a/net-im/jabbim/files/0.4.3/Makefile b/net-im/jabbim/files/0.4.3/Makefile new file mode 100644 index 0000000..7f57b89 --- /dev/null +++ b/net-im/jabbim/files/0.4.3/Makefile @@ -0,0 +1,66 @@ +# Hierarchy under which Jabbim can expect to be installed. +# Can be changed on the command line, eg.: +# make PREFIX=/usr +PREFIX = /usr/local + +# But you'd better leave these alone +bindir = $(PREFIX)/bin +datadir = $(PREFIX)/share +jabbimdata = $(datadir)/jabbim + +# Builds generated files +ts_files := $(shell find . -name '*.ts') +qm_files := $(ts_files:.ts=.qm) +build: $(qm_files) jabbim .configured-prefix + +.configured-prefix: jabbim + echo $(PREFIX) > .configured-prefix + +# Fills in the template for the starting script +jabbim: jabbim.in + sed -e "s|@JABBIMDATA@|$(jabbimdata)|g" $< > $@ + +%.qm: %.ts + lrelease-qt4 -compress $< -qm $@ + + +# Installs Jabbim into the system. +# DESTDIR is mainly useful for packagers. +# This variable can be overridden on the command line, eg.: +# make install DESTDIR=/var/tmp/buildroot +DESTDIR = + +configured_prefix = $(shell cat .configured-prefix) +inst_bindir = $(DESTDIR)$(configured_prefix)/bin +inst_datadir = $(DESTDIR)$(configured_prefix)/share +inst_jabbimdata = $(inst_datadir)/jabbim +.PHONY: install +install: build + @echo "configured prefix is $(configured_prefix)" + @[ -n "$(DESTDIR)" ] && echo "DESTDIR is $(DESTDIR)" ||: + @echo "installation bindir is $(inst_bindir)" + @echo "installation datadir is $(inst_datadir)" + @echo "installation jabbimdata is $(inst_jabbimdata)" + python install-files.py -v -b installation-blacklist . "$(inst_jabbimdata)" + @#cp -dR --preserve=mode,timestamps,context,links . "$(DESTDIR)$(inst_jabbimdata)" + install -D -p -m 755 jabbim "$(inst_bindir)/jabbim" + install -D -p -m 644 jabbim.desktop "$(inst_datadir)/applications/jabbim.desktop" + for i in 16 22 32 48 ; do \ + d="$(inst_datadir)/icons/hicolor/$${i}x$${i}/apps" ;\ + install -D -m 644 -p images/$${i}x$${i}/apps/jabbim.png "$$d/jabbim.png" ;\ + done + d="$(inst_datadir)/icons/hicolor/scalable/apps" ;\ + install -D -m 644 -p images/scalable/apps/jabbim.svg "$$d/jabbim.svg" + install -dm 755 $(inst_datadir)/pixmaps + pushd $(inst_datadir)/pixmaps ;\ + ln -sf ../icons/hicolor/48x48/apps/jabbim.png . ;\ + ln -sf ../icons/hicolor/scalable/apps/jabbim.svg . ;\ + popd + @echo Jabbim has been installed. + + +# Removes generated files +.PHONY: clean +clean: + find . \( -name '*.py[co]' -o -name '*.qm' \) -print0 | xargs -0 --no-run-if-empty rm + rm -f jabbim .configured-prefix diff --git a/net-im/jabbim/files/0.4.3/install-files.py b/net-im/jabbim/files/0.4.3/install-files.py new file mode 100644 index 0000000..d5e7278 --- /dev/null +++ b/net-im/jabbim/files/0.4.3/install-files.py @@ -0,0 +1,69 @@ +import re, os +import shutil +from optparse import OptionParser + +parser = OptionParser(usage="usage: %prog [options] srcdir destdir") +parser.add_option("-b", "--blacklist", dest="blacklist", + help="skip files matching a regexp from FILE", metavar="FILE") +parser.add_option("-v", "--verbose", dest="verbose", action="store_true", + default=False, help="print messages about files being copied") +(options, args) = parser.parse_args() + +if len(args) != 2: + parser.error("Incorrect number of arguments") + +(srcdir, destdir) = args + +black_re = None +if options.blacklist != None: + blacklist = [] + f = open(options.blacklist, 'r') + for l in f.readlines(): + if l.startswith('#'): + continue + blacklist.append('(' + l.rstrip() + ')') + f.close() + black_re = re.compile('\./(' + '|'.join(blacklist) + ')$') + +def mk_filter(regex): + if not regex: + def does_not_match(p): + return True + else: + def does_not_match(p): + return not regex.match(p) + return does_not_match + +passes_blacklist = mk_filter(black_re) + +def errwalk(err): + raise err + +os.chdir(srcdir) + +for root, dirs, files in os.walk('.', topdown=True, onerror=errwalk): + destroot = os.path.join(destdir, root) + if options.verbose: + print "Creating %s" % destroot + try: + os.makedirs(destroot, 0755) + except OSError, e: + # only "file exists" is ok + if e.errno != 17: + raise e + + # prevent descending into blacklisted dirs + fullpaths = [os.path.join(root,d) for d in dirs] + fullpaths = filter(passes_blacklist, fullpaths) + del dirs[:] # dirs must be edited in-place + dirs.extend([ p[p.rindex('/')+1:] for p in fullpaths ]) + + # copy files + fullpaths = [os.path.join(root,f) for f in files] + fullpaths = filter(passes_blacklist, fullpaths) + for f in fullpaths: + destfile = os.path.join(destroot, f[f.rindex('/')+1:]) + if options.verbose: + print "Installing %s" % destfile + shutil.copy2(f, destfile) + os.chmod(destfile, 0644) diff --git a/net-im/jabbim/files/0.4.3/installation-blacklist b/net-im/jabbim/files/0.4.3/installation-blacklist new file mode 100644 index 0000000..ff6e9be --- /dev/null +++ b/net-im/jabbim/files/0.4.3/installation-blacklist @@ -0,0 +1,22 @@ +# This file contains regexps for files which are NOT to be installed into +# /usr/share/jabbim by 'make install' +# The whole relative path is matched against them and it must match exactly +# (imagine a $ at the end of every regex here) +.*\.py[co] +.*\.pro +.*\.orig +epydoc.cfg +(gui-)?test.py +installation-blacklist +install-files.py +jabbim +jabbim.(desktop|in|sh) +ui2py.py +AUTHORS +COPYING +Makefile +# dot-files and directories (catches .svn and .git directories): +(.*/)?\..* +# qm files suffice for end use: +locales/[^/]+\.ts +plugins/[^/]+/[^/]+\.ts diff --git a/net-im/jabbim/files/0.4.3/jabbim.in b/net-im/jabbim/files/0.4.3/jabbim.in new file mode 100644 index 0000000..4c32146 --- /dev/null +++ b/net-im/jabbim/files/0.4.3/jabbim.in @@ -0,0 +1,3 @@ +#!/bin/sh +cd "@JABBIMDATA@" +exec python -OO jabbim.py $@ |