PDA

View Full Version : session script does not work in gtk-vector-screenshot



TheBigRed
25th November 2011, 10:53 AM
hi,
i tried to build a rpm package for gtk-vector-screenshot-0.3.2, this works,
but the necessary environment variable GTK_MODULES is not set.

gtk-vector-screenshot.spec


Name: gtk-vector-screenshot
Version: 0.3.2
Release: 1%{?dist}
Summary: vector screenshot

Group: Graphics
License: GPLv2+
URL: http://www.joachim-breitner.de/archive/gtk-vector-screenshot
Source0: http://www.joachim-breitner.de/archive/gtk-vector-screenshot/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: gtk2-devel
Requires: glib
Requires(postun): gtk3
Requires(posttrans): gtk3

%description
Mit diesem GTK-Modul können Sie Screenshots von laufenden GTK-3-Anwendungen al
Vektor-Graphik erstellen, stufenlos scalierbar und mit markier- und durchsuchbarem Text.
Es unterstützt die Formate PDF, SVG und PostScript
Verbindungsproblemen prüfen, ob diese lokal sind.

%prep
%setup -q -n %{name}-%{version}


%build
export LDFLAGS="$LDFLAGS -lX11"
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/X11/Xsession.d
install -pm 644 52load-gtk-vector-screenshot-gtk-module $RPM_BUILD_ROOT%{_sysconfdir}/X11/Xsession.d

# We intentionally don't ship *.la files
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-*.0/modules/lib%{name}.la


%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc
%{_bindir}/take-vector-screenshot
%{_libdir}/gtk-*.0/modules/lib%{name}.so
%{_datadir}/applications/take-vector-screenshot.desktop
# This is marked as 'for development use only'
%{_sysconfdir}/X11/Xsession.d/52load-gtk-vector-screenshot-gtk-module


%changelog

gtk-vector-screenshot is a GTK+ module that allows you to take a screenshot of a running GTK+ 3 application as a vector image,
with fully scalable graphics and selectable text. It supports rendering the application to PDF, SVG, and PostScript.

http://www.joachim-breitner.de/archive/gtk-vector-screenshot/

Installation
============

To install the module, use the usual sequence:

./configure --prefix=/usr
make
sudo make install

And then ensure that the environment variable GTK_MODULES includes
gtk-vector-screenshot, e.g. in ~/.xsessionrc or by putting the file
52load-gtk-vector-screenshot-gtk-module into /etc/X11/Xsession.d.

If you do not install into /usr, you will have set GTK_PATH or pass the full
path of gtk-vector-screencast.so via GTK_MODULES when invoking the application.

Usage
=====

You need to ensure that the gtk-vector-screenshot module is loaded by the
application, see section Installation. Distribution packages should take care
of this, but you might need to login again after you install the package.

Then run take-vector-screenshot, press the button, click on the window and then
you can select the filename to save the image under.

You can watch a screencast of the program in action at
http://www.joachim-breitner.de/blog/archives/494-Better-PDF-screenshots-with-gtk-3.html

have someone a idea ?

leigh123linux
25th November 2011, 11:10 AM
hi,
i tried to build a rpm package for gtk-vector-screenshot-0.3.2, this works,
but the necessary environment variable GTK_MODULES is not set.

gtk-vector-screenshot.spec


Name: gtk-vector-screenshot
Version: 0.3.2
Release: 1%{?dist}
Summary: vector screenshot

Group: Graphics
License: GPLv2+
URL: http://www.joachim-breitner.de/archive/gtk-vector-screenshot
Source0: http://www.joachim-breitner.de/archive/gtk-vector-screenshot/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: gtk2-devel
Requires: glib
Requires(postun): gtk3
Requires(posttrans): gtk3

%description
Mit diesem GTK-Modul können Sie Screenshots von laufenden GTK-3-Anwendungen al
Vektor-Graphik erstellen, stufenlos scalierbar und mit markier- und durchsuchbarem Text.
Es unterstützt die Formate PDF, SVG und PostScript
Verbindungsproblemen prüfen, ob diese lokal sind.

%prep
%setup -q -n %{name}-%{version}


%build
export LDFLAGS="$LDFLAGS -lX11"
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/X11/Xsession.d
install -pm 644 52load-gtk-vector-screenshot-gtk-module $RPM_BUILD_ROOT%{_sysconfdir}/X11/Xsession.d

# We intentionally don't ship *.la files
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-*.0/modules/lib%{name}.la


%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc
%{_bindir}/take-vector-screenshot
%{_libdir}/gtk-*.0/modules/lib%{name}.so
%{_datadir}/applications/take-vector-screenshot.desktop
# This is marked as 'for development use only'
%{_sysconfdir}/X11/Xsession.d/52load-gtk-vector-screenshot-gtk-module


%changeloggtk-vector-screenshot is a GTK+ module that allows you to take a screenshot of a running GTK+ 3 application as a vector image,
with fully scalable graphics and selectable text. It supports rendering the application to PDF, SVG, and PostScript.

http://www.joachim-breitner.de/archive/gtk-vector-screenshot/

Installation
============

To install the module, use the usual sequence:

./configure --prefix=/usr
make
sudo make install

And then ensure that the environment variable GTK_MODULES includes
gtk-vector-screenshot, e.g. in ~/.xsessionrc or by putting the file
52load-gtk-vector-screenshot-gtk-module into /etc/X11/Xsession.d.

If you do not install into /usr, you will have set GTK_PATH or pass the full
path of gtk-vector-screencast.so via GTK_MODULES when invoking the application.

Usage
=====

You need to ensure that the gtk-vector-screenshot module is loaded by the
application, see section Installation. Distribution packages should take care
of this, but you might need to login again after you install the package.

Then run take-vector-screenshot, press the button, click on the window and then
you can select the filename to save the image under.

You can watch a screencast of the program in action at
http://www.joachim-breitner.de/blog/archives/494-Better-PDF-screenshots-with-gtk-3.html

have someone a idea ?
Is this relevant.

https://fedoraproject.org/wiki/Packaging/ScriptletSnippets#GTK.2B_modules

TheBigRed
25th November 2011, 01:31 PM
thanks leigh123linux,

the spec file looks like this now:


Name: gtk-vector-screenshot
Version: 0.3.2
Release: 1%{?dist}
Summary: vector screenshot

Group: Graphics
License: GPLv2+
URL: http://www.joachim-breitner.de/archive/gtk-vector-screenshot
Source0: http://www.joachim-breitner.de/archive/gtk-vector-screenshot/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: gtk2-devel
Requires: glib
Requires(postun): gtk3
Requires(posttrans): gtk3

%description
Mit diesem GTK-Modul können Sie Screenshots von laufenden GTK-3-Anwendungen al
Vektor-Graphik erstellen, stufenlos scalierbar und mit markier- und durchsuchbarem Text.
Es unterstützt die Formate PDF, SVG und PostScript
Verbindungsproblemen prüfen, ob diese lokal sind.

%prep
%setup -q -n %{name}-%{version}


%build
export LDFLAGS="$LDFLAGS -lX11"
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/X11/Xsession.d
install -pm 644 52load-gtk-vector-screenshot-gtk-module $RPM_BUILD_ROOT%{_sysconfdir}/X11/Xsession.d

# We intentionally don't ship *.la files
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-*.0/modules/lib%{name}.la

%clean
rm -rf $RPM_BUILD_ROOT

%postun
/usr/bin/gtk-query-immodules-3.0-%{__isa_bits} --update-cache &> /dev/null || :

%post
if [ $1 -eq 1 ] ; then
# For upgrades, the cache will be regenerated by the new package's %postun
/usr/bin/gtk-query-immodules-3.0-%{__isa_bits} --update-cache &> /dev/null || :
fi

%files
%defattr(-,root,root,-)
%doc
%{_bindir}/take-vector-screenshot
%{_libdir}/gtk-*.0/modules/lib%{name}.so
%{_datadir}/applications/take-vector-screenshot.desktop
# This is marked as 'for development use only'
%{_sysconfdir}/X11/Xsession.d/52load-gtk-vector-screenshot-gtk-module


%changelog

but still the same problem.

[root@fc16 tmp]# ll /usr/lib/gtk-3.0/modules/

insgesamt 300
-rwxr-xr-x. 1 root root 172828 27. Okt 02:55 libatk-bridge.so
-rwxr-xr-x. 1 root root 22076 13. Jul 15:40 libcanberra-gtk3-module.so
lrwxrwxrwx. 1 root root 26 29. Sep 11:23 libcanberra-gtk-module.so -> libcanberra-gtk3-module.so
-rwxr-xr-x. 1 root root 30436 18. Okt 10:47 libcaribou-gtk-module.so
-rwxr-xr-x. 1 root root 54390 25. Nov 12:54 libgtk-vector-screenshot.so
-rwxr-xr-x. 1 root root 13792 7. Nov 12:23 libpk-gtk-module.so

[root@fc16 tmp]# ll /usr/lib/gtk-3.0/3.0.0/immodules

insgesamt 64
-rwxr-xr-x. 1 root root 5544 14. Okt 23:21 im-cedilla.so
-rwxr-xr-x. 1 root root 26476 4. Nov 11:33 im-ibus.so
-rwxr-xr-x. 1 root root 26352 14. Okt 23:21 im-xim.so



[root@fc16 tmp]# /usr/bin/gtk-query-immodules-3.0-32

# GTK+ Input Method Modules file
# Automatically generated file, do not edit
# Created by /usr/bin/gtk-query-immodules-3.0-32 from gtk+-3.2.1
#
# ModulesPath = /root/.gtk-3.0/3.0.0/i386-redhat-linux-gnu/immodules:/root/.gtk-3.0/3.0.0/immodules:/root/.gtk-3.0/i386-redhat-linux-gnu/immodules:/root/.gtk-3.0/immodules:/usr/lib/gtk-3.0/3.0.0/i386-redhat-linux-gnu/immodules:/usr/lib/gtk-3.0/3.0.0/immodules:/usr/lib/gtk-3.0/i386-redhat-linux-gnu/immodules:/usr/lib/gtk-3.0/immodules
#
"/usr/lib/gtk-3.0/3.0.0/immodules/im-xim.so"
"xim" "X Input Method" "gtk30" "/usr/share/locale" "ko:ja:th:zh"

"/usr/lib/gtk-3.0/3.0.0/immodules/im-ibus.so"
"ibus" "IBus (Intelligent Input Bus)" "ibus" "" "ja:ko:zh:*"

"/usr/lib/gtk-3.0/3.0.0/immodules/im-cedilla.so"
"cedilla" "Cedilla" "gtk30" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa"

[root@fc16 tmp]# rpm -ql gtk-vector-screenshot

/etc/X11/Xsession.d/52load-gtk-vector-screenshot-gtk-module
/usr/bin/take-vector-screenshot
/usr/lib/gtk-2.0/modules/libgtk-vector-screenshot.so
/usr/lib/gtk-3.0/modules/libgtk-vector-screenshot.so
/usr/share/applications/take-vector-screenshot.desktop