diff --git a/.gitignore b/.gitignore index e69de29..63f2112 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/sxiv-0.8.1.tar.gz diff --git a/sources b/sources index e69de29..8974406 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +23006a1900690d46c0ff126c76cdbd02 sxiv-0.8.1.tar.gz diff --git a/sxiv-0.8.1-destdir.patch b/sxiv-0.8.1-destdir.patch new file mode 100644 index 0000000..a6cba4d --- /dev/null +++ b/sxiv-0.8.1-destdir.patch @@ -0,0 +1,27 @@ +diff --git a/Makefile b/Makefile +index f7cde25..0cc621a 100644 +--- a/Makefile ++++ b/Makefile +@@ -3,6 +3,7 @@ all: sxiv + VERSION=0.8.1 + + CC?=gcc ++DESTDIR?= + PREFIX?=/usr/local + CFLAGS+= -Wall -pedantic -DVERSION=\"$(VERSION)\" + LDFLAGS+= +@@ -18,10 +19,10 @@ sxiv: $(OBJFILES) + $(CC) $(CFLAGS) -c -o $@ $< + + install: all +- install -D -m 755 -o root -g root sxiv $(PREFIX)/bin/sxiv +- mkdir -p $(PREFIX)/share/man/man1 +- sed "s/VERSION/$(VERSION)/g" sxiv.1 > $(PREFIX)/share/man/man1/sxiv.1 +- chmod 644 $(PREFIX)/share/man/man1/sxiv.1 ++ install -D -m 755 -o root -g root sxiv ${DESTDIR}$(PREFIX)/bin/sxiv ++ mkdir -p ${DESTDIR}$(PREFIX)/share/man/man1 ++ sed "s/VERSION/$(VERSION)/g" sxiv.1 > ${DESTDIR}$(PREFIX)/share/man/man1/sxiv.1 ++ chmod 644 ${DESTDIR}$(PREFIX)/share/man/man1/sxiv.1 + + clean: + rm -f sxiv *.o diff --git a/sxiv-0.8.1-do-not-change-ownership.patch b/sxiv-0.8.1-do-not-change-ownership.patch new file mode 100644 index 0000000..9e6ffd7 --- /dev/null +++ b/sxiv-0.8.1-do-not-change-ownership.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 0cc621a..7ff809e 100644 +--- a/Makefile ++++ b/Makefile +@@ -19,7 +19,7 @@ sxiv: $(OBJFILES) + $(CC) $(CFLAGS) -c -o $@ $< + + install: all +- install -D -m 755 -o root -g root sxiv ${DESTDIR}$(PREFIX)/bin/sxiv ++ install -D -m 755 sxiv ${DESTDIR}$(PREFIX)/bin/sxiv + mkdir -p ${DESTDIR}$(PREFIX)/share/man/man1 + sed "s/VERSION/$(VERSION)/g" sxiv.1 > ${DESTDIR}$(PREFIX)/share/man/man1/sxiv.1 + chmod 644 ${DESTDIR}$(PREFIX)/share/man/man1/sxiv.1 diff --git a/sxiv.desktop b/sxiv.desktop new file mode 100644 index 0000000..5f5a0e1 --- /dev/null +++ b/sxiv.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Simple X Image Viewer +Type=Application +Exec=sxiv %f +NoDisplay=true diff --git a/sxiv.spec b/sxiv.spec new file mode 100644 index 0000000..2b2afd9 --- /dev/null +++ b/sxiv.spec @@ -0,0 +1,55 @@ +Name: sxiv +Version: 0.8.1 +Release: 2%{?dist} +Summary: Simple (or small or suckless) X Image Viewer +Group: Applications/Multimedia +License: GPLv2+ +URL: https://github.com/muennich/%{name}/ +Source0: https://github.com/downloads/muennich/%{name}/%{name}-%{version}.tar.gz +Source1: %{name}.desktop +# Support DESTDIR +# https://github.com/muennich/sxiv/pull/3 +Patch0: sxiv-0.8.1-destdir.patch +# Do not change sxiv binary ownership to root:root +# Allows rpm-building the package by regular users +Patch1: sxiv-0.8.1-do-not-change-ownership.patch +BuildRequires: libX11-devel +BuildRequires: imlib2-devel +BuildRequires: desktop-file-utils + +%description +sxiv is an alternative to feh and qiv. Its only dependency besides xlib +is imlib2. The primary goal for writing sxiv is to create an image viewer, +which only has the most basic features required for fast image viewing (the +ones I want). It works nicely with tiling window managers and its code base +should be kept small and clean to make it easy for you to dig into it and +customize it for your needs. + +%prep +%setup -q +%patch0 -p1 -b .destdir +%patch1 -p1 -b .do-not-change-ownership + +%build +export CFLAGS="%{optflags}" +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} PREFIX=%{_prefix} +desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} + +%files +%doc LICENSE README.md +%{_bindir}/sxiv +%{_mandir}/man1/* +%{_datadir}/applications + +%changelog +* Wed May 11 2011 Petr Sabata - 0.8.1-2 +- Correcting license to GPLv2+ +- Using Github URL as Source +- Respecting optflags +- Adding a crude desktop file + +* Tue May 10 2011 Petr Sabata - 0.8.1-1 +- Initial import