b1feb0152c3352cc0457124ac242071ebf5d547d
[people/teissler/ipfire-2.x.git] / lfs / vdr
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 VER = 2.0.1
28 VDRPLUGVER = 2.0.0
29 THISAPP = vdr-$(VER)
30 DL_FILE = $(THISAPP).tar.bz2
31
32 DL_FROM = $(URL_IPFIRE)
33 DIR_APP = $(DIR_SRC)/$(THISAPP)
34 TARGET = $(DIR_INFO)/$(THISAPP)
35 PROG = vdr
36 PAK_VER = 7
37
38 DEPS = "vdr_streamdev"
39
40 MAKE_OPTIONS = \
41 PREFIX=/usr \
42 BINDIR=/usr/bin \
43 CACHEDIR=/var/cache/vdr \
44 CONFDIR=/etc/vdr \
45 INCDIR=/usr/include \
46 LIBDIR=/usr/lib/vdr \
47 LOCDIR=/usr/share/locale \
48 MANDIR=/usr/share/man \
49 RESDIR=/usr/share/vdr \
50 RUNDIR=/var/run \
51 VARDIR=/var \
52 VIDEODIR=/var/video \
53 CFLAGS="$(CFLAGS)" \
54 CXXFLAGS="$(CXXFLAGS)"
55
56 ###############################################################################
57 # Top-level Rules
58 ###############################################################################
59
60 objects = $(DL_FILE)
61
62 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
63
64 $(DL_FILE)_MD5 = e1b7a76c57c96300829dccd39eb20e7d
65
66 install : $(TARGET)
67
68 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
69
70 download : $(patsubst %,$(DIR_DL)/%,$(objects))
71
72 md5 : $(subst %,%_MD5,$(objects))
73
74 dist:
75 @$(PAK)
76
77 ###############################################################################
78 # Downloading, checking, md5sum
79 ###############################################################################
80
81 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
82 @$(CHECK)
83
84 $(patsubst %,$(DIR_DL)/%,$(objects)) :
85 @$(LOAD)
86
87 $(subst %,%_MD5,$(objects)) :
88 @$(MD5)
89
90 ###############################################################################
91 # Installation Details
92 ###############################################################################
93
94 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
95 @$(PREBUILD)
96 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
97
98 # Compile main package.
99 cd $(DIR_APP) && make $(MAKE_OPTIONS) $(MAKETUNING) vdr include-dir
100
101 # Compile bundled plugins.
102 #cd $(DIR_APP) && for plugin in ...; do \
103 # make $(MAKETUNING) -C PLUGINS/src/$$plugin VDRDIR=$(DIR_APP) \
104 # CFLAGS="$(CFLAGS) -I$(DIR_APP)/include" \
105 # CXXFLAGS="$(CXXFLAGS) -I$(DIR_APP)/include" \
106 # PLGCFG=$(DIR_APP)/plugins.mk all || exit 1; \
107 #done
108
109 # Install main package.
110 cd $(DIR_APP) && make install-bin install-dirs install-includes $(MAKE_OPTIONS)
111 mv -v /usr/bin/vdr /usr/sbin/vdr
112
113 sed -e "s/VDR_PLUGIN_VERSION/$(VDRPLUGVER)/" \
114 < $(DIR_SRC)/config/vdr/runvdr > /usr/sbin/runvdr
115 chmod 755 /usr/sbin/runvdr
116
117 # Install configuration.
118 mkdir -pv /etc/vdr
119 mkdir -pv /etc/sysconfig/vdr-plugins.d
120 cd $(DIR_APP) && install -m 644 $(DIR_SRC)/config/vdr/vdr.sysconfig \
121 /etc/sysconfig/vdr
122 cd $(DIR_APP) && install -m 644 *.conf /etc/vdr
123
124 # Link development files.
125 mkdir -pv /usr/lib/vdr
126 cd $(DIR_APP) && cp -vf Make.global /usr/lib/vdr
127 ln -svf ../../include/vdr/config.h /usr/lib/vdr/config.h
128 ln -svf ../../include/vdr/device.h /usr/lib/vdr/device.h
129
130 # Install start links and backup include file.
131 ln -sf ../init.d/vdr /etc/rc.d/rc3.d/S60vdr
132 ln -sf ../init.d/vdr /etc/rc.d/rc0.d/K40vdr
133 ln -sf ../init.d/vdr /etc/rc.d/rc6.d/K40vdr
134 install -v -m 644 $(DIR_SRC)/config/backup/includes/vdr \
135 /var/ipfire/backup/addons/includes/vdr
136
137 @rm -rf $(DIR_APP)
138 @$(POSTBUILD)