]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Makefile.ffmpeg,hdhomerun: add sha1sum tests to avoid hijacking
authorJaroslav Kysela <perex@perex.cz>
Wed, 15 Oct 2014 09:14:11 +0000 (11:14 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 15 Oct 2014 09:14:11 +0000 (11:14 +0200)
Makefile.ffmpeg
Makefile.hdhomerun

index ac269812b2001a1bf0100e9a7b8d7d0faf8e9851..9a05196aca60ac4abd0a7cfd86d3e02f0dd2c23a 100644 (file)
@@ -29,6 +29,12 @@ define DOWNLOAD
           file=$$(basename $(2)); \
           cp "$$TVHEADEND_FILE_CACHE/$$(file)" $(2); \
         fi
+       @{ \
+         sum=$$(sha1sum $(2) | cut -d ' ' -f 1); \
+         printf "SHA1SUM test '$${sum}' == '$(3)': "; \
+         test "y$${sum}" == "y$(3)"; \
+       }
+       @echo "OK"
 endef
 
 define UNTAR
@@ -45,6 +51,7 @@ ELIBS           = -L$(LIBAVDIR)/build/ffmpeg/lib -ldl
 FFMPEG          = ffmpeg-2.4.2
 FFMPEG_TB       = $(FFMPEG).tar.bz2
 FFMPEG_URL      = http://ffmpeg.org/releases/$(FFMPEG_TB)
+FFMPEG_SHA1     = 8fedc6f235d8510f716bca1784faa8cbe5d9cf78
 
 EXTLIBS         = libx264 libvorbis libvpx
 COMPONENTS      = avutil avformat avcodec swresample swscale avresample
@@ -55,22 +62,27 @@ MUXERS          = mpegts mpeg2dvd
 LIBOGG          = libogg-1.3.2
 LIBOGG_TB       = $(LIBOGG).tar.gz
 LIBOGG_URL      = http://downloads.xiph.org/releases/ogg/$(LIBOGG_TB)
+LIBOGG_SHA1     = df7f3977bbeda67306bc2a427257dd7375319d7d
 
 LIBVORBIS       = libvorbis-1.3.4
 LIBVORBIS_TB    = $(LIBVORBIS).tar.gz
 LIBVORBIS_URL   = http://downloads.xiph.org/releases/vorbis/$(LIBVORBIS_TB)
+LIBVORBIS_SHA1  = 1602716c187593ffe4302124535240cec2079df3
 
 LIBX264         = x264-snapshot-20141012-2245
 LIBX264_TB      = $(LIBX264).tar.bz2
 LIBX264_URL     = ftp://ftp.videolan.org/pub/x264/snapshots/$(LIBX264_TB)
+LIBX264_SHA1    = 392cd6b0e723192e009d731fe44db01b55c97fba
 
 LIBVPX          = libvpx-v1.3.0
 LIBVPX_TB       = $(LIBVPX).tar.bz2
 LIBVPX_URL      = https://webm.googlecode.com/files/$(LIBVPX_TB)
+LIBVPX_SHA1     = 191b95817aede8c136cc3f3745fb1b8c50e6d5dc
 
 YASM            = yasm-1.3.0
 YASM_TB         = $(YASM).tar.gz
 YASM_URL        = http://www.tortall.net/projects/yasm/releases/$(YASM_TB)
+YASM_SHA1       = b7574e9f0826bedef975d64d3825f75fbaeef55e
 
 .PHONY: build
 build: $(LIBAVDIR)/$(FFMPEG)/.tvh_build
@@ -80,7 +92,7 @@ build: $(LIBAVDIR)/$(FFMPEG)/.tvh_build
 #
 
 $(LIBAVDIR)/$(YASM)/.tvh_download:
-       $(call DOWNLOAD,$(YASM_URL),$(LIBAVDIR)/$(YASM_TB))
+       $(call DOWNLOAD,$(YASM_URL),$(LIBAVDIR)/$(YASM_TB),$(YASM_SHA1))
        $(call UNTAR,$(YASM_TB),z)
        @touch $@
 
@@ -97,7 +109,7 @@ $(LIBAVDIR)/$(YASM)/.tvh_build: \
 #
 
 $(LIBAVDIR)/$(LIBOGG)/.tvh_download:
-       $(call DOWNLOAD,$(LIBOGG_URL),$(LIBAVDIR)/$(LIBOGG_TB))
+       $(call DOWNLOAD,$(LIBOGG_URL),$(LIBAVDIR)/$(LIBOGG_TB),$(LIBOGG_SHA1))
        $(call UNTAR,$(LIBOGG_TB),z)
        @touch $@
 
@@ -114,7 +126,7 @@ $(LIBAVDIR)/$(LIBOGG)/.tvh_build: \
 
 $(LIBAVDIR)/$(LIBVORBIS)/.tvh_download: \
                $(LIBAVDIR)/$(LIBOGG)/.tvh_download
-       $(call DOWNLOAD,$(LIBVORBIS_URL),$(LIBAVDIR)/$(LIBVORBIS_TB))
+       $(call DOWNLOAD,$(LIBVORBIS_URL),$(LIBAVDIR)/$(LIBVORBIS_TB),$(LIBVORBIS_SHA1))
        $(call UNTAR,$(LIBVORBIS_TB),z)
        @touch $@
 
@@ -150,7 +162,7 @@ $(LIBAVDIR)/$(LIBX264)/.tvh_build: $(LIBAVDIR)/$(LIBX264)/.tvh_download
 else
 
 $(LIBAVDIR)/$(LIBX264)/.tvh_download:
-       $(call DOWNLOAD,$(LIBX264_URL),$(LIBAVDIR)/$(LIBX264_TB))
+       $(call DOWNLOAD,$(LIBX264_URL),$(LIBAVDIR)/$(LIBX264_TB),$(LIBX264_SHA1))
        #rm -rf $(LIBAVDIR)/x264-snapshot-*
        $(call UNTAR,$(LIBX264_TB),j)
        #{ ln -sf $$(basename $(LIBAVDIR)/x264-snapshot-*) $(LIBAVDIR)/$(LIBX264); }
@@ -181,7 +193,7 @@ endif
 
 $(LIBAVDIR)/$(LIBVPX)/.tvh_download:
        @mkdir -p $(LIBAVDIR)
-       $(call DOWNLOAD,$(LIBVPX_URL),$(LIBAVDIR)/$(LIBVPX_TB))
+       $(call DOWNLOAD,$(LIBVPX_URL),$(LIBAVDIR)/$(LIBVPX_TB),$(LIBVPX_SHA1))
        $(call UNTAR,$(LIBVPX_TB),j)
        @touch $@
 
@@ -202,7 +214,7 @@ $(LIBAVDIR)/$(LIBVPX)/.tvh_build: \
 
 $(LIBAVDIR)/$(FFMPEG)/.tvh_download:
        @mkdir -p $(LIBAVDIR)/build
-       $(call DOWNLOAD,$(FFMPEG_URL),$(LIBAVDIR)/$(FFMPEG_TB))
+       $(call DOWNLOAD,$(FFMPEG_URL),$(LIBAVDIR)/$(FFMPEG_TB),$(FFMPEG_SHA1))
        $(call UNTAR,$(FFMPEG_TB),j)
        @touch $@
 
index 85585da82a8bae3e87cb71e1999abbb39a0993a9..367616d9a034fcc4d609e4ec583cce111c8fc2f9 100644 (file)
@@ -29,6 +29,12 @@ define DOWNLOAD
           file=$$(basename $(2)); \
           cp "$$TVHEADEND_FILE_CACHE/$$(file)" $(2); \
         fi
+        @{ \
+         sum=$$(sha1sum $(2) | cut -d ' ' -f 1); \
+          printf "SHA1SUM test '$${sum}' == '$(3)': "; \
+          test "y$${sum}" == "y$(3)"; \
+        }
+       @echo "OK"
 endef
 
 define UNTAR
@@ -42,6 +48,7 @@ export PATH := $(LIBHDHRDIR)/build/bin:$(PATH)
 LIBHDHR         = libhdhomerun_20140604
 LIBHDHR_TB      = $(LIBHDHR).tgz
 LIBHDHR_URL     = http://download.silicondust.com/hdhomerun/$(LIBHDHR_TB)
+LIBHDHR_SHA1    = b8d910a5721c484a30b81662fd6991e3546ed67c
 
 .PHONY: build
 build: $(LIBHDHRDIR)/$(LIBHDHR)/.tvh_build
@@ -61,7 +68,7 @@ $(LIBHDHRDIR)/$(LIBHDHR)/libhdhomerun.a: $(OBJS)
        $(AR) rcs $@ $^
 
 $(LIBHDHRDIR)/$(LIBHDHR)/.tvh_download:
-       $(call DOWNLOAD,$(LIBHDHR_URL),$(LIBHDHRDIR)/$(LIBHDHR_TB))
+       $(call DOWNLOAD,$(LIBHDHR_URL),$(LIBHDHRDIR)/$(LIBHDHR_TB),$(LIBHDHR_SHA1))
        $(call UNTAR,$(LIBHDHR_TB),z)
        ln -sf libhdhomerun $(LIBHDHRDIR)/$(LIBHDHR)
        @touch $@