~ubuntu-branches/ubuntu/wily/ntopng/wily

« back to all changes in this revision

Viewing changes to .pc/path-defaults.patch/Makefile.in

  • Committer: Package Import Robot
  • Author(s): Ludovico Cavedon
  • Date: 2014-09-09 21:57:04 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140909215704-60u1nw60de4zpbrn
Tags: 1.2.1+dfsg1-1
* Imported Upstream version 1.2.1+dfsg1 (Closes: #760990, CVE-2014-5464,
  CVE-2014-5511, CVE-2014-5512, CVE-2014-5513, CVE-2014-5514,
  CVE-2014-5515).
* Remove patches merged upstream: build-flags.patch, libndpi-external.patch,
  manpage.patch, no-svn.patch, path-defaults.patch, remove-libs.patch, and
  rickshaw.patch.
* Add no-librt.patch to avoid not needed linking against librt.
* Fix typos in copyright and removed stanzas for removed files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
SHELL=/bin/sh
2
 
OS := $(shell uname -s)
3
 
GPP=@GPP@
4
 
INSTALL_DIR=@INSTALL_DIR@
5
 
MAN_DIR=@MAN_DIR@
6
 
######
7
 
NDPI_INC=-I./nDPI/src/include
8
 
NDPI_LIB=./nDPI/src/lib/.libs/libndpi.a
9
 
######
10
 
LIBPCAP=-lpcap
11
 
######
12
 
MONGOOSE_HOME=./third-party/mongoose
13
 
MONGOOSE_INC=-I$(MONGOOSE_HOME)
14
 
######
15
 
HAS_LUAJIT=$(shell pkg-config --exists luajit; echo $$?)
16
 
ifeq ($(HAS_LUAJIT), 0)
17
 
        LUAJIT_INC = $(shell pkg-config --cflags luajit)
18
 
        LUAJIT_LIB = $(shell pkg-config --libs luajit)
19
 
else
20
 
        LUAJIT_HOME=./third-party/LuaJIT-2.0.3
21
 
        LUAJIT_INC=-I$(LUAJIT_HOME)/src
22
 
        LUAJIT_LIB=$(LUAJIT_HOME)/src/libluajit.a
23
 
endif
24
 
######
25
 
LIBRRDTOOL_HOME=third-party/rrdtool-1.4.8
26
 
HAS_LIBRRDTOOL=$(shell pkg-config --exists librrd; echo $$?)
27
 
ifeq ($(HAS_LIBRRDTOOL), 0)
28
 
        LIBRRDTOOL_INC = $(shell pkg-config --cflags librrd)
29
 
        LIBRRDTOOL_LIB = $(shell pkg-config --libs librrd)
30
 
else
31
 
        LIBRRDTOOL_INC=-I$(LIBRRDTOOL_HOME)/src/
32
 
        LIBRRDTOOL_LIB=$(LIBRRDTOOL_HOME)/src/.libs/librrd_th.a
33
 
endif
34
 
######
35
 
HTTPCLIENT_INC=third-party/http-client-c/src/
36
 
######
37
 
HAS_JSON=$(shell pkg-config --exists json-c; echo $$?)
38
 
ifeq ($(HAS_JSON), 0)
39
 
        JSON_INC = $(shell pkg-config --cflags json-c)
40
 
        JSON_LIB = $(shell pkg-config --libs json-c)
41
 
else
42
 
        JSON_HOME=third-party/json-c
43
 
        JSON_INC=-I$(JSON_HOME)
44
 
        JSON_LIB=$(JSON_HOME)/.libs/libjson-c.a
45
 
endif
46
 
######
47
 
HAS_ZEROMQ=$(shell pkg-config --exists libzmq; echo $$?)
48
 
ifeq ($(HAS_ZEROMQ), 0)
49
 
        ZEROMQ_INC = $(shell pkg-config --cflags libzmq)
50
 
        ZMQ_STATIC=/usr/local/lib/libzmq.a
51
 
        ifeq ($(wildcard $(ZMQ_STATIC)),)
52
 
                ZEROMQ_LIB = $(shell pkg-config --libs libzmq)
53
 
        else
54
 
                ZEROMQ_LIB = $(ZMQ_STATIC)
55
 
        endif
56
 
else
57
 
        ZEROMQ_HOME=./third-party/zeromq-3.2.4
58
 
        ZEROMQ_INC=-I$(ZEROMQ_HOME)/include
59
 
        ZEROMQ_LIB=$(ZEROMQ_HOME)/src/.libs/libzmq.a
60
 
endif
61
 
######
62
 
EWH_HOME=third-party/EWAHBoolArray
63
 
EWH_INC=$(EWH_HOME)/headers
64
 
######
65
 
TARGET = ntopng
66
 
LIBS = @LDFLAGS@ $(NDPI_LIB) $(LIBPCAP) $(LUAJIT_LIB) $(LIBRRDTOOL_LIB) $(ZEROMQ_LIB) $(JSON_LIB) @HIREDIS_LIB@ @SQLITE_LIB@ @LINK_OPTS@ @GEOIP_LIB@ @DL_LIB@ @NL_LIB@ -lm -lpthread
67
 
CPPFLAGS = -g @CFLAGS@ @HIREDIS_INC@ $(MONGOOSE_INC) $(JSON_INC) $(NDPI_INC) $(LUAJIT_INC) $(LIBRRDTOOL_INC) $(ZEROMQ_INC) @CPPFLAGS@ -I$(HTTPCLIENT_INC) -I$(EWH_INC) # -D_GLIBCXX_DEBUG
68
 
######
69
 
# ntopng-1.0_1234.x86_64.rpm
70
 
PLATFORM = `uname -p`
71
 
REVISION = @SVN_RELEASE@
72
 
PACKAGE_VERSION = @PACKAGE_VERSION@
73
 
NTOPNG_VERSION = @NTOPNG_VERSION@
74
 
RPM_PKG = $(TARGET)-$(NTOPNG_VERSION)-$(REVISION).$(PLATFORM).rpm
75
 
RPM_DATA_PKG = $(TARGET)-data-$(NTOPNG_VERSION)-$(REVISION).noarch.rpm
76
 
######
77
 
 
78
 
ifeq ($(OS),Darwin)
79
 
LIBS += -lstdc++.6
80
 
endif
81
 
 
82
 
LIB_TARGETS =
83
 
 
84
 
ifneq ($(HAS_LUAJIT), 0)
85
 
LIB_TARGETS += $(LUAJIT_LIB)
86
 
 endif
87
 
 
88
 
ifneq ($(HAS_ZEROMQ), 0)
89
 
LIB_TARGETS += $(ZEROMQ_LIB)
90
 
endif
91
 
 
92
 
ifneq ($(HAS_LIBRRDTOOL), 0)
93
 
LIB_TARGETS += $(LIBRRDTOOL_LIB)
94
 
endif
95
 
 
96
 
ifneq ($(HAS_JSON), 0)
97
 
LIB_TARGETS += $(JSON_LIB)
98
 
endif
99
 
 
100
 
.PHONY: default all clean docs test
101
 
 
102
 
.NOTPARALLEL: default all
103
 
 
104
 
default: $(NDPI_LIB) $(LIB_TARGETS) $(TARGET)
105
 
 
106
 
all: default
107
 
 
108
 
OBJECTS = $(patsubst %.cpp, %.o, $(wildcard *.cpp))
109
 
HEADERS = $(wildcard *.h)
110
 
 
111
 
%.o: %.c $(HEADERS) Makefile
112
 
        $(GPP) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
113
 
 
114
 
%.o: %.cpp $(HEADERS) Makefile
115
 
        $(GPP) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
116
 
 
117
 
.PRECIOUS: $(TARGET) $(OBJECTS)
118
 
 
119
 
$(TARGET): $(OBJECTS) $(LIBRRDTOOL) Makefile
120
 
        $(GPP) $(OBJECTS) -Wall $(LIBS) -o $@
121
 
 
122
 
$(NDPI_LIB): nDPI
123
 
        cd nDPI; if test ! -f Makefile; then ./autogen.sh ; ./configure; fi; make
124
 
 
125
 
nDPI:
126
 
        svn co https://svn.ntop.org/svn/ntop/trunk/nDPI/
127
 
 
128
 
$(LUAJIT_LIB):
129
 
        cd $(LUAJIT_HOME); @GMAKE@
130
 
 
131
 
$(ZEROMQ_LIB):
132
 
        cd $(ZEROMQ_HOME); ./configure --without-documentation; @GMAKE@
133
 
 
134
 
$(LIBRRDTOOL_LIB):
135
 
        cd $(LIBRRDTOOL_HOME); ./configure --disable-rrd_graph --disable-libdbi --disable-libwrap --disable-rrdcgi --disable-libtool-lock --disable-nls --disable-rpath --disable-perl --disable-ruby --disable-lua --disable-tcl --disable-python --disable-dependency-tracking; cd src; @GMAKE@ librrd_th.la
136
 
 
137
 
$(JSON_LIB):
138
 
        cd $(JSON_HOME); ./autogen.sh; ./configure; @GMAKE@
139
 
 
140
 
clean:
141
 
        -rm -f *.o *~ svn-commit.* #config.h
142
 
        -rm -f $(TARGET)
143
 
 
144
 
cert:
145
 
        openssl req -new -x509 -sha1 -extensions v3_ca -nodes -days 365 -out cert.pem
146
 
        cat privkey.pem cert.pem > httpdocs/ssl/ntopng-cert.pem
147
 
        /bin/rm -f privkey.pem cert.pem
148
 
 
149
 
veryclean:
150
 
        -rm -rf nDPI
151
 
 
152
 
 
153
 
geoip: httpdocs/geoip/GeoLiteCity.dat httpdocs/geoip/GeoLiteCityv6.dat httpdocs/geoip/GeoIPASNum.dat httpdocs/geoip/GeoIPASNumv6.dat
154
 
 
155
 
httpdocs/geoip/GeoLiteCity.dat:
156
 
        cd httpdocs/geoip; wget -nc http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz; gunzip -f GeoLiteCity.dat.gz
157
 
 
158
 
httpdocs/geoip/GeoLiteCityv6.dat:
159
 
        cd httpdocs/geoip; wget -nc http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz; gunzip -f GeoLiteCityv6.dat.gz
160
 
 
161
 
httpdocs/geoip/GeoIPASNum.dat:
162
 
        cd httpdocs/geoip; wget -nc http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz; gunzip -f GeoIPASNum.dat.gz
163
 
 
164
 
httpdocs/geoip/GeoIPASNumv6.dat:
165
 
        cd httpdocs/geoip; wget -nc http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz; gunzip -f GeoIPASNumv6.dat.gz
166
 
 
167
 
 
168
 
 
169
 
# Do NOT build package as root (http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment)
170
 
#       mkdir -p $(HOME)/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
171
 
#       echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
172
 
 
173
 
build-rpm: build-rpm-ntopng build-rpm-ntopng-data
174
 
 
175
 
 
176
 
build-rpm-ntopng:
177
 
        rm -rf ntopng-@NTOPNG_VERSION@
178
 
        mkdir ntopng-@NTOPNG_VERSION@
179
 
        cp -r doc *.cpp *.h configure COPYING README.* *.in ntopng.8 httpdocs scripts packages third-party ntopng-@NTOPNG_VERSION@
180
 
        find ntopng-@NTOPNG_VERSION@ -name ".svn" | xargs /bin/rm -rf
181
 
        cd ntopng-@NTOPNG_VERSION@; svn co https://svn.ntop.org/svn/ntop/trunk/nDPI/; cd ..
182
 
        tar cvfz ntopng-@NTOPNG_VERSION@.tgz ntopng-@NTOPNG_VERSION@
183
 
        #
184
 
        rm -f $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(RPM_PKG)
185
 
        cp ntopng-@NTOPNG_VERSION@.tgz $(HOME)/rpmbuild/SOURCES/
186
 
        #
187
 
        rpmbuild -bb ./packages/ntopng.spec
188
 
        @./packages/rpm-sign.exp $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(RPM_PKG)
189
 
        @echo ""
190
 
        @echo "Package contents:"
191
 
        @rpm -qpl $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(RPM_PKG)
192
 
        @echo "The package is now available in $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(RPM_PKG)"
193
 
        -rm -rf ntopng-@NTOPNG_VERSION@ ntopng_@NTOPNG_VERSION@.tgz
194
 
        #
195
 
 
196
 
build-rpm-ntopng-data:
197
 
        rm -rf ntopng-data-@NTOPNG_VERSION@
198
 
        mkdir -p ntopng-data-@NTOPNG_VERSION@/usr/share/ntopng/httpdocs/geoip/
199
 
        @if test -d ~/dat_files ; then \
200
 
          cp ~/dat_files/* ntopng-data-@NTOPNG_VERSION@/usr/share/ntopng/httpdocs/geoip/; \
201
 
        else \
202
 
          cp ./httpdocs/geoip/* ntopng-data-@NTOPNG_VERSION@/usr/share/ntopng/httpdocs/geoip/ ;\
203
 
        fi
204
 
        #gunzip ntopng-data-@PACKAGE_VERSION@/usr/local/share/ntopng/httpdocs/geoip/*.gz
205
 
        tar cvfz ntopng-data-@NTOPNG_VERSION@.tgz ntopng-data-@NTOPNG_VERSION@
206
 
        #
207
 
        rm -f $(HOME)/rpmbuild/RPMS/noarch/$(RPM_DATA_PKG)
208
 
        cp ntopng-data-@NTOPNG_VERSION@.tgz $(HOME)/rpmbuild/SOURCES/
209
 
        cd $(HOME)/rpmbuild/SOURCES;tar xvfz $(HOME)/rpmbuild/SOURCES/ntopng-data-@NTOPNG_VERSION@.tgz
210
 
        rpmbuild -bb ./packages/ntopng-data.spec
211
 
        @./packages/rpm-sign.exp $(HOME)/rpmbuild/RPMS/noarch/$(RPM_DATA_PKG)
212
 
        @echo ""
213
 
        @echo "Package contents:"
214
 
        @rpm -qpl $(HOME)/rpmbuild/RPMS/noarch/$(RPM_DATA_PKG)
215
 
        @echo "The package is now available in $(HOME)/rpmbuild/RPMS/noarch/$(RPM_DATA_PKG)"
216
 
        -rm -rf ntopng-data-@NTOPNG_VERSION@ ntopng-data_@NTOPNG_VERSION@.tgz
217
 
 
218
 
docs:
219
 
        cd doc && doxygen doxygen.conf
220
 
 
221
 
dist:
222
 
        rm -rf ntopng-@NTOPNG_VERSION@
223
 
        mkdir ntopng-@NTOPNG_VERSION@
224
 
        cd ntopng-@NTOPNG_VERSION@; svn co https://svn.ntop.org/svn/ntop/trunk/ntopng/; cd ntopng; svn co https://svn.ntop.org/svn/ntop/trunk/nDPI/; cd ..; mv ntopng ntopng-@NTOPNG_VERSION@; tar cvfz ../ntopng-@NTOPNG_VERSION@.tgz ntopng-@NTOPNG_VERSION@
225
 
 
226
 
install: ntopng geoip
227
 
        @echo "While we provide you an install make target, we encourage you"
228
 
        @echo "to create a package and install that"
229
 
        @echo "rpm - do 'make build-rpm'"
230
 
        @echo "deb - do 'cd packages/ubuntu;./configure;make"
231
 
        mkdir -p $(INSTALL_DIR)/share/ntopng $(MAN_DIR)/man/man8 $(INSTALL_DIR)/bin
232
 
        cp ntopng $(INSTALL_DIR)/bin
233
 
        cp ./ntopng.8 $(MAN_DIR)/man/man8
234
 
        cp -r ./httpdocs $(INSTALL_DIR)/share/ntopng
235
 
        cp -r ./scripts $(INSTALL_DIR)/share/ntopng
236
 
        find $(INSTALL_DIR)/share/ntopng -name "*~"   | xargs /bin/rm -f
237
 
        find $(INSTALL_DIR)/share/ntopng -name ".svn" | xargs /bin/rm -rf
238
 
 
239
 
uninstall:
240
 
        if test -f $(INSTALL_DIR)/bin/ntopng; then rm $(INSTALL_DIR)/bin/ntopng; fi;
241
 
        if test -f $(MAN_DIR)/man/man8/ntopng.8; then rm $(MAN_DIR)/man/man8/ntopng.8; fi;
242
 
        if test -d $(INSTALL_DIR)/share/ntopng; then rm -r $(INSTALL_DIR)/share/ntopng; fi;
243
 
 
244
 
Makefile: @SVN_WC_DB@
245
 
        @echo ""
246
 
        @echo "Re-running configure as the SVN release has changed"
247
 
        @echo ""
248
 
        ./configure
249
 
 
250
 
 
251
 
test: test_version
252
 
 
253
 
test_version:
254
 
        ./ntopng --version