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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. PREFIX ?= /usr/local
  20. INSTALL_PRG = tsdecrypt
  21. INSTALL_PRG_DIR = $(subst //,/,$(DESTDIR)/$(PREFIX)/bin)
  22. INSTALL_DOC = tsdecrypt.1
  23. INSTALL_DOC_DIR = $(subst //,/,$(DESTDIR)/$(PREFIX)/man/man1)
  24. FUNCS_DIR = libfuncs
  25. FUNCS_LIB = $(FUNCS_DIR)/libfuncs.a
  26. TS_DIR = libtsfuncs
  27. TS_LIB = $(TS_DIR)/libtsfuncs.a
  28. tsdecrypt_SRC = data.c \
  29. udp.c \
  30. util.c \
  31. camd.c \
  32. camd-cs378x.c \
  33. camd-newcamd.c \
  34. process.c \
  35. tables.c \
  36. notify.c \
  37. tsdecrypt.c
  38. tsdecrypt_LIBS = -lcrypto -ldvbcsa -lpthread
  39. tsdecrypt_OBJS = $(FUNCS_LIB) $(TS_LIB) $(tsdecrypt_SRC:.c=.o)
  40. ifeq "$(shell uname -s)" "Linux"
  41. tsdecrypt_LIBS += -lcrypt
  42. endif
  43. CLEAN_OBJS = tsdecrypt $(tsdecrypt_SRC:.c=.{o,d})
  44. PROGS = tsdecrypt
  45. .PHONY: distclean clean install uninstall
  46. all: $(PROGS)
  47. $(FUNCS_LIB): $(FUNCS_DIR)/libfuncs.h
  48. $(Q)echo " MAKE $(FUNCS_LIB)"
  49. $(Q)$(MAKE) -s -C $(FUNCS_DIR)
  50. $(TS_LIB): $(TS_DIR)/tsfuncs.h $(TS_DIR)/tsdata.h
  51. $(Q)echo " MAKE $(TS_LIB)"
  52. $(Q)$(MAKE) -s -C $(TS_DIR)
  53. tsdecrypt: $(tsdecrypt_OBJS)
  54. $(Q)echo " LINK tsdecrypt"
  55. $(Q)$(CC) $(CFLAGS) $(DEFS) $(tsdecrypt_OBJS) $(tsdecrypt_LIBS) -o tsdecrypt
  56. %.o: %.c RELEASE
  57. @$(MKDEP)
  58. $(Q)echo " CC tsdecrypt $<"
  59. $(Q)$(CC) $(CFLAGS) $(DEFS) -c $<
  60. -include $(tsdecrypt_SRC:.c=.d)
  61. strip:
  62. $(Q)echo " STRIP $(PROGS)"
  63. $(Q)$(STRIP) $(PROGS)
  64. clean:
  65. $(Q)echo " RM $(CLEAN_OBJS)"
  66. $(Q)$(RM) $(CLEAN_OBJS)
  67. distclean: clean
  68. $(Q)$(MAKE) -s -C $(TS_DIR) clean
  69. $(Q)$(MAKE) -s -C $(FUNCS_DIR) clean
  70. install: all strip
  71. @install -d "$(INSTALL_PRG_DIR)"
  72. @install -d "$(INSTALL_DOC_DIR)"
  73. @echo "INSTALL $(INSTALL_PRG) -> $(INSTALL_PRG_DIR)"
  74. $(Q)-install $(INSTALL_PRG) "$(INSTALL_PRG_DIR)"
  75. @echo "INSTALL $(INSTALL_DOC) -> $(INSTALL_DOC_DIR)"
  76. $(Q)-install --mode 0644 $(INSTALL_DOC) "$(INSTALL_DOC_DIR)"
  77. uninstall:
  78. @-for FILE in $(INSTALL_PRG); do \
  79. echo "RM $(INSTALL_PRG_DIR)/$$FILE"; \
  80. rm "$(INSTALL_PRG_DIR)/$$FILE"; \
  81. done
  82. @-for FILE in $(INSTALL_DOC); do \
  83. echo "RM $(INSTALL_DOC_DIR)/$$FILE"; \
  84. rm "$(INSTALL_DOC_DIR)/$$FILE"; \
  85. done