]> git.ipfire.org Git - location/fedora/libloc.git/blob - libloc.spec
0.9.17 bump
[location/fedora/libloc.git] / libloc.spec
1 Name: libloc
2 Version: 0.9.17
3 Release: 1%{?dist}
4 Summary: Library to determine a location of an IP address in the Internet
5 # bash-completion/location: LGPL-2.1-or-later
6 # COPYING: LGPL-2.1 text
7 # data/database.db: CC-BY-SA-4.0
8 # man/libloc.txt: LGPL-2.1-or-later
9 # po/de.po: "same as libloc"
10 # src/address.c: LGPL-2.1-or-later
11 # src/as.c: LGPL-2.1-or-later
12 # src/as-list.c: LGPL-2.1-or-later
13 # src/country.c: LGPL-2.1-or-later
14 # src/country-list.c: LGPL-2.1-or-later
15 # src/database.c: LGPL-2.1-or-later
16 # src/libloc.c: LGPL-2.1-or-later
17 # src/libloc/address.h: LGPL-2.1-or-later
18 # src/libloc/as.h: LGPL-2.1-or-later
19 # src/libloc/as-list.h: LGPL-2.1-or-later
20 # src/libloc/compat.h: LGPL-2.1-or-later
21 # src/libloc/country.h: LGPL-2.1-or-later
22 # src/libloc/country-list.h: LGPL-2.1-or-later
23 # src/libloc/database.h: LGPL-2.1-or-later
24 # src/libloc/format.h: LGPL-2.1-or-later
25 # src/libloc/libloc.h: LGPL-2.1-or-later
26 # src/libloc/network.h: LGPL-2.1-or-later
27 # src/libloc/network-list.h: LGPL-2.1-or-later
28 # src/libloc/private.h: LGPL-2.1-or-later
29 # src/libloc/resolv.h: LGPL-2.1-or-later
30 # src/libloc/stringpool.h: LGPL-2.1-or-later
31 # src/libloc/writer.h: LGPL-2.1-or-later
32 # src/network.c: LGPL-2.1-or-later
33 # src/network-list.c: LGPL-2.1-or-later
34 # src/perl/lib/Location.pm: GPL-1.0-or-later OR Artistic-1.0-Perl
35 # src/python/as.h: LGPL-2.1-or-later
36 # src/python/country.c: LGPL-2.1-or-later
37 # src/python/country.h: LGPL-2.1-or-later
38 # src/python/database.c: LGPL-2.1-or-later
39 # src/python/database.h: LGPL-2.1-or-later
40 # src/python/location/__init__.py: LGPL-2.1-or-later
41 # src/python/location/downloader.py: LGPL-2.1-or-later
42 # src/python/location/export.py: LGPL-2.1-or-later
43 # src/python/location/i18n.py: LGPL-2.1-or-later
44 # src/python/location/importer.py: LGPL-2.1-or-later
45 # src/python/location/logger.py: LGPL-2.1-or-later
46 # src/python/locationmodule.c: LGPL-2.1-or-later
47 # src/python/locationmodule.h: LGPL-2.1-or-later
48 # src/python/network.c LGPL-2.1-or-later
49 # src/python/network.h: LGPL-2.1-or-later
50 # src/python/writer.c: LGPL-2.1-or-later
51 # src/python/writer.h: LGPL-2.1-or-later
52 # src/resolv.c: LGPL-2.1-or-later
53 # src/scripts/location.in: LGPL-2.1-or-later
54 # src/scripts/location-importer.in: LGPL-2.1-or-later
55 # src/stringpool.c: LGPL-2.1-or-later
56 # src/writer.c: LGPL-2.1-or-later
57 # tests/python/test-database.py: LGPL-2.1-or-later
58 # tests/python/test-export.py: LGPL-2.1-or-later
59 ## Used at build-time but not in any binary package
60 # m4/attributes.m4: GPL-2.0-or-later WITH Autoconf-exception-2.0 (?)
61 # src/perl/Makefile.PL: "lgpl" (probably a mistake)
62 # src/test-address.c: GPL-2.0-or-later
63 # src/test-as.c: GPL-2.0-or-later
64 # src/test-country.c: GPL-2.0-or-later
65 # src/test-database.c: GPL-2.0-or-later
66 # src/test-libloc.c: GPL-2.0-or-later
67 # src/test-network.c: GPL-2.0-or-later
68 # src/test-network-list.c: GPL-2.0-or-later
69 # src/test-signature.c: GPL-2.0-or-later
70 # src/test-stringpool.c: GPL-2.0-or-later
71 ## Unbundled, then used only at build-time, not in any binary package
72 # m4/ax_prog_perl_modules.m4: FSFAP
73 # m4/ld-version-script.m4: FSFULLR
74 ## Not used and not in any binary package
75 # debian/copyright: LGPL-2.1-or-later
76 # src/cron/location-update.in: LGPL-2.1-or-later
77 License: LGPL-2.1-or-later
78 URL: https://location.ipfire.org/
79 Source0: https://source.ipfire.org/releases/%{name}/%{name}-%{version}.tar.gz
80 BuildRequires: asciidoc
81 BuildRequires: autoconf >= 2.60
82 # autoconf-archive for unbundled m4/ax_prog_perl_modules.m4
83 BuildRequires: autoconf-archive
84 BuildRequires: automake >= 1.11
85 BuildRequires: coreutils
86 # DocBook XSLT URL used in Makefile.am is redirected to local file sytem by
87 # an XML catalog of docbook-style-xsl.
88 BuildRequires: docbook-style-xsl
89 BuildRequires: findutils
90 BuildRequires: gcc
91 # grep is called from po/Makefile supplied with intltool
92 BuildRequires: grep
93 # gnulib-devel for unbundled m4/ld-version-script.m4
94 BuildRequires: gnulib-devel
95 BuildRequires: intltool >= 0.40.0
96 BuildRequires: libtool
97 # libxslt for xsltproc program
98 BuildRequires: libxslt
99 BuildRequires: make
100 BuildRequires: openssl-devel
101 BuildRequires: perl-devel
102 BuildRequires: perl-generators
103 BuildRequires: perl-interpreter
104 BuildRequires: perl(Config)
105 BuildRequires: perl(ExtUtils::MakeMaker)
106 BuildRequires: pkgconf-m4
107 # pkgconf-pkg-config for pkg-config program
108 BuildRequires: pkgconf-pkg-config
109 BuildRequires: pkgconfig(bash-completion)
110 BuildRequires: pkgconfig(libsystemd)
111 BuildRequires: pkgconfig(python) >= 3.4
112 # pkgconfig(systemd) not needed, we configure a value from systemd-rpm-macros
113 BuildRequires: python3-devel
114 BuildRequires: sed
115 BuildRequires: systemd-rpm-macros
116 # Run-time:
117 BuildRequires: perl(Exporter)
118 BuildRequires: perl(strict)
119 BuildRequires: perl(warnings)
120 BuildRequires: perl(XSLoader)
121 # python3-psycopg2 not used at tests
122 # Tests:
123 BuildRequires: perl(Test::More)
124
125 %description
126 This is a lightweight library which can be used to query the IPFire Location
127 database.
128
129 %package devel
130 Summary: Developmental files for libloc C library
131 Requires: %{name}%{?_isa} = %{version}-%{release}
132
133 %description devel
134 This package contains header files and other files helpful when developing
135 applications using libloc library.
136
137 %package -n perl-%{name}
138 Summary: Perl interface to libloc library
139 License: LGPL-2.1-or-later AND (GPL-1.0-or-later OR Artistic-1.0-Perl)
140 Requires: %{name}%{?_isa} = %{version}-%{release}
141
142 %description -n perl-%{name}
143 Location is a Perl interface to libloc, a library to determine an IP address
144 location in the Internet.
145
146 %package -n python3-%{name}
147 Summary: Python interface to libloc library
148 License: LGPL-2.1-or-later AND CC-BY-SA-4.0
149 Requires: %{name}%{?_isa} = %{version}-%{release}
150 %py_provides python3-location
151
152 %description -n python3-%{name}
153 This is Python binding to libloc, a library to determine an IP adress location
154 in the Internet.
155
156 %package tools
157 Summary: Tools for downloading and querying IPFire Location database
158 BuildArch: noarch
159 Requires: python3-%{name} = %{version}-%{release}
160 Recommends: %{name}-tools-bash-completion = %{version}-%{release}
161
162 %description tools
163 "location" program retrieves information from the location database. This data
164 can be used to determine a location of an IP address in the Internet and for
165 building firewall rules to block access from certain autonomous systems or
166 countries. There is also an integration with systemd which helps updating the
167 location database periodically.
168
169 %package tools-bash-completion
170 Summary: Bash completion support for IPFire location tools
171 BuildArch: noarch
172 Requires: bash-completion
173 Requires: %{name}-tools = %{version}-%{release}
174
175 %description tools-bash-completion
176 This package implements Bash completion scripts for IPFire location tools.
177
178 %prep
179 %autosetup -p1
180 # Unbundle m4 macros
181 rm m4/ax_prog_perl_modules.m4 m4/ld-version-script.m4
182
183 %build
184 autoreconf -fi -I%{_datadir}/gnulib/m4
185 # Upstream moved to /var/lib/location/database.db in
186 # 14e821d483017d86d9e12486c9d9a289f4e99b0e.
187 %global default_database_file %{_sharedstatedir}/location/database.db
188 %{configure} \
189 --disable-analyzer \
190 --enable-bash-completion \
191 --with-database-path=%{default_database_file} \
192 --enable-debug \
193 --enable-largefile \
194 --enable-ld-version-script \
195 --enable-man_pages \
196 --enable-nls \
197 --enable-perl \
198 --enable-shared \
199 --disable-silent-rules \
200 --disable-static \
201 --with-systemd \
202 --with-systemdsystemunitdir=%{_unitdir}
203 %{make_build}
204
205 %install
206 %{make_install}
207 # Remove libtool archives
208 find %{buildroot} -name '*.la' -delete
209 # Correct Perl permissions
210 %{_fixperms} %{buildroot}/*
211 # Create Python dist-info metadata
212 install -d -m 0755 %{buildroot}/%{python3_sitelib}/%{name}-%{version}.dist-info
213 cat <<'EOF' >%{buildroot}/%{python3_sitelib}/%{name}-%{version}.dist-info/WHEEL
214 Wheel-Version: 1.0
215 Generator: handmade
216 Root-Is-Purelib: false
217 Tag: py3-none-any
218 EOF
219 chmod 0644 %{buildroot}/%{python3_sitelib}/%{name}-%{version}.dist-info/WHEEL
220 cat <<'EOF' >%{buildroot}/%{python3_sitelib}/%{name}-%{version}.dist-info/METADATA
221 Metadata-Version: 2.1
222 Name: %{name}
223 Version: %{version}
224 Home-page: %{url}
225 Requires-Dist: psycopg2
226 EOF
227 chmod 0644 %{buildroot}/%{python3_sitelib}/%{name}-%{version}.dist-info/METADATA
228 # Gather NLS files
229 %find_lang %{name}
230
231 %check
232 unset LOC_LOG
233 make check %{?_smp_mflags}
234
235 %post tools
236 %systemd_post location-update.service
237
238 %preun tools
239 %systemd_preun location-update.service
240
241 %postun tools
242 %systemd_postun_with_restart location-update.service
243
244 %files -f %{name}.lang
245 %license COPYING
246 %doc debian/changelog
247 %{_libdir}/libloc.so.1*
248
249 %files devel
250 %{_includedir}/libloc
251 %{_libdir}/libloc.so
252 %{_libdir}/pkgconfig
253 %{_mandir}/man3/libloc.3*
254 %{_mandir}/man3/loc_*.3*
255
256 %files -n perl-%{name}
257 %{perl_vendorarch}/auto/*
258 %{perl_vendorarch}/Location*
259 %{_mandir}/man3/Location.3pm*
260
261 %files -n python3-%{name}
262 %doc examples/python/*
263 %{python3_sitelib}/location
264 %{python3_sitelib}/%{name}-%{version}.dist-info
265 %{python3_sitearch}/_location.so
266 # The default path is compiled into _location.so Python module. Not into
267 # C libloc.so. Thus the database belongs here, to Python package.
268 %dir %{_sharedstatedir}/location
269 %{_sharedstatedir}/location/signing-key.pem
270 # User can update the database later from the Internet.
271 %attr(0444, root, root) %verify(not size filedigest mtime) %{default_database_file}
272
273 %files tools
274 %{_bindir}/location*
275 %{_mandir}/man1/location.1*
276 %{_unitdir}/location-update.*
277
278 %files tools-bash-completion
279 %{_datadir}/bash-completion/completions/location
280
281 %changelog
282 * Tue Aug 01 2023 Petr Pisar <ppisar@redhat.com> - 0.9.17-1
283 - 0.9.17 bump
284
285 * Mon Jul 24 2023 Petr Pisar <ppisar@redhat.com> - 0.9.16-6
286 - Fix "location list-networks-by-as --format ipset" output
287 (upstream bug #12897)
288 - Fix string escaping with Python 3.12 (upstream bug #13188)
289
290 * Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.16-5
291 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
292
293 * Tue Jul 11 2023 Jitka Plesnikova <jplesnik@redhat.com> - 0.9.16-4
294 - Perl 5.38 rebuild
295
296 * Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 0.9.16-3
297 - Rebuilt for Python 3.12
298
299 * Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.16-2
300 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
301
302 * Mon Oct 31 2022 Petr Pisar <ppisar@redhat.com> - 0.9.16-1
303 - 0.9.16 bump
304 - A database snapshot from 2022-10-20T06:27:23 is included
305
306 * Wed Oct 19 2022 Petr Pisar <ppisar@redhat.com> - 0.9.15-2
307 - Enable enabling debuging messages
308 - Fix make dependencies for Perl
309
310 * Tue Oct 04 2022 Petr Pisar <ppisar@redhat.com> - 0.9.15-1
311 - 0.9.15 packaged
312