[FFmpeg-devel] change installation directory for ffpresets

Reinhard Tartler siretart
Sat May 15 21:44:01 CEST 2010


hi,

currently, the ffpresets are installed in ${prefix}/share/ffmpeg. I
propose this to be changed to ${prefix}/share/libavcodec${major}. 

Rationale: The ffpresets (currently) contain only presets that are
useful for libx264. When distributing FFmpeg in binary packages the
packager needs to decide in which package these presets need to end up
with. In Debian, I used to ship then in the 'ffmpeg' package. During a
discussion with Jason, we agreed to move them to libavcodec52, because
these presets very badly need to be in sync with the libx264 wrapper.
This is easiest implemented with putting the presets in the libavcodec
package.

The trouble is now that this will create a file conflict when
libavcodec53 is introduced. In order to prevent this, I can either a)
move them back to the ffmpeg package and use a much stricter dependency
on the libavcodec binary package or b), have the presets installed in
/usr/share/libavcodec${major}. This makes it possible to have different
ffpresets installed for libavcodec versions with different major
versions.

As I feel b) is much more elegant, and datadir is currently used for
nothing else, I'm proposing the following patch:


Index: configure
===================================================================
--- configure	(revision 23143)
+++ configure	(working copy)
@@ -65,7 +65,7 @@
   --disable-logging        do not log configure debug information
   --prefix=PREFIX          install in PREFIX [$prefix]
   --bindir=DIR             install binaries in DIR [PREFIX/bin]
-  --datadir=DIR            install data files in DIR [PREFIX/share/ffmpeg]
+  --lavcdatadir=DIR        install data files in DIR [PREFIX/share/ffmpeg]
   --libdir=DIR             install libs in DIR [PREFIX/lib]
   --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]
   --incdir=DIR             install includes in DIR [PREFIX/include]
@@ -1123,7 +1123,7 @@
 
 PATHS_LIST='
     bindir
-    datadir
+    lavcdatadir
     incdir
     libdir
     mandir
@@ -1437,7 +1437,7 @@
 # installation paths
 prefix_default="/usr/local"
 bindir_default='${prefix}/bin'
-datadir_default='${prefix}/share/ffmpeg'
+lavcdatadir_default='${prefix}/share/libavcodec$(libavcodec_VERSION_MAJOR)'
 incdir_default='${prefix}/include'
 libdir_default='${prefix}/lib'
 mandir_default='${prefix}/share/man'
@@ -2963,7 +2963,7 @@
 SHLIBDIR=\$(DESTDIR)$shlibdir
 INCDIR=\$(DESTDIR)$incdir
 BINDIR=\$(DESTDIR)$bindir
-DATADIR=\$(DESTDIR)$datadir
+LAVCDATADIR=\$(DESTDIR)$lavcdatadir
 MANDIR=\$(DESTDIR)$mandir
 SRC_PATH="$source_path"
 SRC_PATH_BARE=$source_path
@@ -3051,7 +3051,7 @@
 #define FFMPEG_CONFIG_H
 #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
 #define FFMPEG_LICENSE "$(c_escape $license)"
-#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
+#define FFMPEG_LAVCDATADIR "$(eval c_escape $lavcdatadir)"
 #define CC_TYPE "$cc_type"
 #define CC_VERSION $cc_version
 #define restrict $_restrict
Index: ffmpeg.c
===================================================================
--- ffmpeg.c	(revision 23143)
+++ ffmpeg.c	(working copy)
@@ -4068,13 +4068,14 @@
     FILE *f=NULL;
     char filename[1000], tmp[1000], tmp2[1000], line[1000];
     int i;
-    const char *base[3]= { getenv("FFMPEG_DATADIR"),
+    const char *base[4]= { getenv("FFMPEG_DATADIR"),
+                           getenv("FFMPEG_LAVCDATADIR"),
                            getenv("HOME"),
-                           FFMPEG_DATADIR,
+                           FFMPEG_LAVCDATADIR,
                          };
 
     if (*opt != 'f') {
-        for(i=0; i<3 && !f; i++){
+        for(i=0; i<4 && !f; i++){
             if(!base[i])
                 continue;
             snprintf(filename, sizeof(filename), "%s%s/%s.ffpreset", base[i], i != 1 ? "" : "/.ffmpeg", arg);
Index: doc/ffmpeg-doc.texi
===================================================================
--- doc/ffmpeg-doc.texi	(revision 23143)
+++ doc/ffmpeg-doc.texi	(working copy)
@@ -806,8 +806,8 @@
 following rules:
 
 First ffmpeg searches for a file named @var{arg}.ffpreset in the
-directories @file{$FFMPEG_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in
-the datadir defined at configuration time (usually @file{PREFIX/share/ffmpeg})
+directories @file{$FFMPEG_DATADIR} (if set), @file{$FFMPEG_LAVCDATADIR} (if set), and @file{$HOME/.ffmpeg}, and in
+the datadir defined at configuration time (usually @file{PREFIX/share/libavcodec52})
 in that order. For example, if the argument is @code{libx264-max}, it will
 search for the file @file{libx264-max.ffpreset}.
 
Index: Makefile
===================================================================
--- Makefile	(revision 23143)
+++ Makefile	(working copy)
@@ -30,7 +30,7 @@
 
 FFLIBS := avutil
 
-DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
+FFPRESET_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
 
 SKIPHEADERS = cmdutils_common_opts.h
 
@@ -123,9 +123,9 @@
 	$(Q)mkdir -p "$(BINDIR)"
 	$(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
 
-install-data: $(DATA_FILES)
-	$(Q)mkdir -p "$(DATADIR)"
-	$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
+install-data: $(FFPRESET_FILES)
+	$(Q)mkdir -p "$(LAVCDATADIR)"
+	$(INSTALL) -m 644 $(FFPRESET_FILES) "$(LAVCDATADIR)"
 
 install-man: $(MANPAGES)
 	$(Q)mkdir -p "$(MANDIR)/man1"
@@ -137,7 +137,7 @@
 	$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
 
 uninstall-data:
-	$(RM) -r "$(DATADIR)"
+	$(RM) -r "$(LAVCDATADIR)"
 
 uninstall-man:
 	$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))


-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4




More information about the ffmpeg-devel mailing list