Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
*.pyo
doc/*.1
doc/*.5
*.gz
*.swp
*.rpm
56 changes: 56 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
BINDIR=/usr/bin
MANDIR=/usr/share/man
SYSCONFDIR=/etc
INITDDIR=/etc/init.d
DESKTOPDIR=/usr/share/applications
USERUNITDIR=/usr/lib/systemd/user
UNITDIR=/usr/lib/systemd/system
UPLOADDIR=~/eyefi/%Y/%Y%m%d
DESTDIR=

all: doc/eyefiserver.1.gz doc/eyefiserver.conf.5.gz etc/eyefiserver.conf systemd/system/eyefiserver.service systemd/user/eyefiserver.service desktop/eyefiserver-prefs.desktop

dist: clean
DIR=EyeFiServer-`awk '/^Version:/ {print $$2}' rpm/eyefiserver.spec` && FILENAME=$$DIR.tar.gz && tar cvzf "$$FILENAME" --exclude "$$FILENAME" --exclude .git --exclude .gitignore -X .gitignore --transform="s|^|$$DIR/|" --show-transformed *

rpm: dist
T=`mktemp -d` && rpmbuild --define "_topdir $$T" -ta EyeFiServer-`awk '/^Version:/ {print $$2}' rpm/eyefiserver.spec`.tar.gz || { rm -rf "$$T"; exit 1; } && mv "$$T"/RPMS/noarch/* "$$T"/SRPMS/* . || { rm -rf "$$T"; exit 1; } && rm -rf "$$T"

install: all
install -Dm 755 src/eyefiserver -t $(DESTDIR)/$(BINDIR)/
install -Dm 755 src/eyefiserver-prefs -t $(DESTDIR)/$(BINDIR)/
install -Dm 600 etc/eyefiserver.conf -t $(DESTDIR)/$(SYSCONFDIR)/
install -Dm 644 desktop/eyefiserver-prefs.desktop -t $(DESTDIR)/$(DESKTOPDIR)/
install -Dm 644 systemd/system/eyefiserver.service -t $(DESTDIR)/$(UNITDIR)/
install -Dm 644 systemd/user/eyefiserver.service -t $(DESTDIR)/$(USERUNITDIR)/
install -Dm 755 etc/init.d/eyefiserver -t $(DESTDIR)/$(INITDDIR)/
install -Dm 644 doc/eyefiserver.1.gz -t $(DESTDIR)/$(MANDIR)/man1/
install -Dm 644 doc/eyefiserver.conf.5.gz -t $(DESTDIR)/$(MANDIR)/man5/

doc/eyefiserver.1.gz: doc/eyefiserver.txt
txt2man -t eyefiserver -r "eyefiserver" -s 1 -v "Executable programs or shell commands" -I file doc/eyefiserver.txt > doc/eyefiserver.1
gzip doc/eyefiserver.1

doc/eyefiserver.conf.5.gz: doc/eyefiserver.txt
txt2man -t eyefiserver.conf -r "eyefiserver %{version}" -s 5 -v "File formats and conventions" doc/eyefiserver.conf.txt > doc/eyefiserver.conf.5
gzip doc/eyefiserver.conf.5

systemd/user/eyefiserver.service: systemd/user/eyefiserver.service.in
sed 's|@BINDIR@|$(BINDIR)|g' < $< > $@

systemd/system/eyefiserver.service: systemd/system/eyefiserver.service.in
sed -e 's|@BINDIR@|$(BINDIR)|g' -e 's|@SYSCONFDIR@|$(SYSCONFDIR)|g' < $< > $@

etc/eyefiserver.conf: etc/eyefiserver.conf.in
sed 's|@UPLOADDIR@|$(UPLOADDIR)|g' < $< > $@

desktop/eyefiserver-prefs.desktop: desktop/eyefiserver-prefs.desktop.in
sed 's|@BINDIR@|$(BINDIR)|g' < $< > $@

clean:
rm -f doc/*.gz etc/eyefiserver.conf systemd/system/eyefiserver.service systemd/user/eyefiserver.service desktop/eyefiserver-prefs.desktop

gitclean:
LANG=C git status | grep -q 'orking directory clean' && { git clean -fxd ; } || { git status ; read -p "Some of these changes will be lost. Hit ENTER to confirm, Ctrl+C to cancel. " ; git clean -fxd ; }

.PHONY: install clean
81 changes: 49 additions & 32 deletions README
Original file line number Diff line number Diff line change
@@ -1,49 +1,66 @@
This is eyefiserver version 2.4 +github snapshoot
This is an improved version of EyeFiServer, a program that receives
photos from your Eye-Fi card in your camera.

INSTALLATION
------------
Structure of this package :
INSTALLATION OF THE SOFTWARE
----------------------------

.
|-- etc/
| |-- eyefiserver.conf
| `-- init.d/
| `-- eyefiserver
|-- usr/
`-- local/
|-- bin/
| `-- eyefiserver
`-- share/
\-- man/
|-- man1/
| `-- eyefiserver.1
`-- man5/
`-- eyefiserver.conf.5
You have two options:

If you're familiar with linux, that basically sums it up :-)
* Fedora / Red Hat systems: `make rpm` in the source directory, then
install (`rpm -Uvh`) the resulting `noarch` RPM in said directory.
* Others: `make install`. See the `Makefile` for control options.

You need to copy the files in the right place.

Optionally add stuff to your start-stop sequence. On debian/ubuntu, use
update-rc.d:
sudo update-rc.d eyefiserver defaults
CONFIGURATION
-------------

et voilà.
You have two options. You can run the server as part of your regular user
session (started automatically when you log in), or you can run it every
time your computer starts. The first option is what we call a *user session*
setup, and the second one is a *system wide* setup.

For the user session setup, all you have to do is run *Eye-Fi preferences*
right from your preferred desktop environment. If it doesn't appear in the
menus, then you can run the program `eyefiserver-prefs` and it will let you
set up your computer to receive photos from your Eye-Fi whenever you are
logged into your computer.

CONFIGURATION
-------------
To use this script you need to have your Eye-Fi "upload key".
You can find it after configuring the card, which you can currently on do only
on Windows or Mac:
For the system session setup:

* If you are using the RPM installation (described above), you need to add
your upload key to `/etc/eyefiserver.conf`, then enable and restart the
`eyefiserver.service` service unit. You can see the log in real-time
using `journalctl -fa`. Instructions on how to retrieve the upload key
from your Windows or Mac OS X system are below.
* If you are *not* using the RPM installation (that is, you installed using
`make` or by manually copying files to their right locations), then
you need to set up:
* the initscript by hand,
* the permissions on the `/etc/eyefiserver.conf` configuration file,
* the contents of that file,
* the creation of the upload directory, and its permissions.


THE INFAMOUS UPLOAD KEY
-----------------------

To retrieve the upload key, you need to pair your Eye-Fi with the
Eye-Fi Center (which you can currently on do only
on Windows or Mac). Do not enable Relayed Transfer during the
pairing process.

Once the pairing process is done, you must retrieve the key:

On Windows:
See C:\Documents and Settings\<User>\Application Data\Eye-Fi\Settings.xml
On Mac:
See ~/Applications Data/Eye-Fi/Settings.xml

You must search for it and paste it in eyefiserver.conf. Then server needs to be
reloaded after editing that file.
If you are doing a *user session* setup, you can supply the key to the
preferences program `eyefiserver-prefs`. If you are doing a *system wide*
setup, then you must search for `upload_key` in `/etc/eyefiserver.conf`
and then paste the key there. Of course, the server needs to be
restarted after editing that file.

See manual for a full description of options.

Expand Down
9 changes: 9 additions & 0 deletions desktop/eyefiserver-prefs.desktop.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Eye-Fi preferences
Exec=@BINDIR@/eyefiserver-prefs
Icon=application-x-executable
Terminal=false
TryExec=@BINDIR@/eyefiserver-prefs
Type=Application
Categories=Settings;X-GNOME-SystemSettings;
X-AppInstall-Keywords=eyefi
2 changes: 1 addition & 1 deletion etc/eyefiserver.conf → etc/eyefiserver.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ loglevel=INFO
#
# daemon user need write access.

upload_dir=~/eyefi/%Y/%Y%m%d
upload_dir=@UPLOADDIR@


# Do we use the date of the transfer or the date of the file in the camera?
Expand Down
96 changes: 96 additions & 0 deletions rpm/eyefiserver.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
%define debug_package %{nil}
%define srveyefi /srv/eyefi

Name: EyeFiServer
Version: 2.4
Release: 1%{?dist}
Summary: An open source Eye-Fi server

License: GPLv3+
URL: https://github.com/nirgal/EyeFiServer
Source0: Source0: https://github.com/shiinee/%{name}/archive/{%version}.tar.gz#/%{name}-%{version}.tar.gz

BuildRequires: txt2man
BuildArch: noarch
Requires: python2, gobject-introspection, gtk3, pygobject3

%description
eyefiserver is a daemon that accepts connections and receives files from Eye-Fi
brand wireless SD devices.

%prep
%setup -q

%build
# variables must be kept in sync with install
make DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} SYSCONFDIR=%{_sysconfdir} \
INITDDIR=%{_initddir} MANDIR=%{_mandir} USERUNITDIR=%{_userunitdir} \
DESKTOPDIR=%{_datadir}/applications \
UNITDIR=%{_unitdir} \
UPLOADDIR=%srveyefi \

%install
rm -rf $RPM_BUILD_ROOT
# variables must be kept in sync with build
make install DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} SYSCONFDIR=%{_sysconfdir} \
INITDDIR=%{_initddir} MANDIR=%{_mandir} USERUNITDIR=%{_userunitdir} \
DESKTOPDIR=%{_datadir}/applications \
UNITDIR=%{_unitdir} \
UPLOADDIR=%srveyefi \

mkdir -p $RPM_BUILD_ROOT%srveyefi

rm -rf $RPM_BUILD_ROOT/%{_initddir}/

%pre
if [ $1 -eq 1 ] ; then
# Create eyefi gid as long as it does not already exist
cat /etc/group | cut -d':' -f 1 | grep --quiet '^eyefi$' 2>/dev/null
if [ "$?" -eq 1 ]; then
# Initial installation
/usr/sbin/groupadd -r eyefi >/dev/null 2>&1 || :
fi

# Create eyefi uid as long as it does not already exist.
cat /etc/passwd | cut -d':' -f 1 | grep --quiet '^eyefi$' 2>/dev/null
if [ "$?" -eq 1 ]; then
# Initial installation
/usr/sbin/useradd -l -c "Eye-Fi server user" -r -g eyefi \
-s /sbin/nologin -r -d %srveyefi eyefi >/dev/null 2>&1 || :
fi
fi

%post
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl preset eyefiserver >/dev/null 2>&1 || :
fi

%preun
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable eyefiserver.service > /dev/null 2>&1 || :
systemctl stop eyefiserver.service > /dev/null 2>&1 || :
fi

%postun
systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
systemctl try-restart eyefiserver.service >/dev/null 2>&1 || :
fi

%files
%{_bindir}/eyefiserver*
%attr(400, eyefi, root) %config(noreplace) %{_sysconfdir}/eyefiserver.conf
%{_userunitdir}/*.service
%{_unitdir}/*.service
%{_datadir}/applications/*.desktop
%{_mandir}/man?/*.gz
%attr(2770, eyefi, eyefi) %verify() %srveyefi

%doc doc/* LICENSE README changelog

%changelog
* Mon Feb 8 2016 Skyler Leigh Amador
- Packaging the most current release of eyefiserver from github
21 changes: 19 additions & 2 deletions src/eyefiserver
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,21 @@ class EyeFiConfig(RawConfigParser):
"""
Helper wraper around ConfigParser.RawConfigParser
Provides get() method with fallback to a global section and default values

All configuration settings can be keyed to the MAC address of the
Eye-Fi device (as a section of the INI file), and if the section
does not exist, then the section 'EyeFiServer' is consulted for
the configuration values. If that fals, then most config values
default to sensible defaults.

List of config settings:
config.getuploaddir defaults to ~/eyefi
config.get upload_key mandatory
config.get progress_execute defaults to nothing
config.get complete_execute defaults to nothing
config.getboolean correct_mtime defaults to True
config.getboolean use_date_from_file defaults to False
config.getboolean integrity_verification defaults to True
"""
def __init__(self, conffiles):
RawConfigParser.__init__(self)
Expand Down Expand Up @@ -884,13 +899,15 @@ def main():
action='append', dest='conffiles',
help='specific alternate location for configuration file. '
'default=%(default)s',
default=['/etc/eyefiserver.conf',
os.path.expanduser('~/eyefiserver.conf')])
default=[])
parser.add_argument(
'--log', metavar='LOGFILE',
dest='logfile',
help='log to file')
options = parser.parse_args()
if not options.conffiles:
options.conffiles = ['/etc/eyefiserver.conf',
os.path.expanduser('~/eyefiserver.conf')]

# Create two handlers. One to print to the log and one to print to the
# console
Expand Down
Loading