[vdr-osdteletext] Move default cache dir to /tmp/vtx to get it to a by-default tmpfs mount.
Ville Skyttä
scop at fedoraproject.org
Sun Mar 3 20:27:09 UTC 2013
commit 0542eb358d2c6c45c0fe286b403a9df643df0834
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sun Mar 3 22:27:03 2013 +0200
Move default cache dir to /tmp/vtx to get it to a by-default tmpfs mount.
vdr-osdteletext-0.9.3-cachedir.patch | 48 ++++++++++++++++++++++++++++++++++
vdr-osdteletext.conf | 2 +-
vdr-osdteletext.spec | 28 +++++++++----------
3 files changed, 62 insertions(+), 16 deletions(-)
---
diff --git a/vdr-osdteletext-0.9.3-cachedir.patch b/vdr-osdteletext-0.9.3-cachedir.patch
new file mode 100644
index 0000000..0936d1a
--- /dev/null
+++ b/vdr-osdteletext-0.9.3-cachedir.patch
@@ -0,0 +1,48 @@
+diff -up osdteletext-0.9.3/osdteletext.c~ osdteletext-0.9.3/osdteletext.c
+--- osdteletext-0.9.3/osdteletext.c~ 2012-04-03 21:38:29.000000000 +0300
++++ osdteletext-0.9.3/osdteletext.c 2013-03-03 22:10:55.975090002 +0200
+@@ -124,7 +124,7 @@ const char *cPluginTeletextosd::CommandL
+ // Return a string that describes all known command line options.
+ return " -d --directory=DIR The directory where the temporary\n"
+ " files will be stored.\n"
+- " (default: /var/cache/vdr/vtx)\n"
++ " (default: /tmp/vtx)\n"
+ " Ensure that the directory exists and is writable.\n"
+ " -n --max-cache=NUM Maximum size in megabytes of cache used\n"
+ " to store the pages on the harddisk.\n"
+diff -up osdteletext-0.9.3/README~ osdteletext-0.9.3/README
+--- osdteletext-0.9.3/README~ 2010-11-06 17:18:56.000000000 +0200
++++ osdteletext-0.9.3/README 2013-03-03 22:10:42.054850825 +0200
+@@ -86,7 +86,7 @@ Command line options:
+
+ -d --directory=DIR The directory where the temporary
+ files will be stored.
+- (default: /var/cache/vdr/vtx)
++ (default: /tmp/vtx)
+ Ensure that the directory exists and is
+ writable.
+ -n --max-cache=NUM Maximum size in megabytes of cache used
+diff -up osdteletext-0.9.3/README.DE~ osdteletext-0.9.3/README.DE
+--- osdteletext-0.9.3/README.DE~ 2010-11-06 17:18:56.000000000 +0200
++++ osdteletext-0.9.3/README.DE 2013-03-03 22:10:47.557945436 +0200
+@@ -63,7 +63,7 @@ Kommandozeilen-Optionen:
+ Verfügbare Optionen:
+
+ -d --directory=DIR Das Verzeichnis für die temporären Dateien.
+- (Voreinstellung: /var/cache/vdr/vtx)
++ (Voreinstellung: /tmp/vtx)
+ Stellen Sie sicher, dass das Verzeichnis existiert
+ und beschreibbar ist.
+ -n --max-cache=NUM Maximale Größe des Zwischenspeichers für Seiten
+diff -up osdteletext-0.9.3/txtrecv.c~ osdteletext-0.9.3/txtrecv.c
+--- osdteletext-0.9.3/txtrecv.c~ 2012-04-03 21:31:33.000000000 +0300
++++ osdteletext-0.9.3/txtrecv.c 2013-03-03 22:10:31.503669741 +0200
+@@ -27,7 +27,7 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+
+-const char *RootDir::root = "/var/cache/vdr/vtx";
++const char *RootDir::root = "/tmp/vtx";
+
+ void RootDir::setRootDir(const char *newRoot) {
+ root=newRoot;
diff --git a/vdr-osdteletext.conf b/vdr-osdteletext.conf
index 7774124..b7ed9ea 100644
--- a/vdr-osdteletext.conf
+++ b/vdr-osdteletext.conf
@@ -3,4 +3,4 @@
# Add command line options to pass to the osdteletext plugin to PLUGIN_OPTIONS.
# See /usr/share/doc/vdr-osdteletext-*/README for info about available options.
-PLUGIN_OPTIONS="-d /var/cache/vdr/osdteletext"
+PLUGIN_OPTIONS=""
diff --git a/vdr-osdteletext.spec b/vdr-osdteletext.spec
index 03fbd54..faca397 100644
--- a/vdr-osdteletext.spec
+++ b/vdr-osdteletext.spec
@@ -3,13 +3,14 @@
Name: vdr-%{pname}
Version: 0.9.3
-Release: 7%{?dist}
+Release: 8%{?dist}
Summary: OSD teletext plugin for VDR
License: GPLv2+
URL: http://projects.vdr-developer.org/projects/show/plg-osdteletext
Source0: http://projects.vdr-developer.org/attachments/download/912/%{name}-%{version}.tgz
Source1: %{name}.conf
+Patch0: %{name}-0.9.3-cachedir.patch
BuildRequires: vdr-devel >= 1.6.0-41
Requires: vdr(abi)%{?_isa} = %{vdr_apiversion}
@@ -22,8 +23,7 @@ background.
%prep
%setup -q -n %{pname}-%{version}
-sed -i -e 's|/var/cache/vdr/vtx|%{vdr_cachedir}/osdteletext|g' \
- osdteletext.c README README.DE txtrecv.c
+%patch0 -p1
%build
@@ -36,32 +36,30 @@ install -dm 755 $RPM_BUILD_ROOT%{vdr_plugindir}
install -pm 755 libvdr-%{pname}.so.%{vdr_apiversion} \
$RPM_BUILD_ROOT%{vdr_plugindir}
-install -dm 755 $RPM_BUILD_ROOT%{vdr_cachedir}/osdteletext
+install -dm 755 $RPM_BUILD_ROOT{/tmp/vtx,%{_prefix}/lib/tmpfiles.d}
+echo "d /tmp/vtx 0755 %{vdr_user} root -" > \
+ $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d/%{name}.conf
-install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/vdr-plugins.d
-sed -e 's|/var/cache/vdr/|%{vdr_cachedir}/|' < %{SOURCE1} \
- > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/vdr-plugins.d/osdteletext.conf
-chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/vdr-plugins.d/*.conf
+install -Dpm 644 %{SOURCE1} \
+ $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/vdr-plugins.d/%{pname}.conf
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/locale
cp -pR locale/* $RPM_BUILD_ROOT%{_datadir}/locale
%find_lang %{name}
-%preun
-if [ $1 -eq 0 ] ; then
- rm -rf %{vdr_cachedir}/osdteletext/*
-fi
-
-
%files -f %{name}.lang
%doc COPYING HISTORY README*
%config(noreplace) %{_sysconfdir}/sysconfig/vdr-plugins.d/%{pname}.conf
%{vdr_plugindir}/libvdr-%{pname}.so.%{vdr_apiversion}
-%attr(-,%{vdr_user},root) %{vdr_cachedir}/osdteletext/
+%{_prefix}/lib/tmpfiles.d/%{name}.conf
+%attr(-,%{vdr_user},root) %dir /tmp/vtx
%changelog
+* Sun Mar 3 2013 Ville Skyttä <ville.skytta at iki.fi> - 0.9.3-8
+- Move default cache dir to /tmp/vtx to get it to a by-default tmpfs mount.
+
* Mon Feb 18 2013 Ville Skyttä <ville.skytta at iki.fi> - 0.9.3-7
- Rebuild.
More information about the scm-commits
mailing list