Retro-fitted branch 1.2.0

git-svn-id: https://svn.outlyer.net/svn/pub/nautilus-follow-symlink/branches/1.2.0@46 da2faf11-d50b-4b07-92cd-6070d1bd8887
This commit is contained in:
Toni Corvera 2012-08-18 12:12:13 +00:00
parent a496b9e8c9
commit d508947301
62 changed files with 683 additions and 112 deletions

View File

@ -1,2 +0,0 @@
nautilus-follow-symlink is Copyright (c) 2006, 2007, 2009 Toni Corvera <outlyer@gmail.com>.

1
caja/AUTHORS Symbolic link
View File

@ -0,0 +1 @@
../nautilus/AUTHORS

1
caja/ChangeLog Symbolic link
View File

@ -0,0 +1 @@
../nautilus/ChangeLog

1
caja/INSTALL Symbolic link
View File

@ -0,0 +1 @@
../nautilus/INSTALL

1
caja/LGPL Symbolic link
View File

@ -0,0 +1 @@
../nautilus/LGPL

33
caja/Makefile.am Normal file
View File

@ -0,0 +1,33 @@
SUBDIRS = po src
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
po/ChangeLog README \
po/POTFILES.in po/*.po \
kludges/* \
bootstrap.sh \
@PACKAGE@.spec.in @PACKAGE@.spec \
debian/changelog debian/control debian/compat debian/copyright \
debian/dirs debian/docs debian/README.Debian debian/rules
# Extra files to get rid of when distcleaning
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update \
po/.intltool-merge-cache
C_EXTENSIONDIR=`pkg-config --variable=extensiondir libcaja-extension`
forceinstall: all
pkg-config --atleast-version=1.2 libcaja-extension
sudo install -m644 src/.libs/libcaja-follow-symlink.so $(C_EXTENSIONDIR)/
-killall -9 caja
forceuninstall:
sudo $(RM) $(C_EXTENSIONDIR)/libcaja-follow-symlink.so
-killall -9 caja
#ACLOCAL_AMFLAGS = -I m4

2
caja/README Normal file
View File

@ -0,0 +1,2 @@
Note this package is generated directly from nautilus-follow-symlink,
that's why it references nautilus in multiple files.

1
caja/bootstrap.sh Symbolic link
View File

@ -0,0 +1 @@
../nautilus/bootstrap.sh

View File

@ -0,0 +1,94 @@
#
# spec file for caja-follow-symlink rpm
#
# based on the spec file for nautilus-follow-symlink
#
%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0)
%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
%define is_fedora 0%{?fedora}
%define is_redhat 0%{?rhl}
%define is_rhel 0%{?rhel}
%define distname generic
%define disttag .generic_lsb
%if %{is_fedora}
%define distname fedora
%define disttag %{dist}
%endif
%if %{is_redhat}
%define distname redhat
%define disttag %{dist}
%endif
%if %{is_mandrake}
%define distname mandrake
%define disttag .mdk
%endif
%if %{is_suse}
%define distname suse
%define disttag .suse
%endif
%if %{is_rhel}
%define distname rhel
%define disttag %{dist}
%endif
%define api_version 2.0
Name: @PACKAGE@
Version: @VERSION@
Release: 1%{?disttag}
Summary: caja plugin to open the location pointed by a symlink
Group: User Interface/Desktops
License: LGPL
URL: http://p.outlyer.net./caja-follow-symlink/
Source0: %{url}/files/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: intltool, libtool, caja-devel, gtk2-devel
Requires: caja-extensions
AutoReqProv: yes
Prefix: /usr
%description
This extension adds a context menu option to symbolic links to folders which
opens the pointed folder instead of the symbolic link.
%prep
echo Building %{name}-%{version}-%{release}
%setup -q -n %{name}-%{version}
%build
%configure
make %{?_smp_mflags}
%install
make install DESTDIR=%buildroot
rm -f $RPM_BUILD_ROOT/%{_libdir}/caja/extensions-%{api_version}/*.{l,}a
# create %{name}.lang with the locale data. To be included by %files
%find_lang %{name}
%clean
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog
%_libdir/caja/extensions-%{api_version}/*.so
%changelog
* Thu Aug 9 2012 Toni Corvera <outlyer@gmail.com> - 1.2.1
- Removed the *upstream revision
* Thu Apr 30 2009 Toni Corvera <outlyer@gmail.com> - 1.1-1~upstream
- Packaging cleanup
* Wed Jun 4 2008 Toni Corvera <outlyer@gmail.com> - 1.0.99+pre.2-1upstream
- Initial package

97
caja/configure.ac Normal file
View File

@ -0,0 +1,97 @@
dnl $Id: configure.ac 2517 2012-08-12 02:56:55Z toni $
AC_INIT(caja-follow-symlink, [1.2.0])
AC_CONFIG_SRCDIR([src/follow-symlink.c])
dnl Cross-compilation
AC_CANONICAL_SYSTEM
AC_CANONICAL_BUILD
AC_ARG_PROGRAM
AM_INIT_AUTOMAKE([1.7 foreign])
AC_REVISION(SVN $Rev: 2517 $)
AC_CONFIG_HEADER(src/config.h)
AC_CONFIG_MACRO_DIR([m4])
dnl default FLAGS, if none provided (note to self: ':=' is not portable)
if test -z "$CPPFLAGS" ; then
CPPFLAGS="-pedantic-errors"
fi
if test -z "$CFLAGS" ; then
CFLAGS="-Werror -Winline"
fi
dnl Extra flags always set (might be overridden by user's)
dnl CPPFLAGS="$CPPFLAGS"
# -O2 Showed problems in Fedora 17 (GCC 4.7) (not in previous versions nor in
# Debian's GCC 4.7.1 though (?)
# (solution was adding extern definition of ferror_unlocked
CFLAGS="-I\"$PWD/src/caja-layer\" -O2 -Wall -std=gnu99 $CFLAGS"
# -z relro -> read-only relocation ld flag
LDFLAGS="-Wl,--as-needed -Wl,-z,relro $LDFLAGS"
# libtool, DISABLE_STATIC should go before PROG_LIBTOOL
AM_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_LANG_C
AC_PROG_CC
# intltool
AC_PROG_INTLTOOL(0.18)
GETTEXT_PACKAGE=caja-follow-symlink
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext domain])
ALL_LINGUAS="ca es" dnl Implied en
#AM_GNU_GETTEXT_VERSION dnl autoreconf only runs autopoint if this is present
AM_GLIB_GNU_GETTEXT
# string.h and stdlib.h are used
dnl defines STDC_HEADERS if ANSI-compliant headers are present
AC_HEADER_STDC
dnl Xref: http://www.seul.org/docs/autotut/#libtool
#AC_CHECK_HEADERS(sys/stat.h,,AC_MSG_ERROR([required header file missing]))
# glib-2.0: ensure it's present
dnl and set GLIB_CFLAGS and GLIB_LIBS
dnl The newer API in GNOME 2.22 requires 2.16 (maybe 2.14?),
dnl gio is the only module required (probably)
AM_PATH_GLIB_2_0(2.16.0, [], [], gio)
# pkg-config: ensure libcaja-extension is found by pkg-config
PKG_CHECK_MODULES(CAJA_EXTENSION, [libcaja-extension])
#AC_DEFINE(_GNU_SOURCE)
dnl Incorporate the result of tests
#CFLAGS="$CFLAGS $CAJA_EXTENSION_CFLAGS"
#LIBS="$LIBS $CAJA_EXTENSION_LIBS"
dnl GTK-3 migration safeguard <http://live.gnome.org/GnomeGoals/UseGseal>
CFLAGS="$CFLAGS -DGSEAL_ENABLE"
cat <<EOF
##############################################################################
# Config:
#
# Flags:
# CFLAGS = $CFLAGS
# Caja: $CAJA_EXTENSION_CFLAGS
# CPPFLAGS = $CPPFLAGS
# LDFLAGS = $LDFLAGS
# LIBS = $LIBS
# Caja: $CAJA_EXTENSION_LIBS
# LDADD = $LDADD
# CC = $CC
# CPP = $CPP
##############################################################################
EOF
AC_OUTPUT([Makefile
src/Makefile
po/Makefile.in
caja-follow-symlink.spec
])

12
caja/debian/README.Debian Normal file
View File

@ -0,0 +1,12 @@
caja-follow-symlink for Debian
------------------------------
This is an unofficial debian package created directly from the upstream
source, by the upstream author.
I'm no Debian Developer so I can't guarantee a strict following of the
Debian Policy.
I use Debian Sid, when possible I try to build against packages available in
Debian Stable but sometimes published packages will only work in Unstable.
-- Toni Corvera <outlyer@outlyer.gmail>, Sun, 12 Aug 2012 14:52:03 +0200

1
caja/debian/changelog Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/debian/changelog

1
caja/debian/compat Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/debian/compat

14
caja/debian/control Normal file
View File

@ -0,0 +1,14 @@
Source: nautilus-follow-symlink
Section: contrib/mate
Priority: extra
Maintainer: Toni Corvera <outlyer@gmail.com>
Build-Depends: debhelper (>= 5.0.0), gcc, pkg-config, libglib2.0-dev (>= 2.16), libcaja-extension-dev, intltool (>= 0.18), gettext
Standards-Version: 3.6.2
Homepage: http://p.outlyer.net/caja-follow-symlink/
Package: caja-follow-symlink
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: caja plugin to open the location pointed by a symlink
This extension adds a context menu option to symbolic links to
folders which opens the pointed folder instead of the symbolic link.

1
caja/debian/copyright Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/debian/copyright

1
caja/debian/dirs Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/debian/dirs

1
caja/debian/docs Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/debian/docs

110
caja/debian/rules Executable file
View File

@ -0,0 +1,110 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# http://wiki.debian.org/Hardening#dpkg-buildflags
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
# Worarounds (couter-measures to Debian's [Sid] hardened flags
# as of this writing)
# doing funny stuff with printf-like funcions will make
# gcc paranoid, -Werror=format-security is defined in
# dpkg-buildflags
CFLAGS+=-Wno-error=format-security
# _FORTIFY_SOURCE=2 is defined in dpkg-buildflags, it produces
# bogus multiple-definition errors for unistd.h functions
CPPFLAGS+=-U_FORTIFY_SOURCE
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
test -f configure || ./dist clean gen
./configure --prefix=/usr --disable-static \
CFLAGS="$(CFLAGS)" \
CPPFLAGS="$(CPPFLAGS)" \
LDFLAGS="$(LDFLAGS)"
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
$(MAKE) FINAL=1
#docbook-to-man debian/caja-follow-symlink.sgml > caja-follow-symlink.1
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/caja-follow-symlink.
$(MAKE) install DESTDIR=$(CURDIR)/debian/caja-follow-symlink
# There's really no need for the .la file
rm -f $(CURDIR)/debian/caja-follow-symlink/`pkg-config --variable=extensiondir libcaja-extension`/*.la
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installexamples
# dh_install
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_python
# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure

1
caja/kludges Symbolic link
View File

@ -0,0 +1 @@
../nautilus/kludges

1
caja/po/ChangeLog Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/po/ChangeLog

1
caja/po/POTFILES.in Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/po/POTFILES.in

1
caja/po/ca.po Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/po/ca.po

1
caja/po/es.po Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/po/es.po

23
caja/src/Makefile.am Normal file
View File

@ -0,0 +1,23 @@
# $Id: Makefile.am 1307 2009-04-30 19:38:17Z toni $ #
#
# Required to correctly install the locale files (and to access them)
CPPFLAGS+=-DGNOMELOCALEDIR=\""$(datadir)/locale"\"
caja_extension_lib_LTLIBRARIES = libcaja-follow-symlink.la
# Must be installed in caja' extension dir
#caja_extension_libdir = $(libdir)/caja/extensions-1.0
# Cleaner way:
caja_extension_libdir = `pkg-config --variable=extensiondir libcaja-extension`
noinst_HEADERS=*.h caja-layer/libnautilus-extension/nautilus-menu-provider.h
libcaja_follow_symlink_la_SOURCES = follow-symlink.c nautilus-ext-follow-symlink.c
libcaja_follow_symlink_la_LIBADD = $(CAJA_EXTENSION_LIBS)
libcaja_follow_symlink_la_CFLAGS = $(CAJA_EXTENSION_CFLAGS)
# There's really no need to have versioned file names
libcaja_follow_symlink_la_LDFLAGS = -avoid-version
# See e.g. <http://www.seul.org/docs/autotut/#libtool> for version instructions
#libcaja_follow_symlink_la_LDFLAGS = -version-info 0:0:0

View File

@ -0,0 +1,3 @@
#include <libcaja-extension/caja-menu-provider.h>
#include "layer.h"

1
caja/src/common.h Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/src/common.h

1
caja/src/follow-symlink.c Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/src/follow-symlink.c

1
caja/src/follow-symlink.h Symbolic link
View File

@ -0,0 +1 @@
../../nautilus/src/follow-symlink.h

16
caja/src/layer.h Normal file
View File

@ -0,0 +1,16 @@
#define NautilusFileInfo CajaFileInfo
#define NautilusMenuItem CajaMenuItem
#define NautilusMenuProvider CajaMenuProvider
#define NautilusMenuProviderIface CajaMenuProviderIface
#define nautilus_file_info_get_file_type caja_file_info_get_file_type
#define nautilus_file_info_get_location caja_file_info_get_location
#define nautilus_file_info_get_name caja_file_info_get_name
#define nautilus_file_info_get_parent_location caja_file_info_get_parent_location
#define nautilus_file_info_get_uri caja_file_info_get_uri
#define nautilus_file_info_get_uri_scheme caja_file_info_get_uri_scheme
#define nautilus_file_info_is_directory caja_file_info_is_directory
#define nautilus_menu_item_new caja_menu_item_new
#define nautilus_module_initialize caja_module_initialize
#define nautilus_module_list_types caja_module_list_types
#define nautilus_module_shutdown caja_module_shutdown
#define NAUTILUS_TYPE_MENU_PROVIDER CAJA_TYPE_MENU_PROVIDER

View File

@ -0,0 +1 @@
../../nautilus/src/nautilus-ext-follow-symlink.c

View File

@ -0,0 +1 @@
../../nautilus/src/nautilus-ext-follow-symlink.h

View File

@ -0,0 +1,27 @@
#!/bin/bash
#
# This script shouldn't be executed unless new function calls
# or types are added
exec >layer.h
echo "Generating Nautilus to Caja preprocessor directives..." >&2
egrep --no-filename -o 'Nautilus[A-Z][^ ]*' *.c *.h |\
sort | uniq |\
sed -r -e 's/Nautilus([A-Z][^ ]*)/#define Nautilus\1 Caja\1/'
egrep --no-filename -o 'nautilus_[^(]*' *.c *.h | grep -v ' ' |\
sort | uniq |\
sed -r -e 's/nautilus_(.*)/#define nautilus_\1 caja_\1/'
egrep --no-filename -o 'NAUTILUS_TYPE_[A-Z_]*' *.c *.h |\
sort | uniq |\
sed -r -e 's/NAUTILUS_(.*)/#define NAUTILUS_\1 CAJA_\1/'
cat <<EOF
#undef NAUTILUS_COMMAND
#undef FSL_MSG_PREFIX
#define NAUTILUS_COMMAND "caja"
#define FSL_MSG_PREFIX "caja-follow-symlink"
EOF

1
debian/compat vendored
View File

@ -1 +0,0 @@
4

2
nautilus/AUTHORS Normal file
View File

@ -0,0 +1,2 @@
nautilus-follow-symlink is Copyright (c) 2006, 2007, 2009, 2011, 2012 Toni Corvera <outlyer@gmail.com>.

View File

@ -1,4 +1,20 @@
2011-04-07: Release 1.2.0-pre.1
2012-08-18: Release 1.2.0
* Added compatibility with Caja
* Bugfix:
- Correctly escape resolved paths
* Compatibility:
- GNOME3 support tested
Builds in either GNOME2 or GNOME3 correctly
- Fixed weird compilation error seen on Fedora 17
* Packaging:
- Added bootstrap.sh for easy re-generation of configure scripts in
case the default ones are problematic
- RPM: Support both GNOME2 and GNOME3 installations
* Other:
- Added libtool workaround to reduce the number of libraries
linked against
2011-04-07: Pre-Release 1.2.0-pre.1
* Compatibility:
- Refresh to build against GNOME 3, preliminary support

View File

@ -25,5 +25,5 @@ COMPILER NOTES
* This program has only been tested with gcc
* Define _DEBUG in the precompiler to enable the debugging/verbose mode.
* Define _DEBUG in the preprocessor to enable the debugging/verbose mode.
CPPFLAGS="-D_DEBUG" ./configure

View File

View File

@ -1,11 +1,10 @@
SUBDIRS = po src
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
po/ChangeLog \
intltool-extract.in \
intltool-update.in \
intltool-merge.in \
bootstrap.sh \
@PACKAGE@.spec.in @PACKAGE@.spec \
debian/changelog debian/control debian/compat debian/copyright \
debian/dirs debian/docs debian/README.Debian debian/rules
@ -17,9 +16,15 @@ DISTCLEANFILES = \
intltool-update \
po/.intltool-merge-cache
harshtest:
make
sudo cp src/.libs/libnautilus-follow-symlink.so /usr/lib/nautilus/extensions-3.0/
N_EXTENSIONDIR=`pkg-config --variable=extensiondir libnautilus-extension`
forceinstall: all
pkg-config --atleast-version=2.21 libnautilus-extension
sudo install -m644 src/.libs/libnautilus-follow-symlink.so $(N_EXTENSIONDIR)/
-killall -9 nautilus
forceuninstall:
sudo $(RM) $(N_EXTENSIONDIR)/libnautilus-follow-symlink.so
-killall -9 nautilus
#ACLOCAL_AMFLAGS = -I m4

11
nautilus/bootstrap.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh -x
PATCH=kludges/libtool-honor-as-needed.patch
# Run this script to run the auto* tools in a correct order
echo "Trying to re-generate the build scripts..." >&2
test -f ltmain.sh && patch -R <"$PATCH"
autoreconf --install --symlink --verbose
patch < "$PATCH"
intltoolize --automake

View File

@ -1,6 +1,6 @@
dnl $Id$
AC_INIT(nautilus-follow-symlink, [1.2-pre.1])
AC_INIT(nautilus-follow-symlink, [1.2.0])
AC_CONFIG_SRCDIR([src/follow-symlink.c])
dnl Cross-compilation
@ -12,6 +12,7 @@ AM_INIT_AUTOMAKE([1.7 foreign])
AC_REVISION(SVN $Rev$)
AC_CONFIG_HEADER(src/config.h)
AC_CONFIG_MACRO_DIR([m4])
dnl default FLAGS, if none provided (note to self: ':=' is not portable)
if test -z "$CPPFLAGS" ; then
@ -23,8 +24,12 @@ fi
dnl Extra flags always set (might be overridden by user's)
dnl CPPFLAGS="$CPPFLAGS"
# -O2 Showed problems in Fedora 17 (GCC 4.7) (not in previous versions nor in
# Debian's GCC 4.7.1 though (?)
# (solution was adding extern definition of ferror_unlocked
CFLAGS="-O2 -Wall -std=gnu99 $CFLAGS"
LDFLAGS="-Wl,--as-needed $LDFLAGS"
# -z relro -> read-only relocation ld flag
LDFLAGS="-Wl,--as-needed -Wl,-z,relro $LDFLAGS"
# libtool, DISABLE_STATIC should go before PROG_LIBTOOL
AM_DISABLE_STATIC
@ -61,8 +66,8 @@ PKG_CHECK_MODULES(NAUTILUS_EXTENSION, [libnautilus-extension])
#AC_DEFINE(_GNU_SOURCE)
dnl Incorporate the result of tests
CFLAGS="$CFLAGS $GLIB_CFLAGS $NAUTILUS_EXTENSION_CFLAGS"
LIBS="$LIBS $GLIB_LIBS $NAUTILUS_EXTENSION_LIBS"
#CFLAGS="$CFLAGS"
#LIBS="$LIBS"
dnl GTK-3 migration safeguard <http://live.gnome.org/GnomeGoals/UseGseal>
CFLAGS="$CFLAGS -DGSEAL_ENABLE"
@ -73,9 +78,11 @@ cat <<EOF
#
# Flags:
# CFLAGS = $CFLAGS
# Nautilus: $NAUTILUS_EXTENSION_CFLAGS
# CPPFLAGS = $CPPFLAGS
# LDFLAGS = $LDFLAGS
# LIBS = $LIBS
# Nautilus: $NAUTILUS_EXTENSION_LIBS
# LDADD = $LDADD
# CC = $CC
# CPP = $CPP

View File

@ -1,3 +1,13 @@
nautilus-follow-symlink (1.2.0-pon.1) unstable; urgency=low
* GNOME3-ready release. Finally.
* Bumped compatibility level to 5
* debian/rules: Added system-provided compiler flags
* debian/changelog: Changed upstream suffix to "pon"
* debian/control: Removed explicit dependency on nautilus
-- Toni Corvera <outlyer@gmail.com> Thu, 09 Aug 2012 19:02:40 +0200
nautilus-follow-symlink (1.2.0+pre.1-upstream.1) unstable; urgency=low
* Preliminary support for GNOME3.

1
nautilus/debian/compat Normal file
View File

@ -0,0 +1 @@
5

View File

@ -2,13 +2,13 @@ Source: nautilus-follow-symlink
Section: contrib/gnome
Priority: extra
Maintainer: Toni Corvera <outlyer@gmail.com>
Build-Depends: debhelper (>= 4.0.0), gcc, pkg-config, libglib2.0-dev (>= 2.16), libnautilus-extension-dev (>= 2.21), intltool (>= 0.18), gettext
Build-Depends: debhelper (>= 5.0.0), gcc, pkg-config, libglib2.0-dev (>= 2.16), libnautilus-extension-dev (>= 2.21), intltool (>= 0.18), gettext
Standards-Version: 3.6.2
Homepage: http://p.outlyer.net/nautilus-follow-symlink/
Package: nautilus-follow-symlink
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, nautilus (>= 2.91)
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: nautilus plugin to open the location pointed by a symlink
This extension adds a context menu option to symbolic links to
folders which opens the pointed folder instead of the symbolic link.

View File

@ -9,23 +9,31 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# http://wiki.debian.org/Hardening#dpkg-buildflags
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
# Worarounds (couter-measures to Debian's [Sid] hardened flags
# as of this writing)
# doing funny stuff with printf-like funcions will make
# gcc paranoid, -Werror=format-security is defined in
# dpkg-buildflags
CFLAGS+=-Wno-error=format-security
# _FORTIFY_SOURCE=2 is defined in dpkg-buildflags, it produces
# bogus multiple-definition errors for unistd.h functions
CPPFLAGS+=-U_FORTIFY_SOURCE
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
test -f configure || ./dist clean gen
./configure --prefix=/usr --disable-static
./configure --prefix=/usr --disable-static \
CFLAGS="$(CFLAGS)" \
CPPFLAGS="$(CPPFLAGS)" \
LDFLAGS="$(LDFLAGS)"
touch configure-stamp

13
nautilus/kludges/README Normal file
View File

@ -0,0 +1,13 @@
libtool-honor-as-needed.patch contains a patch against ltmain.sh (generated
on bootstrap to make use of libtool), so that it doesn't reorder
"-Wl,--as-needed", a linker flag that removes unnecessary dependencies.
It only applies to libraries listed after it, but libtool always pushes
it after the libs in the command line, so it does nothing, normally.
References:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=347650
"Debian bug #347650: libtool: Incorrect argument reordering"
[Source of patch]
http://sigquit.wordpress.com/2011/02/16/why-asneeded-doesnt-work-as-expected-for-your-libraries-on-your-autotools-project/
"Why --as-needed doesn't work as expected for your libraries on your autotools project"

View File

@ -0,0 +1,30 @@
--- ltmain.sh.orig 2012-08-14 11:36:48.211924221 +0200
+++ ltmain.sh 2012-08-14 11:42:48.663918234 +0200
@@ -5800,6 +5800,11 @@
arg=$func_stripname_result
;;
+ -Wl,--as-needed|-Wl,--no-as-needed)
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
-Wl,*)
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
@@ -6163,6 +6168,15 @@
lib=
found=no
case $deplib in
+ -Wl,--as-needed|-Wl,--no-as-needed)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
if test "$linkmode,$pass" = "prog,link"; then

View File

@ -34,9 +34,11 @@
%define disttag %{dist}
%endif
%define api_version %(pkg-config --atleast-version=3.0 libnautilus-extension && echo 3.0 || echo 2.0)
Name: @PACKAGE@
Version: @VERSION@
Release: 1%{?disttag}~upstream
Release: 1%{?disttag}
Summary: nautilus plugin to open the location pointed by a symlink
Group: User Interface/Desktops
@ -66,7 +68,7 @@ make %{?_smp_mflags}
%install
make install DESTDIR=%buildroot
rm -f $RPM_BUILD_ROOT/%{_libdir}/nautilus/extensions-3.0/*.{l,}a
rm -f $RPM_BUILD_ROOT/%{_libdir}/nautilus/extensions-%{api_version}/*.{l,}a
# create %{name}.lang with the locale data. To be included by %files
%find_lang %{name}
@ -78,10 +80,13 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/nautilus/extensions-3.0/*.{l,}a
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog
%_libdir/nautilus/extensions-3.0/*.so
%_libdir/nautilus/extensions-%{api_version}/*.so
%changelog
* Thu Aug 9 2012 Toni Corvera <outlyer@gmail.com> - 1.2.1
- Removed the *upstream revision
* Thu Apr 30 2009 Toni Corvera <outlyer@gmail.com> - 1.1-1~upstream
- Packaging cleanup

View File

@ -1,44 +1,37 @@
# Catalan translations for libnautilus-follow-symlink package.
# Copyright (C) 2006 THE libnautilus-follow-symlink'S COPYRIGHT HOLDER
# Copyright (C) 2006,2012 THE libnautilus-follow-symlink'S COPYRIGHT HOLDER
# This file is distributed under the same license as the libnautilus-follow-symlink package.
# Toni Corvera <outlyer@outlyer.net>, 2006.
# Toni Corvera <outlyer@outlyer.net>, 2006,2012.
#
msgid ""
msgstr ""
"Project-Id-Version: libnautilus-follow-symlink\n"
"Project-Id-Version: nautilus-follow-symlink 1.2.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-04-30 15:13+0200\n"
"PO-Revision-Date: 2006-10-30 13:42+0100\n"
"POT-Creation-Date: 2012-08-11 13:56+0200\n"
"PO-Revision-Date: 2012-08-11 13:56+0200\n"
"Last-Translator: Toni Corvera <outlyer@outlyer.net>\n"
"Language-Team: Catalan <outlyer@outlyer.net>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../src/follow-symlink.c:242
#: ../src/follow-symlink.c:269
#, c-format
msgid "Follow symbolic _link '%s'"
msgstr "Segueix l'en_llaç simbòlic '%s'"
#: ../src/follow-symlink.c:243
#: ../src/follow-symlink.c:270
#, c-format
msgid "Open the directory pointed by the symbolic link '%s'"
msgstr "Obre el directori apuntat per l'enllaç simbòlic '%s'"
#: ../src/follow-symlink.c:246
#: ../src/follow-symlink.c:273
#, c-format
msgid "Open _real path of '%s'"
msgstr "Obre la _ruta real de '%s'"
#: ../src/follow-symlink.c:247
#: ../src/follow-symlink.c:274
#, c-format
msgid "Open the real path of the folder pointed by '%s'"
msgstr "Obre el directori apuntat per '%s'"
#: ../src/follow-symlink.c:307
msgid "Follow symbolic _link"
msgstr "Segueix l'en_llaç simbòlic"
#: ../src/follow-symlink.c:308
msgid "Open the symbolic link"
msgstr "Obre l'enllaç simbòlic"

View File

@ -1,46 +1,39 @@
# Spanish translations for libnautilus-follow-symlink package
# Traducciones al español para el paquete libnautilus-follow-symlink.
# Copyright (C) 2006 THE libnautilus-follow-symlink'S COPYRIGHT HOLDER
# Copyright (C) 2006,2012 THE libnautilus-follow-symlink'S COPYRIGHT HOLDER
# This file is distributed under the same license as the libnautilus-follow-symlink package.
# Toni Corvera <outlyer@outlyer.net>, 2006.
# Toni Corvera <outlyer@outlyer.net>, 2006,2012.
#
msgid ""
msgstr ""
"Project-Id-Version: libnautilus-follow-symlink\n"
"Project-Id-Version: nautilus-follow-symlink 1.2.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-04-30 15:13+0200\n"
"PO-Revision-Date: 2006-10-30 13:42+0100\n"
"POT-Creation-Date: 2012-08-11 13:56+0200\n"
"PO-Revision-Date: 2012-08-11 13:56+0200\n"
"Last-Translator: Toni Corvera <outlyer@outlyer.net>\n"
"Language-Team: Spanish <outlyer@outlyer.net>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ../src/follow-symlink.c:242
#: ../src/follow-symlink.c:269
#, c-format
msgid "Follow symbolic _link '%s'"
msgstr "Seguir en_lace simbólico '%s'"
#: ../src/follow-symlink.c:243
#: ../src/follow-symlink.c:270
#, c-format
msgid "Open the directory pointed by the symbolic link '%s'"
msgstr "Abrir el directorio apuntado por el enlace simbólico '%s'"
#: ../src/follow-symlink.c:246
#: ../src/follow-symlink.c:273
#, c-format
msgid "Open _real path of '%s'"
msgstr "Abrir la _ruta real de '%s'"
#: ../src/follow-symlink.c:247
#: ../src/follow-symlink.c:274
#, c-format
msgid "Open the real path of the folder pointed by '%s'"
msgstr "Abrir el directoro apuntado por '%s'"
#: ../src/follow-symlink.c:307
msgid "Follow symbolic _link"
msgstr "Seguir en_lace simbólico"
#: ../src/follow-symlink.c:308
msgid "Open the symbolic link"
msgstr "Abrir el enlace simbólico"

View File

@ -11,9 +11,11 @@ nautilus_extension_lib_LTLIBRARIES = libnautilus-follow-symlink.la
# Cleaner way:
nautilus_extension_libdir = `pkg-config --variable=extensiondir libnautilus-extension`
libnautilus_follow_symlink_la_SOURCES = follow-symlink.c nautilus-ext-follow-symlink.c
noinst_HEADERS=*.h
libnautilus_follow_symlink_la_SOURCES = follow-symlink.c nautilus-ext-follow-symlink.c
libnautilus_follow_symlink_la_LIBADD = $(NAUTILUS_EXTENSION_LIBS)
libnautilus_follow_symlink_la_CFLAGS = $(NAUTILUS_EXTENSION_CFLAGS)
# There's really no need to have versioned file names
libnautilus_follow_symlink_la_LDFLAGS = -avoid-version
# See e.g. <http://www.seul.org/docs/autotut/#libtool> for version instructions

View File

@ -4,7 +4,7 @@
* nautilus-follow-symlink: Nautilus extension which allows opening the real
* path of symbolic links
*
* Copyright (C) 2006, 2008, 2009 Toni Corvera
* Copyright (C) 2006, 2008, 2009, 2011, 2012 Toni Corvera
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -31,8 +31,25 @@
* Also, includes config.h.
*/
#include <glib/gmessages.h> /* g_print() */
#include <glib/gprintf.h> /* g_printf() */
#if 0 // Separate includes. Might be problematic depending on flags
# include <glib/gmessages.h> /* g_print() */
# include <glib/gprintf.h> /* g_printf() */
#else
# include <glib.h>
#endif
// Used to allow simpler nautilus/caja code sharing
#define NAUTILUS_COMMAND "nautilus"
#define FSL_MSG_PREFIX "nautilus-follow-symlink"
#if 1 // Tricky workaround
// I truly have no clue why on earth I need this, but on Fedora 17,
// with GCC 4.7.0, when -O2 is used a "multiple definition" of
// ferror_unlocked will be triggered.
// Adding -fcommon didn't help
# include <stdio.h>
extern int ferror_unlocked(FILE*);
#endif
#include <stdlib.h> /* getenv() (3) */
#include <string.h> /* strcmp() (3) */

View File

@ -1,10 +1,10 @@
/* $Id$
*
* follow-symlink.h
* follow-symlink.c
* nautilus-follow-symlink: Nautilus extension which allows opening the real
* path of symbolic links
*
* Copyright (C) 2006, 2008, 2009 Toni Corvera
* Copyright (C) 2006, 2008, 2009, 2011, 2012 Toni Corvera
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -26,6 +26,7 @@
#include "follow-symlink.h"
#include <gio/gio.h>
#include <gtk/gtk.h>
// Symbolic name of the icon, use to be in /usr/share/icons/gnome/[16x16]/emblems/
#define FSL_ICON_NAME "emblem-symbolic-link"
@ -37,6 +38,43 @@ extern int errno;
// http://library.gnome.org/devel/gio/unstable/GFileInfo.html
// http://library.gnome.org/devel/libnautilus-extension/unstable/libnautilus-extension-nautilus-file-info.html
#if 0 // See comments below
/* Obtains the icon path
* The returned string should be freed with g_free()
*
* If the real icon path can't be obtained, a symbolic icon name is returned
* instead.
*
* XXX: This is technically unneeded, passing FSL_ICON_NAME is enough for nautilus
* to resolve the icon in GNOME3.
* But neither method seems to work anymore in GNOME2 for some
* reason, other plugins don't show icons either so I guess that's normal.
*/
static gchar * fsl_icon_name() {
TRACE();
GtkIconTheme * git = gtk_icon_theme_get_default(); // Don't deallocate
g_assert( NULL != git );
GtkIconInfo * gii = gtk_icon_theme_lookup_icon(git,
FSL_ICON_NAME,
16, // Size
GTK_ICON_LOOKUP_GENERIC_FALLBACK); // Flags
if (NULL == gii) {
// Lookup failed
return g_strdup(FSL_ICON_NAME);
}
// gtk_icon_info_get_filename() returns an string owned by
// GTK. It was quickly overwritten in my tests.
// g_strdup() is safe to be called on NULL (return NULL)
gchar * fn = g_strdup(gtk_icon_info_get_filename(gii));
gtk_icon_info_free(gii);
if (NULL == fn) { // No filename associated
return g_strdup(FSL_ICON_NAME);
}
return fn;
}
#endif
/* Menu initialization */
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface)
{
@ -74,7 +112,7 @@ GList * fsl_get_items_impl(GtkWidget * window,
// translated to their g_file_* counterparts.
// Only process symlinks to directories, we know already the file is a
// direcoty or a symlink to one
// directory or a symlink to one
GFile * gf = nautilus_file_info_get_location(file_info); // Get the pointed GFile
// FIXME: Can NULL be passed as last argument???
GFileInfo* gfi = g_file_query_info(gf,
@ -187,28 +225,18 @@ void fsl_callback (NautilusMenuItem * item __UNUSED, NautilusFileInfo * file_inf
GFile * parent = nautilus_file_info_get_parent_location(file_info);
const gchar const * BASE_CMD = "nautilus --no-desktop --no-default-window '%s'";
const gsize mem_block_size = printf_string_upper_bound(BASE_CMD, target);
gchar * command_line = g_try_malloc( mem_block_size );
gchar * escaped_tgt = g_shell_quote(target);
gchar * command_line = g_strdup_printf(NAUTILUS_COMMAND " --no-desktop --no-default-window %s", escaped_tgt);
g_free(escaped_tgt);
if (NULL == command_line) {
g_printerr(__FILE__ ":%d: Failed to allocate enough memory "
"for command line, can't spawn new nautilus.\n", __LINE__);
// Redundant, but issues a CRITICAL message
g_return_if_fail( NULL != command_line );
}
g_sprintf(command_line, BASE_CMD, target);
if (FALSE == g_shell_parse_argv(command_line, NULL, &argv, NULL)) {
if (G_UNLIKELY(FALSE == g_shell_parse_argv(command_line, NULL, &argv, NULL))) {
g_free(command_line);
g_printerr("Failed in creating the arguments for the child nautilus.\n");
//g_return_if_fail( FALSE );
g_printerr("Failed preparing " NAUTILUS_COMMAND " command-line.\n");
g_return_if_reached();
}
g_printf("nautilus-follow-symlink: Spawning nautilus with\n '%s'\n", command_line);
//g_printf(FSL_MSG_PREFIX ": Spawning with [PWD=%s]\n `%s`\n", g_file_get_path(parent), command_line);
g_printf(FSL_MSG_PREFIX ": Spawning with\n `%s`\n", command_line);
g_spawn_async( g_file_get_path(parent), // Inherit CWD
argv,
@ -286,29 +314,11 @@ NautilusMenuItem * fsl_menu_item_new(GdkScreen *screen __UNUSED,
// appended to the command name
static const gchar * const ITEM_NAME_FMT = "FsymlinkExtension::follow_symlink_%s";
name = g_try_malloc( printf_string_upper_bound(fmt_name, base_name) );
tooltip = g_try_malloc( printf_string_upper_bound(fmt_tooltip, a_base_name) );
unique_name = g_try_malloc( printf_string_upper_bound(ITEM_NAME_FMT, a_base_name) );
if (NULL == name || NULL == tooltip || NULL == unique_name) {
// Let's try to keep nautilus going if no allocation is possible
if (name) g_free(name);
if (tooltip) g_free(tooltip);
if (unique_name) g_free(unique_name);
g_printerr(__FILE__ ":%d: Failed to allocate enough memory for "
"the new menu item, dummier menu item in use.\n", __LINE__);
// Can't return NULL neither a nautilus_menu_item_new(NULL,NULL,NULL,NULL)
ret = nautilus_menu_item_new("Fsymlink::allocation_error",
_("Follow symbolic _link"),
_("Open the symbolic link"),
FSL_ICON_NAME);
g_return_val_if_fail(NULL!=name && NULL!=tooltip && NULL!=unique_name,
ret);
}
// g_try_malloc would allow nautilus to stay up even if some allocation fails
// but we'd be in trouble anyway. Apparently returning NULL is not an option either.
name = g_malloc( printf_string_upper_bound(fmt_name, base_name) );
tooltip = g_malloc( printf_string_upper_bound(fmt_tooltip, a_base_name) );
unique_name = g_malloc( printf_string_upper_bound(ITEM_NAME_FMT, a_base_name) );
g_sprintf(name, fmt_name, base_name);
g_sprintf(tooltip, fmt_tooltip, a_base_name);

View File

@ -1,6 +1,6 @@
/* $Id$
*
* follow-symlink.h
* nautilus-ext-follow-symlink.c
* nautilus-follow-symlink: Nautilus extension which allows opening the real
* path of symbolic links
*

View File

@ -1,6 +1,6 @@
/* $Id$
*
* follow-symlink.h
* nautilus-ext-follow-symlink.h
* nautilus-follow-symlink: Nautilus extension which allows opening the real
* path of symbolic links
*