tsdecrypt reads and decrypts CSA encrypted incoming mpeg transport stream over UDP/RTP using code words obtained from OSCAM or similar CAM server. tsdecrypt communicates with CAM server using cs378x (camd35 over tcp) protocol or newcamd protocol. https://georgi.unixsol.org/programs/tsdecrypt/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. CC = $(CROSS)$(TARGET)cc
  2. STRIP = $(CROSS)$(TARGET)strip
  3. MKDEP = $(CC) -M -o $*.d $<
  4. RM = /bin/rm -f
  5. BUILD_ID = $(shell date +%F_%R)
  6. VERSION = $(shell cat RELEASE)
  7. GIT_VER = $(shell git describe --tags --dirty --always 2>/dev/null)
  8. ifeq "$(GIT_VER)" ""
  9. GIT_VER = "release"
  10. endif
  11. ifndef V
  12. Q = @
  13. endif
  14. CFLAGS ?= -O2 -ggdb \
  15. -W -Wall -Wextra \
  16. -Wshadow -Wformat-security -Wstrict-prototypes
  17. DEFS = -DBUILD_ID=\"$(BUILD_ID)\" \
  18. -DVERSION=\"$(VERSION)\" -DGIT_VER=\"$(GIT_VER)\"
  19. DEFS += -DUSE_LIBDVBCSA=1
  20. PREFIX ?= /usr/local
  21. INSTALL_PRG = tsdecrypt
  22. INSTALL_PRG_DIR = $(subst //,/,$(DESTDIR)/$(PREFIX)/bin)
  23. INSTALL_DOC = tsdecrypt.1
  24. INSTALL_DOC_DIR = $(subst //,/,$(DESTDIR)/$(PREFIX)/man/man1)
  25. FUNCS_DIR = libfuncs
  26. FUNCS_LIB = $(FUNCS_DIR)/libfuncs.a
  27. TS_DIR = libtsfuncs
  28. TS_LIB = $(TS_DIR)/libtsfuncs.a
  29. tsdecrypt_SRC = data.c \
  30. csa.c \
  31. udp.c \
  32. util.c \
  33. camd.c \
  34. camd-cs378x.c \
  35. camd-newcamd.c \
  36. process.c \
  37. tables.c \
  38. notify.c \
  39. tsdecrypt.c
  40. tsdecrypt_LIBS = -lcrypto -ldvbcsa -lpthread
  41. tsdecrypt_OBJS = $(FUNCS_LIB) $(TS_LIB) $(tsdecrypt_SRC:.c=.o)
  42. ifeq "$(shell uname -s)" "Linux"
  43. tsdecrypt_LIBS += -lcrypt -lrt
  44. endif
  45. CLEAN_OBJS = tsdecrypt $(tsdecrypt_SRC:.c=.{o,d})
  46. PROGS = tsdecrypt
  47. .PHONY: distclean clean install uninstall
  48. all: $(PROGS)
  49. $(FUNCS_LIB): $(FUNCS_DIR)/libfuncs.h
  50. $(Q)echo " MAKE $(FUNCS_LIB)"
  51. $(Q)$(MAKE) -s -C $(FUNCS_DIR)
  52. $(TS_LIB): $(TS_DIR)/tsfuncs.h $(TS_DIR)/tsdata.h
  53. $(Q)echo " MAKE $(TS_LIB)"
  54. $(Q)$(MAKE) -s -C $(TS_DIR)
  55. tsdecrypt: $(tsdecrypt_OBJS)
  56. $(Q)echo " LINK tsdecrypt"
  57. $(Q)$(CC) $(CFLAGS) $(DEFS) $(tsdecrypt_OBJS) $(tsdecrypt_LIBS) -o tsdecrypt
  58. %.o: %.c RELEASE
  59. @$(MKDEP)
  60. $(Q)echo " CC tsdecrypt $<"
  61. $(Q)$(CC) $(CFLAGS) $(DEFS) -c $<
  62. -include $(tsdecrypt_SRC:.c=.d)
  63. strip:
  64. $(Q)echo " STRIP $(PROGS)"
  65. $(Q)$(STRIP) $(PROGS)
  66. clean:
  67. $(Q)echo " RM $(CLEAN_OBJS)"
  68. $(Q)$(RM) $(CLEAN_OBJS)
  69. distclean: clean
  70. $(Q)$(MAKE) -s -C $(TS_DIR) clean
  71. $(Q)$(MAKE) -s -C $(FUNCS_DIR) clean
  72. install: all strip
  73. @install -d "$(INSTALL_PRG_DIR)"
  74. @install -d "$(INSTALL_DOC_DIR)"
  75. @echo "INSTALL $(INSTALL_PRG) -> $(INSTALL_PRG_DIR)"
  76. $(Q)-install $(INSTALL_PRG) "$(INSTALL_PRG_DIR)"
  77. @echo "INSTALL $(INSTALL_DOC) -> $(INSTALL_DOC_DIR)"
  78. $(Q)-install --mode 0644 $(INSTALL_DOC) "$(INSTALL_DOC_DIR)"
  79. uninstall:
  80. @-for FILE in $(INSTALL_PRG); do \
  81. echo "RM $(INSTALL_PRG_DIR)/$$FILE"; \
  82. rm "$(INSTALL_PRG_DIR)/$$FILE"; \
  83. done
  84. @-for FILE in $(INSTALL_DOC); do \
  85. echo "RM $(INSTALL_DOC_DIR)/$$FILE"; \
  86. rm "$(INSTALL_DOC_DIR)/$$FILE"; \
  87. done