sapgui-package-0.0.10/0000755000000000000000000000000011433154403011335 5ustar sapgui-package-0.0.10/debian/0000755000000000000000000000000011433154374012566 5ustar sapgui-package-0.0.10/debian/copyright0000644000000000000000000000204411131655415014516 0ustar This is sapgui-package maintained by Guido Günther . The original source can always be found at: http://honk.sigxcpu.org/git/sapgui.git Copyright: Copyright (C) 2009 Guido Günther License: This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. sapgui-package-0.0.10/debian/control0000644000000000000000000000136711433154136014174 0ustar Source: sapgui-package Section: contrib/misc Priority: extra Maintainer: Guido Günther Build-Depends: cdbs, debhelper (>= 7), python, python-support Standards-Version: 3.8.4 VCS-Git: http://honk.sigxcpu.org/git/sapgui-package.git VCS-Browser: http://git.debian.org/?p=users/agx/sapgui-package.git Homepage: https://honk.sigxcpu.org/piki/projects/sapgui-package/ Package: sapgui-package Architecture: all Depends: cdbs, fakeroot, dpkg-dev, openjdk-6-jre | java5-runtime, python, ${misc:Depends}, ${python:Depends} Description: utility to build SAP GUI related Debian packages This package provides the capability to create a Debian package for the Platinum Java SAP GUI from the provided JAR by just running 'make-sgpkg '. sapgui-package-0.0.10/debian/changelog0000644000000000000000000000626511433154374014451 0ustar sapgui-package (0.0.10) unstable; urgency=low * [141c775] Work around libstdc++.so.5 needed on amd64 * [0755ff4] Remove tempfile the SAP developers left for us introduced in 7.20rev3 * [d081e33] Move the packages needed to build the sapgui package as build-deps to the generated sapgui source package instead of depending on it directly. This way sapgui-package sapgui-package can be arch all. -- Guido Günther Thu, 19 Aug 2010 09:10:29 +0200 sapgui-package (0.0.9) unstable; urgency=low * [7f9cbe0] Catch file write errors * [ab68fb8] Add desktop file * [c306033] Amd64 needs libstdc++5 for libGnomeConnect64.so -- Guido Günther Mon, 22 Feb 2010 14:49:14 +0100 sapgui-package (0.0.8) unstable; urgency=low * Tested with PlatinGUI-Linux-720.jar * [a169e6d] Make glob call more robust * [375763f] Add --no-clean option to ease debugging. * [0fa8223] Depend on java6-runtime instead of java2-run since sapgui as of 7.20 needs Java 6. * [57a1357] Exclude 32bit binaries when calling dh_shlibdeps when building on amd64. -- Guido Günther Thu, 18 Feb 2010 17:49:13 +0100 sapgui-package (0.0.7) unstable; urgency=low * [9a9f4a6] Bump standards version * [b7b4115] Fix dpkg-dev dependency -- Guido Günther Wed, 17 Feb 2010 06:12:23 +0100 sapgui-package (0.0.6) unstable; urgency=low * [1c2e7c0] Fix version parsing for Sapgui 720 * [94eb78c] Exclude 64bit libs on 32bit build and vice versa * [dcc6a23] Handle package build errors. * [d8ef7ea] Abort if running as root or under fakeroot. Running as root is unsafe and we invoke fakeroot ourselfes. * [6a27a5e] Explicitly depend on dpkg-buildpackage to make Ubuntu happy. -- Guido Günther Tue, 16 Feb 2010 21:37:42 +0100 sapgui-package (0.0.5) unstable; urgency=low * [8797132] depend on openjdk-jre to add a non virtual dependency for the jre -- Guido Günther Wed, 22 Jul 2009 16:39:03 +0200 sapgui-package (0.0.4) unstable; urgency=low * [4616690] link icons to hicolor theme * [bf29ac3] add Homepage: URL * [41c0d9d] bump standards version and add ${misc:Depends} and explicit python dependency to avoid lintian warnings. -- Guido Günther Tue, 14 Apr 2009 13:37:31 +0200 sapgui-package (0.0.3) unstable; urgency=low * [4307afa] fix build for amd64 since the package is built against ia32 libs we need to exclude some files from the shlibdeps call. * [a632da0] ignore unlink errors * many thanks to Jan Hauss for feedback and testing -- Guido Günther Wed, 01 Apr 2009 10:36:10 +0200 sapgui-package (0.0.2) unstable; urgency=low * [1a62f44] add vcs-browser * [abfeb3c] use another dir level and copy back the result * [838d108] don't depend on a virtual package only * [8ff8fb8] add missing deps -- Guido Günther Mon, 12 Jan 2009 18:07:36 +0100 sapgui-package (0.0.1) unstable; urgency=low * Initial Release, inspired by java-package, installation commandline taken from Matthias Schmitz's non public sapgui package. -- Guido Günther Thu, 08 Jan 2009 18:54:30 +0100 sapgui-package-0.0.10/debian/install0000644000000000000000000000002511131655415014151 0ustar make-sgpkg /usr/bin/ sapgui-package-0.0.10/debian/pycompat0000644000000000000000000000000211131655415014332 0ustar 2 sapgui-package-0.0.10/debian/compat0000644000000000000000000000000211131655415013761 0ustar 7 sapgui-package-0.0.10/debian/rules0000755000000000000000000000054211131655415013644 0ustar #!/usr/bin/make -f VERSION := $(shell head -n 1 $(CURDIR)/debian/changelog | sed 's/.*(//;s/).*//') DEB_PYTHON_SYSTEM = pysupport include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/python-distutils.mk configure/sapgui-package:: sed s/@VERSION@/$(VERSION)/ make-sgpkg.py > make-sgpkg clean:: rm -f make-sgpkg rm -rf build sapgui-package-0.0.10/make-sgpkg.py0000644000000000000000000002403111433154131013733 0ustar #!/usr/bin/python -u # vim: set fileencoding=utf-8 : # # (C) 2009 Guido Guenther # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # """build a sapgui debian package""" import glob import os import re import shutil import subprocess import sys import tempfile from email.Utils import formatdate from optparse import OptionParser verbose = False properties = "~/.platin.properties" class SapGuiPkgError(Exception): pass def extract_sapgui_jar(jar, destdir): cmd = [ "java", "-jar", "%s" % jar, "install", "-disableui", "-noshortcuts", "-silent", "-automatic", "-installdir", "%s/usr/lib/sapgui" % destdir ] if verbose: print " ".join(cmd) ret = subprocess.call(cmd) if ret: raise SapGuiPkgError, "Error extracting jar" def write_file(debdir, name, contents): try: f = file(os.path.join(debdir, name), 'w') f.write(contents) f.close() except IOError, msg: raise SapGuiPkgError, "Error writing file '%s': %s" % (name, msg) def get_version(destdir): dir = None try: dir = glob.glob(os.path.join(destdir, 'usr/lib/sapgui/SAPGUI*.*'))[0] version = os.path.basename(dir)[6:] except IndexError: raise SapGuiPkgError, "Cannot determin version number from subdir '%s'" % dir if not re.match("[0-9\.](rev[0-9]+)?", version): raise SapGuiPkgError, "Cannot determin version number from '%s'" % version return version def gen_changelog(debiandir, version, name, email, sg_version): date = formatdate(localtime=True) contents="""sapgui (%(sg_version)s) unstable; urgency=low * This package was created with sap-gui-package %(version)s. -- %(name)s <%(email)s> %(date)s """ % dict(version=version, name=name, email=email, date=date, sg_version=sg_version) write_file(debiandir, "changelog", contents) def gen_control(debiandir, version, name, email): contents = """Source: sapgui Section: non-free/devel Priority: optional Maintainer: %(name)s <%(email)s> Build-Depends: debhelper (>= 4.0.0), libxext6, libxpm4, libxt6, libxp6, libgnomevfs2-0 [i386], libbonobo2-0 [i386], kdelibs4c2a [i386], ia32-libs [amd64] Standards-Version: 3.8.0 Package: sapgui Architecture: i386 amd64 Depends: ${shlibs:Depends}, openjdk-6-jre | sun-java6-bin | java6-runtime Recommends: libstdc++5 [amd64] Description: SAP GUI for the Java Environment This package has been automatically created with sapgui-package %(version)s """ % dict(name=name, email=email, version=version) write_file(debiandir, "control", contents) def gen_copyright(debiandir): contents = """For copyright information please look at /usr/share/doc/sapgui/doc/license/ """ write_file(debiandir, "copyright", contents) def gen_install(debiandir): contents = "dest/usr/* usr/" write_file(debiandir, "install", contents) def gen_rules(debiandir, arch): if arch == "amd64": # ignore 32bit libs on amd64 excludes = [ "libGnomeConnect.so", "libJPlatin.so" ] # exclude 32bit binaries excludes += [ "bin/sapftp", "bin/saphttp" ] # these were additionally shipped with 719: excludes += [ "libKde3Connect.so" ] # This one needs libstdc++.so.5 which isn't available in recent # distros and not everybody needs it excludes += [ "libGnomeConnect64.so" ] else: # ignore 64bit libs on i386 excludes = [ "libGnomeConnect64.so", "libJPlatin64.so" ] ignore_libs = " ".join([ "--exclude=%s" % e for e in excludes ]) contents = """#!/usr/bin/make -f export DH_COMPAT=5 DEB_DH_STRIP_ARGS=nostrip DEB_DH_SHLIBDEPS_ARGS_ALL=%s -- --warnings=1 include /usr/share/cdbs/1/rules/debhelper.mk install/sapgui:: rm -rf dest/usr/lib/sapgui/SAPGUI sed -i '/doc\/install\/install\.htm~/d' dest/usr/lib/sapgui/*/install.db """ % ignore_libs write_file(debiandir, "rules", contents) os.chmod(os.path.join(debiandir,"rules"), 0755) def gen_links(debiandir, version): contents = """usr/lib/sapgui/SAPGUI%(version)s/doc usr/share/doc/sapgui/doc usr/lib/sapgui/SAPGUI%(version)s/bin/guilogon usr/bin/sapguilogon usr/lib/sapgui/SAPGUI%(version)s/bin/guistart usr/bin/sapguistart usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/128x128/apps/guilogon.png /usr/share/icons/hicolor/128x128/apps/guilogon.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/128x128/apps/SAPClients.png /usr/share/icons/hicolor/128x128/apps/SAPClients.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/64x64/apps/guilogon.png /usr/share/icons/hicolor/64x64/apps/guilogon.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/64x64/apps/SAPClients.png /usr/share/icons/hicolor/64x64/apps/SAPClients.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/48x48/apps/guilogon.png /usr/share/icons/hicolor/48x48/apps/guilogon.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/48x48/apps/SAPClients.png /usr/share/icons/hicolor/48x48/apps/SAPClients.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/32x32/apps/guilogon.png /usr/share/icons/hicolor/32x32/apps/guilogon.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/32x32/apps/SAPClients.png /usr/share/icons/hicolor/32x32/apps/SAPClients.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/22x22/apps/guilogon.png /usr/share/icons/hicolor/22x22/apps/guilogon.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/22x22/apps/SAPClients.png /usr/share/icons/hicolor/22x22/apps/SAPClients.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/16x16/apps/guilogon.png /usr/share/icons/hicolor/16x16/apps/guilogon.png usr/lib/sapgui/SAPGUI%(version)s/inst/hicolor/16x16/apps/SAPClients.png /usr/share/icons/hicolor/16x16/apps/SAPClients.png """ % dict(version=version) write_file(debiandir, "links", contents) def gen_desktop(destdir): applications = 'usr/share/applications/' contents = """[Desktop Entry] Version=1.0 Type=Application Name=SAP GUI Logon Exec=sapguilogon Icon=guilogon """ os.makedirs(os.path.join(destdir, applications)) write_file(destdir, os.path.join(applications, "sapguilogon.desktop"), contents) def build_sapgui_deb(tmpdir): curdir = os.path.abspath(os.path.curdir) build_cmd = ["fakeroot", "dpkg-buildpackage", "-b" ,"-uc", "-us"] os.chdir(tmpdir) try: ret = subprocess.call(build_cmd) except OSError, msg: raise SapGuiPkgError, "Cannot run '%s': %s" % (" ".join(build_cmd), msg) if ret: raise SapGuiPkgError, "Error building package." os.chdir(curdir) def main(argv): tmpdir = None ret = 1 version = "@VERSION@" global verbose prog = os.path.basename(argv[0]) parser = OptionParser(prog=prog, usage='%prog [options] /path/to/sapgui.jar', version="%prog " + version) parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") parser.add_option("--maintainer", default="Guido Günther", help="full name used in the maintainer field of the package") parser.add_option("--email", default="agx@sigxpcu.org", help="email address used in the maintainer field of the package") parser.add_option("--no-clean", action="store_false", dest="clean", default=True, help="don't cleanup after build") (options, args) = parser.parse_args(argv[1:]) verbose = options.verbose if os.getuid() == 0: print >>sys.stderr, "Don't run %s as root." % argv[0] sys.exit(1) if os.path.exists(os.path.expanduser(properties)): print >>sys.stderr, "%s exists - this can cause problems. Please remove the file first." % properties sys.exit(1) try: if len(args) != 1: raise SapGuiPkgError, "No jar given try '%s --help'" % prog else: jar = args[0] tmpdir = tempfile.mkdtemp(prefix=prog) pkgdir = os.path.join(tmpdir, "sapgui-java") destdir = os.path.join(pkgdir, 'dest') debiandir = os.path.join(pkgdir, 'debian') os.mkdir(pkgdir) os.mkdir(debiandir) print "Extracting '%s' to '%s'" % (jar, destdir) extract_sapgui_jar(jar, destdir) arch = os.popen("dpkg-architecture -qDEB_BUILD_ARCH").readlines()[0].strip() sg_version = get_version(destdir) pkg = "sapgui_%s_%s.deb" % (sg_version, arch) gen_changelog(debiandir, version, options.maintainer, options.email, sg_version) gen_control(debiandir, version, options.maintainer, options.email) gen_rules(debiandir, arch) gen_install(debiandir) gen_copyright(debiandir) gen_links(debiandir, sg_version) gen_desktop(destdir) print "Building Debain package at '%s'" % pkgdir build_sapgui_deb(pkgdir) result = os.path.abspath(os.path.join(tmpdir, pkg)) shutil.move(result, os.path.curdir) except SapGuiPkgError, msg: print >>sys.stderr, msg else: print "Created '%s'" % pkg ret = 0 if tmpdir and options.clean: if verbose: print "Cleaning up tempdir at %s" % tmpdir shutil.rmtree(tmpdir) try: os.stat(os.path.expanduser(properties)) os.unlink(os.path.expanduser(properties)) except OSError: pass # ignore missing file or unlink error return ret if __name__ == "__main__": sys.exit(main(sys.argv)) # vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: sapgui-package-0.0.10/setup.py0000644000000000000000000000176111131656044013057 0ustar #!/usr/bin/python # Copyright (C) 2006,2007 Guido Guenther # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # END OF COPYRIGHT # from distutils.core import setup setup(name = "sapgui_package", author = 'Guido Guenther', author_email = 'agx@sigxcpu.org', scripts = [ 'make-sgpkg' ], )