[packages/libloc] Raw from FC, unfinished

arekm arekm at pld-linux.org
Mon Jun 2 17:34:34 CEST 2025


commit bf89709506902667a615e164a4c589820b3eeff7
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Jun 2 17:05:22 2025 +0200

    Raw from FC, unfinished

 libloc.spec | 246 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 246 insertions(+)
---
diff --git a/libloc.spec b/libloc.spec
new file mode 100644
index 0000000..1f0094c
--- /dev/null
+++ b/libloc.spec
@@ -0,0 +1,246 @@
+%bcond_without	tests
+Summary:	Library to determine a location of an IP address in the Internet
+Name:		libloc
+Version:	0.9.18
+Release:	0.1
+License:	LGPL v2.1+
+URL:		https://location.ipfire.org/
+Source0:	https://source.ipfire.org/releases/libloc/%{name}-%{version}.tar.gz
+# Source0-md5:	add56bc1ac8d9c06d78aeea539d6aff3
+Patch0:		%{name}-0.9.18-address-Fix-endianess-problem-when-fetching-octets-i.patch
+BuildRequires:	asciidoc
+BuildRequires:	autoconf >= 2.60
+# autoconf-archive for unbundled m4/ax_prog_perl_modules.m4
+BuildRequires:	autoconf-archive
+BuildRequires:	automake >= 1.11
+BuildRequires:	coreutils
+# DocBook XSLT URL used in Makefile.am is redirected to local file sytem by
+# an XML catalog of docbook-style-xsl.
+BuildRequires:	docbook-style-xsl
+BuildRequires:	gcc
+# grep is called from po/Makefile supplied with intltool
+# gnulib-devel for unbundled m4/ld-version-script.m4
+BuildRequires:	gnulib-devel
+BuildRequires:	intltool >= 0.40.0
+BuildRequires:	libtool
+# libxslt for xsltproc program
+BuildRequires:	libxslt
+BuildRequires:	lua-rpm-macros
+BuildRequires:	perl-base
+BuildRequires:	perl-devel
+BuildRequires:	perl-devel
+BuildRequires:	perl-generators
+BuildRequires:	perl-interpreter
+BuildRequires:	pkgconf-m4
+# pkgconf-pkg-config for pkg-config program
+BuildRequires:	bash-completion-devel
+BuildRequires:	lua54-devel
+BuildRequires:	openssl-devel
+BuildRequires:	pkgconf-pkg-config
+BuildRequires:	pkgconfig(python) >= 3.4
+BuildRequires:	systemd-devel
+# pkgconfig(systemd) not needed, we configure a value from systemd-rpm-macros
+BuildRequires:	python3-devel
+BuildRequires:	systemd-rpm-macros
+# Run-time:
+BuildRequires:	perl-base
+BuildRequires:	perl-base
+BuildRequires:	perl-base
+BuildRequires:	perl-base
+# python3-psycopg not used at tests
+# Tests:
+# lua executable is used by m4/ax_prog_lua_modules.m4, but pointless because
+# LuaUnit <https://github.com/bluebird75/luaunit> is not yet packaged.
+BuildRequires:	perl-modules
+
+%description
+This is a lightweight library which can be used to query the IPFire
+Location database.
+
+%package devel
+Summary:	Developmental files for libloc C library
+Requires:	%{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+This package contains header files and other files helpful when
+developing applications using libloc library.
+
+%package -n lua-%{name}
+Summary:	Lua interface to libloc library
+License:	LGPL-2.1-or-later
+Requires:	%{name}%{?_isa} = %{version}-%{release}
+
+%description -n lua-%{name}
+This is Lua binding to libloc, a library to determine an IP address
+location in the Internet.
+
+%package -n perl-%{name}
+Summary:	Perl interface to libloc library
+License:	LGPL-2.1-or-later AND (GPL-1.0-or-later OR Artistic-1.0-Perl)
+Requires:	%{name}%{?_isa} = %{version}-%{release}
+
+%description -n perl-%{name}
+Location is a Perl interface to libloc, a library to determine an IP
+address location in the Internet.
+
+%package -n python3-%{name}
+Summary:	Python interface to libloc library
+License:	LGPL-2.1-or-later AND CC-BY-SA-4.0
+Requires:	%{name}%{?_isa} = %{version}-%{release}
+
+%description -n python3-%{name}
+This is Python binding to libloc, a library to determine an IP address
+location in the Internet.
+
+%package tools
+Summary:	Tools for downloading and querying IPFire Location database
+Requires:	python3-%{name} = %{version}-%{release}
+BuildArch:	noarch
+Recommends:	%{name}-tools-bash-completion = %{version}-%{release}
+
+%description tools
+"location" program retrieves information from the location database.
+This data can be used to determine a location of an IP address in the
+Internet and for building firewall rules to block access from certain
+autonomous systems or countries. There is also an integration with
+systemd which helps updating the location database periodically.
+
+%package tools-bash-completion
+Summary:	Bash completion support for IPFire location tools
+Requires:	%{name}-tools = %{version}-%{release}
+Requires:	bash-completion
+BuildArch:	noarch
+
+%description tools-bash-completion
+This package implements Bash completion scripts for IPFire location
+tools.
+
+%prep
+%setup -q
+
+# Unbundle m4 macros
+rm m4/ax_prog_perl_modules.m4 m4/ld-version-script.m4
+
+%build
+autoreconf -fi -I%{_datadir}/gnulib/m4
+
+%configure \
+	--disable-analyzer \
+	--enable-bash-completion \
+	--with-database-path=/var/lib/location/database.db \
+	--enable-debug \
+	--enable-largefile \
+	--enable-ld-version-script \
+	--enable-lua \
+	--enable-man_pages \
+	--enable-nls \
+	--enable-perl \
+	--enable-shared \
+	--disable-silent-rules \
+	--disable-static \
+	--with-systemd \
+	--with-systemdsystemunitdir=%{systemdunitdir}
+
+%{__make}
+
+%if %{with tests}
+unset LOC_LOG
+%{__make} check || (cat ./test-suite.log; exit 1)
+%endif
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+# Remove libtool archives
+find $RPM_BUILD_ROOT -name '*.la' -delete
+
+# Correct Perl permissions
+%{_fixperms} $RPM_BUILD_ROOT/*
+
+# Create Python dist-info metadata
+install -d $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{name}-%{version}.dist-info
+cat <<'EOF' >$RPM_BUILD_ROOT%{py3_sitescriptdir}/%{name}-%{version}.dist-info/WHEEL
+Wheel-Version: 1.0
+Generator: handmade
+Root-Is-Purelib: false
+Tag: py3-none-any
+EOF
+
+cat <<'EOF' >$RPM_BUILD_ROOT%{py3_sitescriptdir}/%{name}-%{version}.dist-info/METADATA
+Metadata-Version: 2.1
+Name: %{name}
+Version: %{version}
+Home-page: %{url}
+Requires-Dist: psycopg
+EOF
+
+# Gather NLS files
+%find_lang %{name}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post tools
+%systemd_post location-update.service
+
+%preun tools
+%systemd_preun location-update.service
+
+%postun tools
+%systemd_postun_with_restart location-update.service
+
+%files -f %{name}.lang
+%defattr(644,root,root,755)
+%doc COPYING
+%doc debian/changelog README.md
+%{_libdir}/libloc.so.1
+%{_libdir}/libloc.so.1.*
+
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/libloc
+%{_libdir}/libloc.so
+%{_pkgconfigdir}
+%{_mandir}/man3/libloc.3*
+%{_mandir}/man3/loc_*.3*
+
+%files -n lua-%{name}
+%defattr(644,root,root,755)
+%{lua_libdir}/location.so
+
+%files -n perl-%{name}
+%defattr(644,root,root,755)
+%{perl_vendorarch}/auto/Location
+%{perl_vendorarch}/Location.pm
+%{_mandir}/man3/Location.3pm*
+
+%files -n python3-%{name}
+%defattr(644,root,root,755)
+%doc examples/python/*
+%{py3_sitescriptdir}/location
+%{py3_sitescriptdir}/%{name}-%{version}.dist-info
+%{py3_sitedir}/_location.so
+# The default path is compiled into _location.so Python module. Not into
+# C libloc.so. Thus the database belongs here, to Python package.
+%dir %{_sharedstatedir}/location
+%{_sharedstatedir}/location/signing-key.pem
+# User can update the database later from the Internet.
+%attr(444, root, root) %verify(not filedigest mtime size) /var/lib/location/database.db
+
+%files tools
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/location*
+%{_mandir}/man1/location.1*
+%{systemdunitdir}/location-update.*
+
+%files tools-bash-completion
+%defattr(644,root,root,755)
+%{bash_compdir}/location
+
+%changelog
+* Tue Mar 11 2025 Petr Pisar <ppisar at redhat.com> - 0.9.18-1
+- 0.9.18 bump
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libloc.git/commitdiff/bf89709506902667a615e164a4c589820b3eeff7



More information about the pld-cvs-commit mailing list