app-manager/plover-applications*.pnm
app-manager/24x24
app-manager/48x48
+plover-open/resources.rc
+plover-open/plover-open
+plover-open/application-x-redhat-package-manager.svg
+plover-open/mimetypes-application-x-rpm*.pgm
+plover-open/mimetypes-application-x-rpm*.pnm
+plover-open/24x24
+plover-open/48x48
-SUBDIRS=plover setup update pre-inst plover-gtk app-manager
+SUBDIRS=plover setup update pre-inst plover-gtk app-manager plover-open
pre-inst/resources.rc
app-manager/Makefile
app-manager/resources.rc
+plover-open/Makefile
+plover-open/resources.rc
])
PLOVER_MSWIN_MANIFEST([setup/setup.exe.manifest:setup/manifest.xml.in
update/update.exe.manifest:update/manifest.xml.in
pre-inst/pre-inst.exe.manifest:pre-inst/manifest.xml.in
app-manager/app-manager.exe.manifest:app-manager/manifest.xml.in
+plover-open/plover-open.exe.manifest:plover-open/manifest.xml.in
])
AM_INIT_AUTOMAKE(no-define)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
--- /dev/null
+AM_CFLAGS=$(GUI_CFLAGS) -g -DPLOVER_DATADIR=\""$(pkgdatadir)"\" -I$(top_srcdir)
+LDADD=../plover/libplover.la ../plover-gtk/libplover-gtk.la $(GUI_LIBS)
+
+bin_PROGRAMS=plover-open
+plover_open_SOURCES=plover-open.c
+if HAVE_WINDRES
+plover_open_SOURCES+=resources.rc plover-open.exe.manifest
+endif
+nodist_plover_open_SOURCES=icons.h
+if PLOVER_MINGW
+plover_open_LDFLAGS=-mwindows
+endif
+scaleabledir=$(datadir)/icons/hicolor/scalable/mimetypes
+scaleable_DATA=application-x-redhat-package-manager.svg
+smallicondir=$(datadir)/icons/hicolor/24x24/mimetypes
+smallicon_DATA=24x24/application-x-redhat-package-manager.png
+bigicondir=$(datadir)/icons/hicolor/48x48/mimetypes
+bigicon_DATA=48x48/application-x-redhat-package-manager.png
+
+# PLOVER_V_SKIP: Don't echo anything for this command if V=0
+PLOVER_V_SKIP = $(PLOVER_V_SKIP_$(V))
+PLOVER_V_SKIP_ = $(PLOVER_V_SKIP_$(AM_DEFAULT_VERBOSITY))
+PLOVER_V_SKIP_0 = @
+
+.rc.$(OBJEXT):
+ $(AM_V_GEN)$(WINDRES) $< $@
+
+resources.$(OBJEXT): plover-open.exe.manifest plover-open.ico
+
+.png.pnm:
+ pngtopnm $< | pnmquant 256 > $@
+
+mimetypes-application-x-rpm%.pnm: mimetypes-application-x-rpm.svg
+ $(PLOVER_V_SKIP)rsvg -w $* -h $* -f png $< temp.png
+ $(AM_V_GEN)pngtopnm temp.png | pnmquant -quiet 256 > $@
+ $(PLOVER_V_SKIP)$(RM) temp.png
+
+mimetypes-application-x-rpm%.pgm: mimetypes-application-x-rpm.svg
+ $(PLOVER_V_SKIP)rsvg -w $* -h $* -f png $< temp.png
+ $(AM_V_GEN)pngtopnm -alpha temp.png > $@
+ $(PLOVER_V_SKIP)$(RM) temp.png
+
+24x24/application-x-redhat-package-manager.png: mimetypes-application-x-rpm.svg
+ $(PLOVER_V_SKIP)mkdir -p 24x24
+ $(AM_V_GEN)rsvg -w 24 -h 24 -f png $< $@
+
+48x48/application-x-redhat-package-manager.png: mimetypes-application-x-rpm.svg
+ $(PLOVER_V_SKIP)mkdir -p 48x48
+ $(AM_V_GEN)rsvg -w 48 -h 48 -f png $< $@
+
+plover-open.ico: mimetypes-application-x-rpm16.pnm \
+ mimetypes-application-x-rpm16.pgm \
+ mimetypes-application-x-rpm22.pnm \
+ mimetypes-application-x-rpm22.pgm \
+ mimetypes-application-x-rpm32.pnm \
+ mimetypes-application-x-rpm32.pgm \
+ mimetypes-application-x-rpm46.pnm \
+ mimetypes-application-x-rpm46.pgm
+ $(AM_V_GEN)ppmtowinicon -andpgms -output=$@ $^
+
+clean-local:
+ -rm -rf 24x24 48x48
+
+application-x-redhat-package-manager.svg: mimetypes-application-x-rpm.svg
+ $(AM_V_GEN)cp $< $@
+
+EXTRA_DIST=mimetypes-application-x-rpm.svg
--- /dev/null
+changequote([,])dnl
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity
+ version="@PLOVER_MAJOR_VERSION@.@PLOVER_MINOR_VERSION@.@PLOVER_MICRO_VERSION@.0"
+ name="The plover development team.plover.plover-open" type="win32"
+ processorArchitecture="ifelse([@HOST_CPU@],[x86_64],[ia64],[x86])" />
+ <description>Package Handler</description>
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!-- Windows 7 functionality -->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ </application>
+ </compatibility>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="920" height="537.35999" viewBox="0 0 640 409" version="1.0" id="svg2" sodipodi:version="0.32" inkscape:version="0.45.1" sodipodi:docname="RPM_Logo.svg" sodipodi:docbase="/home/butze/Desktop" inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata id="metadata43">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview inkscape:window-height="752" inkscape:window-width="1280" inkscape:pageshadow="2" inkscape:pageopacity="0.0" guidetolerance="10.0" gridtolerance="10.0" objecttolerance="10.0" borderopacity="1.0" bordercolor="#666666" pagecolor="#ffffff" id="base" width="920px" height="537.36px" inkscape:zoom="0.58998608" inkscape:cx="689.80903" inkscape:cy="89.005306" inkscape:window-x="0" inkscape:window-y="25" inkscape:current-layer="svg2"/>
+ <defs id="defs4">
+ <clipPath id="clip0">
+ <rect width="640" height="409" id="rect7" x="0" y="0"/>
+ </clipPath>
+ </defs>
+ <g id="g2211" transform="matrix(1.1106234,0,0,1.1106234,-37.666982,-15.952596)">
+ <path style="fill:#000000;fill-rule:nonzero;stroke:none" d="M 242.1304,26.136154 C 254.70415,24.204163 267.38588,22.791809 280.0975,22.122498 C 282.35576,21.584457 284.69162,21.694412 286.99869,21.611954 C 305.03506,21.036636 323.09628,21.062668 341.12505,21.874893 C 373.66519,24.176361 406.04054,29.582169 437.43091,38.593475 L 437.29799,38.769745 C 432.69597,44.993652 428.08047,51.207764 423.56764,57.495636 C 422.21545,57.745117 421.03183,56.889877 419.8275,56.459152 C 396.0118,46.631683 370.66049,40.927002 345.14435,37.839966 C 303.17429,33.542038 260.20618,36.9953 219.94295,49.910034 C 190.29894,59.497772 161.67183,74.281876 139.5663,96.576553 C 123.90071,112.59686 111.87303,133.32129 110.24046,156.02855 C 108.72133,166.85004 111.31233,177.65282 113.60428,188.15413 L 14.185699,205.68005 C 13.945419,188.13843 18.523071,170.78329 25.80806,154.91394 C 40.297989,124.01501 65.424713,99.327652 93.421997,80.42572 C 112.35318,67.714981 132.81692,57.345383 154.07152,49.122925 C 182.38751,38.052567 212.05559,30.488739 242.1304,26.136154 z " id="path16" sodipodi:nodetypes="cccccccccccccccccc"/>
+ <path style="fill:#d72123;fill-rule:nonzero;stroke:none" d="M 423.56764,57.495636 C 428.08047,51.207764 432.69597,44.993652 437.29799,38.769745 C 479.44521,51.113983 520.14622,70.606537 553.3929,99.651688 C 566.98732,111.82498 579.28281,125.5966 588.72606,141.2652 C 599.90866,159.70456 606.9949,180.82132 607.75311,202.45526 C 574.69661,196.67767 541.64931,190.8508 508.59731,185.05354 C 512.66524,172.11536 512.69997,158.02864 509.91435,144.82548 C 504.75171,122.00699 490.12285,102.41544 472.47707,87.543396 C 457.76711,75.165924 440.98531,65.246307 423.20515,57.986771 L 423.56764,57.495636 z " id="path20"/>
+ <path style="fill:#000000;fill-rule:nonzero;stroke:none" d="M 301.70334,148.63515 C 303.64912,145.46657 307.07517,142.93918 310.97199,143.40828 C 315.37659,143.52095 318.77077,147.16072 319.68323,151.27986 L 630.43405,206.55775 L 629.39653,211.76382 L 318.71321,157.28287 C 316.23477,161.59503 310.48546,163.82207 305.96864,161.27567 C 302.83719,159.90678 301.76889,156.55594 300.35561,153.74454 L 281.22589,150.67943 L 282.1028,145.29814 L 301.70334,148.63515 z " id="path24" sodipodi:nodetypes="ccccccccccc"/>
+ <path style="fill:#000000;fill-rule:nonzero;stroke:none" d="M 13.649231,221.30466 C 31.911636,221.18204 50.175491,221.28207 68.438629,221.25369 C 68.456711,221.93039 68.492889,223.28377 68.510971,223.96046 C 81.78093,221.07069 95.419388,219.84172 108.99162,220.5909 C 118.87418,221.49564 127.94777,225.73082 136.78575,229.935 C 126.82282,236.09672 116.68483,242.03085 106.96231,248.55022 C 96.128143,240.18365 81.403198,240.17624 68.768494,243.83687 C 68.610809,245.18874 68.46254,246.54526 68.449081,247.91402 C 68.455475,279.35362 68.464249,310.79379 68.445374,342.23402 C 50.189575,342.2283 31.934006,342.25079 13.678345,342.22247 C 13.639542,301.91635 13.697601,261.61043 13.649231,221.30466 z " id="path28"/>
+ <path style="fill:#000000;fill-rule:nonzero;stroke:none" d="M 155.75305,221.30997 C 171.83302,221.17448 187.91509,221.28622 203.99635,221.25278 C 227.82829,221.11749 252.05051,224.18929 274.19963,233.35588 C 287.95595,239.18071 301.26196,247.78787 309.23721,260.74647 C 315.29393,270.81277 317.41153,283.73701 312.65695,294.75125 C 307.0757,307.96501 295.12288,317.12689 282.95689,323.97429 C 260.65492,335.90702 235.86864,342.25136 210.64117,343.31628 L 210.59746,368.24727 L 155.74669,375.7715 L 155.75305,221.30997 z " id="path32" sodipodi:nodetypes="cccccccccc"/>
+ <path style="fill:#000000;fill-rule:nonzero;stroke:none" d="M 350.73776,221.33231 C 413.49503,221.14064 476.25624,221.30894 539.01537,221.24805 C 557.37595,221.32402 576.04198,221.44025 593.90257,226.18999 C 599.04286,227.88318 605.89815,229.89665 607.2502,235.8717 C 607.38423,271.32356 607.30022,306.78361 607.29105,342.23883 C 589.0249,342.23503 570.75967,342.22754 552.49496,342.24268 C 552.491,307.06375 552.41933,271.88358 552.53064,236.70589 C 549.2124,233.82698 544.4819,233.9498 540.36195,233.44704 C 529.09674,233.15378 517.8225,233.36302 506.55541,233.33128 C 506.55789,269.63435 506.59598,305.9377 506.53635,342.24097 C 488.24435,342.22391 469.95316,342.24573 451.66232,342.22978 C 451.60817,313.15071 451.65422,284.07179 451.63918,254.99307 C 451.49283,248.63887 451.95763,242.26082 451.36241,235.92719 C 446.21605,233.7641 440.57843,233.3403 435.06027,233.31384 C 425.26251,233.29803 415.46587,233.32082 405.66998,233.30383 C 405.62199,269.61919 405.72909,305.93532 405.6163,342.25056 C 388.39282,342.22855 371.16965,342.21668 353.94728,342.25768 L 350.62976,342.24453 C 350.91312,302.16914 350.6976,261.41138 350.73776,221.33231 z " id="path36" sodipodi:nodetypes="ccccccccccccccccccc"/>
+ <path style="fill:#ffffff;fill-rule:nonzero;stroke:none" d="M 210.67975,234.60013 C 224.72664,236.0097 237.42445,243.94724 247.01939,253.99116 C 255.2939,262.69374 261.14288,274.83727 259.12215,287.06798 C 256.91338,299.32082 248.38773,309.27431 238.80063,316.6837 C 230.47391,322.79636 221.05751,328.07289 210.67726,329.45604 C 210.64148,297.8373 210.6366,266.21844 210.67975,234.60013 z " id="path40"/>
+ </g>
+</svg>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (C) 2014 J. Ali Harlow <ali@juiblex.co.uk>
+ *
+ * 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include <stdlib.h>
+#include <string.h>
+#ifdef WIN32
+#include <windows.h>
+#endif /* WIN32 */
+#include <lua.h>
+#include <glib.h>
+#include <gio/gio.h>
+#include <gtk/gtk.h>
+#include <whelk/whelk.h>
+#include <plover/plover.h>
+#include <plover/package.h>
+#include <plover/packageset.h>
+#include <plover-gtk/transactionhelper.h>
+#include <plover-gtk/stockicons.h>
+
+LUALIB_API int luaopen_posix(lua_State *L);
+
+#define LOGO_NAME "application-x-redhat-package-manager"
+
+gboolean install(PloverPackageSet *installed,const char *path)
+{
+ gchar *s;
+ const char *prefix,*name,*unsatisfied;
+ const char *filenames[2];
+ GError *error=NULL;
+ GSList *packages,*lnk;
+ struct plover_vector *selected_packages;
+ PloverPackage *package;
+ PloverPackageSet *set;
+ PloverRepository *upstream;
+ PloverTransactionHelper *helper;
+ helper=plover_transaction_helper_new(NULL);
+ g_signal_connect(helper,"close",G_CALLBACK(gtk_main_quit),NULL);
+ plover_transaction_helper_set_installed(helper,installed);
+ if (plover_transaction_helper_get_error(helper,NULL))
+ {
+ plover_transaction_helper_present(helper);
+ return TRUE;
+ }
+ filenames[0]=path;
+ filenames[1]=NULL;
+ upstream=plover_repository_new_from_files(filenames,&error);
+ if (upstream)
+ plover_transaction_helper_set_upstream(helper,upstream);
+ else
+ {
+ plover_transaction_helper_set_error(helper,error,
+ "Software installation failed");
+ g_clear_error(&error);
+ plover_transaction_helper_present(helper);
+ return TRUE;
+ }
+ prefix=plover_transaction_helper_get_prefix(helper,&error);
+ if (error)
+ g_clear_error(&error);
+ else
+ {
+ s=g_strconcat(prefix?prefix:"","/var/log/open",NULL);
+ plover_log_open(s);
+ g_free(s);
+ }
+ set=plover_repository_get_package_set(upstream);
+ packages=plover_package_set_get_packages(set);
+ selected_packages=plover_vector_new();
+ for(lnk=packages;lnk;lnk=lnk->next)
+ {
+ package=PLOVER_PACKAGE(lnk->data);
+ plover_vector_append(selected_packages,
+ plover_package_get_name(package));
+ }
+ if (!plover_transaction_helper_install_packages(helper,selected_packages,
+ &error))
+ {
+ if (g_error_matches(error,PLOVER_GENERAL_ERROR,
+ PLOVER_GENERAL_ERROR_NO_WORK))
+ {
+ g_error_free(error);
+ error=g_error_new_literal(PLOVER_GENERAL_ERROR,
+ PLOVER_GENERAL_ERROR_NO_WORK,
+ "All packages already installed");
+ plover_transaction_helper_set_error(helper,error,
+ "Software installation");
+ }
+ else if (g_error_matches(error,PLOVER_GENERAL_ERROR,
+ PLOVER_GENERAL_ERROR_REQUIREMENTS_NOT_MET))
+ {
+ g_error_free(error);
+ unsatisfied=plover_transaction_helper_get_unsatisfied(helper);
+ error=g_error_new(PLOVER_GENERAL_ERROR,
+ PLOVER_GENERAL_ERROR_REQUIREMENTS_NOT_MET,
+ "Software cannot be installed because the following requirements "
+ "were not met:\n\n%s",unsatisfied);
+ plover_transaction_helper_set_error(helper,error,
+ "Software installation failed");
+ }
+ else
+ plover_transaction_helper_set_error(helper,error,
+ "Software installation failed");
+ g_error_free(error);
+ }
+ plover_vector_free(selected_packages);
+ g_object_unref(upstream);
+ plover_transaction_helper_present(helper);
+ return TRUE;
+}
+
+static void install_icons(void)
+{
+ GtkIconSet *icon_set;
+ plover_icons_add_to_stock("mimetypes",LOGO_NAME);
+ icon_set=gtk_icon_factory_lookup_default(LOGO_NAME);
+ gtk_window_set_default_icon_name(LOGO_NAME);
+}
+
+int main(int argc,char **argv)
+{
+ GError *err=0;
+ GtkWidget *w;
+ gchar *s,*t,*contents;
+ gchar *install_path=NULL;
+ gsize len;
+ PloverPackageSet *set;
+#if 0
+ GSList *objects,*lnk;
+#endif
+ gboolean started;
+ GOptionEntry options[]={
+ {"install",0,0,G_OPTION_ARG_FILENAME,&install_path,
+ "Install an RPM","path"},
+ {NULL}
+ };
+#ifdef WIN32
+ /*
+ * plover-open is normally a GUI application, but rpm scripts may well
+ * call console applications and it looks ugly if console windows keep
+ * popping up. Avoid this by allocating our own console and hiding it.
+ * Note:
+ * - If plover-open is a console application (typically for debugging),
+ * then skip this step.
+ * - Call ShowWindow twice to negate special handling on first call.
+ */
+ if (!GetConsoleWindow())
+ {
+ AllocConsole();
+ ShowWindow(GetConsoleWindow(),SW_HIDE);
+ ShowWindow(GetConsoleWindow(),SW_HIDE);
+ }
+#endif
+ razor_set_lua_loader("posix",luaopen_posix);
+ razor_set_lua_loader("whelk",luaopen_whelk);
+ if (!gtk_init_with_args(&argc,&argv,NULL,options,NULL,&err))
+ {
+ g_printerr("%s\n",err->message);
+ exit(1);
+ }
+ install_icons();
+#if 0
+ ui=gtk_builder_new();
+ if (!g_file_get_contents("plover-open.ui",&contents,&len,&err) &&
+ g_error_matches(err,G_FILE_ERROR,G_FILE_ERROR_NOENT))
+ {
+#ifdef WIN32
+ t=g_win32_get_package_installation_directory_of_module(NULL);
+ s=g_build_filename(t,"share","plover","plover-open.ui",NULL);
+ g_free(t);
+#else
+ s=g_build_filename(PLOVER_DATADIR,"plover-open.ui",NULL);
+#endif
+ g_clear_error(&err);
+ (void)g_file_get_contents(s,&contents,&len,&err);
+ g_free(s);
+ }
+ if (!err)
+ {
+ (void)gtk_builder_add_from_string(ui,contents,len,&err);
+ g_free(contents);
+ }
+ if (err)
+ {
+ g_error("%s",err->message);
+ exit(0);
+ }
+ gtk_builder_connect_signals(ui,NULL);
+#endif
+ set=plover_package_set_new();
+ (void)plover_package_set_open(set,"",TRUE,NULL);
+ if (install_path)
+ if (install(set,install_path))
+ gtk_main();
+ g_clear_object(&set);
+#if 0
+ objects=gtk_builder_get_objects(ui);
+ for(lnk=objects;lnk;lnk=lnk->next)
+ if (GTK_IS_WIDGET(lnk->data) &&
+ gtk_widget_is_toplevel(GTK_WIDGET(lnk->data)))
+ gtk_widget_destroy(GTK_WIDGET(lnk->data));
+ g_slist_free(objects);
+ g_clear_object(&ui);
+#endif
+ g_free(install_path);
+ exit(0);
+}
--- /dev/null
+#include <winver.h>
+#include <winuser.h>
+
+#pragma code_page(65001)
+
+MAINICON ICON "plover-open.ico"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION @PLOVER_MAJOR_VERSION@,@PLOVER_MINOR_VERSION@,
+ @PLOVER_MICRO_VERSION@,0
+ PRODUCTVERSION @PLOVER_MAJOR_VERSION@,@PLOVER_MINOR_VERSION@,
+ @PLOVER_MICRO_VERSION@,0
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ {
+ BLOCK "StringFileInfo"
+ {
+ BLOCK "080904B0"
+ {
+ VALUE "CompanyName","The plover development team"
+ VALUE "FileDescription","Plover Menu Handler"
+ VALUE "FileVersion","@PACKAGE_VERSION@"
+ VALUE "InternalName","plover-open"
+ VALUE "LegalCopyright",
+ "Copyright © 2014 J. Ali Harlow et al"
+ VALUE "OriginalFilename","plover-open.exe"
+ VALUE "ProductName","plover"
+ VALUE "ProductVersion","@PACKAGE_VERSION@"
+ }
+ }
+ BLOCK "VarFileInfo"
+ {
+ VALUE "Translation",0x809,0x4B0
+ }
+ }
+
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "plover-open.exe.manifest"