]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - lfs/libloc
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / lfs / libloc
CommitLineData
d938509e
SS
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
5a1b6efa 4# Copyright (C) 2007-2024 IPFire Team <info@ipfire.org> #
d938509e
SS
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
25include Config
26
0d46ef0c 27VER = 0.9.17
5a1b6efa 28DB_DATE = 2024-02-17
d938509e 29
fb47a9be
SS
30THISAPP = libloc-$(VER)
31DL_FILE = $(THISAPP).tar.gz
d938509e 32DL_FROM = $(URL_IPFIRE)
c3b612bb 33DIR_APP = $(DIR_SRC)/libloc-$(VER)
d938509e
SS
34TARGET = $(DIR_INFO)/$(THISAPP)
35
36###############################################################################
37# Top-level Rules
38###############################################################################
39
2da9d3f2
SS
40objects = $(DL_FILE) \
41 location-$(DB_DATE).db.xz
d938509e 42
f31c8d2a 43$(DL_FILE) = https://source.ipfire.org/releases/libloc/$(DL_FILE)
2da9d3f2
SS
44location-$(DB_DATE).db.xz = https://location.ipfire.org/databases/1/archive/location-$(DB_DATE).db.xz
45
0d46ef0c 46$(DL_FILE)_BLAKE2 = b0bf860ebaccd3cb49c58c066c430f7a1f936a2029957db9b88e22c04240af0268a8f6388e8ca512102f14033037a2ab8bbb93fe83e525b9859c790c5c382df4
5a1b6efa 47location-$(DB_DATE).db.xz_BLAKE2 = 36432bed306871e96a741d364fdefaa677d47245e38596d1c7fb6a8f0a143e3ffa549e16effa58289b5481220b0a2560255e75b0bfe53219b1400d6d250aa02b
d938509e 48
d938509e
SS
49install : $(TARGET)
50
51check : $(patsubst %,$(DIR_CHK)/%,$(objects))
52
53download :$(patsubst %,$(DIR_DL)/%,$(objects))
54
9a7e4d85 55b2 : $(subst %,%_BLAKE2,$(objects))
d938509e
SS
56
57dist:
58 @$(PAK)
59
60###############################################################################
9a7e4d85 61# Downloading, checking, b2sum
d938509e
SS
62###############################################################################
63
64$(patsubst %,$(DIR_CHK)/%,$(objects)) :
65 @$(CHECK)
66
67$(patsubst %,$(DIR_DL)/%,$(objects)) :
68 @$(LOAD)
69
9a7e4d85
PM
70$(subst %,%_BLAKE2,$(objects)) :
71 @$(B2SUM)
d938509e
SS
72
73###############################################################################
74# Installation Details
75###############################################################################
76
77$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
78 @$(PREBUILD)
79 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xvf $(DIR_DL)/$(DL_FILE)
0d0bfd0e 80
f964e925 81 # https://lists.ipfire.org/pipermail/development/2022-November/014763.html
0d46ef0c 82 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/libloc-0.9.17-Revert-Install-Perl-files-to-Perl-vendor-directory.patch
0d0bfd0e 83
fb47a9be 84 cd $(DIR_APP) && ./autogen.sh
d938509e
SS
85 cd $(DIR_APP) && ./configure \
86 --prefix=/usr \
f964e925 87 --libdir=/usr/lib \
c3b612bb
SS
88 --sysconfdir=/etc \
89 --localstatedir=/var \
0d0bfd0e
PM
90 --disable-man-pages \
91 --with-database-path=/var/lib/location/database.db
d938509e
SS
92 cd $(DIR_APP) && make $(MAKETUNING)
93 cd $(DIR_APP) && make install
2da9d3f2
SS
94
95 # Copy database to correct location.
96 cd $(DIR_APP) && cp -avf $(DIR_DL)/location-$(DB_DATE).db.xz /var/lib/location/database.db.xz
97
98 # Uncompress database.
be03f103 99 cd $(DIR_APP) && rm -f /var/lib/location/database.db
2da9d3f2
SS
100 cd $(DIR_APP) && xz -d /var/lib/location/database.db.xz
101
5108775b
SS
102 # Create directory for ipset databases.
103 cd $(DIR_APP) && mkdir -pv /var/lib/location/ipset
104
105 # Launch location util and export all locations in ipset compatible format.
2da9d3f2 106 cd $(DIR_APP) && /usr/bin/location export \
5108775b 107 --directory=/var/lib/location/ipset \
2da9d3f2 108 --family=ipv4 \
5108775b 109 --format=ipset
2da9d3f2
SS
110
111 # Remove exported IPv6 zones.
5108775b 112 cd $(DIR_APP) && rm -rvf /var/lib/location/ipset/*.ipset6
2da9d3f2 113
d938509e
SS
114 @rm -rf $(DIR_APP)
115 @$(POSTBUILD)