]> git.ipfire.org Git - location/fedora/libloc.git/commitdiff
Import
authorPetr Písař <ppisar@redhat.com>
Thu, 13 Oct 2022 14:36:55 +0000 (16:36 +0200)
committerPetr Písař <ppisar@redhat.com>
Thu, 13 Oct 2022 14:36:55 +0000 (16:36 +0200)
Reviewed in bug #2132701.

.gitignore [new file with mode: 0644]
libloc-0.9.15-Install-Perl-files-to-Perl-vendor-directory.patch [new file with mode: 0644]
libloc-0.9.15-Makefile-Reset-Python-path.patch [new file with mode: 0644]
libloc-0.9.15-Move-location-manual-from-section-8-to-section-1.patch [new file with mode: 0644]
libloc-0.9.15-Remove-shebangs-from-Python-modules.patch [new file with mode: 0644]
libloc-0.9.15-Revert-perl-Remove-RPATH.patch [new file with mode: 0644]
libloc.spec [new file with mode: 0644]
sources [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..25b5af7
--- /dev/null
@@ -0,0 +1 @@
+/libloc-0.9.15.tar.gz
diff --git a/libloc-0.9.15-Install-Perl-files-to-Perl-vendor-directory.patch b/libloc-0.9.15-Install-Perl-files-to-Perl-vendor-directory.patch
new file mode 100644 (file)
index 0000000..d9b4f68
--- /dev/null
@@ -0,0 +1,36 @@
+From afca2e0632e78227b2a18506e64d4a1b5cd1e1a1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Tue, 4 Oct 2022 13:51:21 +0200
+Subject: [PATCH] Install Perl files to Perl vendor directory
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On Fedora, the original code placed files into /usr/lib64/perl5/5.36/.
+That location is not recognized by Fedora perl.
+
+This patch also adds NO_PACKLIST=1 NO_PERLLOCAL=1 not to create
+unnecessary files incomopatible with a RPM-driver software distribution.
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index ec737d0..ca37166 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -242,7 +242,8 @@ build-perl:
+       @test -e $(builddir)/src/perl/t/Location.t || ln -s --relative $(srcdir)/src/perl/t/Location.t $(builddir)/src/perl/t/
+       @test -e $(builddir)/src/perl/typemap || ln -s --relative $(srcdir)/src/perl/typemap $(builddir)/src/perl/
+-      cd $(builddir)/src/perl && $(PERL) Makefile.PL PREFIX="$(prefix)" \
++      cd $(builddir)/src/perl && $(PERL) Makefile.PL \
++              INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 \
+               INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc"
+       cd $(builddir)/src/perl && $(MAKE) LD_RUN_PATH=
+-- 
+2.37.3
+
diff --git a/libloc-0.9.15-Makefile-Reset-Python-path.patch b/libloc-0.9.15-Makefile-Reset-Python-path.patch
new file mode 100644 (file)
index 0000000..07c256f
--- /dev/null
@@ -0,0 +1,31 @@
+From bed4777fc99494854335a90c5a6e7fc2e30edf4d Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Sat, 1 Oct 2022 11:56:31 +0000
+Subject: [PATCH] Makefile: Reset Python path
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ Makefile.am | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 81bd992..ec737d0 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -56,8 +56,7 @@ databasedir = $(localstatedir)/lib/location
+ pkgconfigdir = $(libdir)/pkgconfig
+ # Overwrite Python path
+-#pkgpythondir = $(pythondir)/location
+-pkgpythondir = /usr/lib/python3/dist-packages/location
++pkgpythondir = $(pythondir)/location
+ %: %.in Makefile
+       $(SED_PROCESS)
+-- 
+2.37.3
+
diff --git a/libloc-0.9.15-Move-location-manual-from-section-8-to-section-1.patch b/libloc-0.9.15-Move-location-manual-from-section-8-to-section-1.patch
new file mode 100644 (file)
index 0000000..71cbd9c
--- /dev/null
@@ -0,0 +1,82 @@
+From d6f4e551d3e398a2187c5c65f47d9a34b4a69ca9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Thu, 6 Oct 2022 13:28:51 +0200
+Subject: [PATCH] Move location manual from section 8 to section 1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It's a tool a non-superuser can use. It's installed into /usr/bin.
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ Makefile.am      | 12 ++++++------
+ man/libloc.txt   |  2 +-
+ man/location.txt |  2 +-
+ 3 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 0d469d4..4a09d78 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -444,7 +444,7 @@ src_test_address_LDADD = \
+ MANPAGES = \
+       $(MANPAGES_3) \
+-      $(MANPAGES_8)
++      $(MANPAGES_1)
+ MANPAGES_3 = \
+       man/libloc.3 \
+@@ -458,12 +458,12 @@ MANPAGES_3 = \
+       man/loc_set_log_fn.3 \
+       man/loc_set_log_priority.3
+-MANPAGES_8 = \
+-      man/location.8
++MANPAGES_1 = \
++      man/location.1
+-MANPAGES_TXT   = $(MANPAGES_TXT_3) $(MANPAGES_TXT_8)
++MANPAGES_TXT   = $(MANPAGES_TXT_3) $(MANPAGES_TXT_1)
+ MANPAGES_TXT_3 = $(patsubst %.3,%.txt,$(MANPAGES_3))
+-MANPAGES_TXT_8 = $(patsubst %.8,%.txt,$(MANPAGES_8))
++MANPAGES_TXT_1 = $(patsubst %.1,%.txt,$(MANPAGES_1))
+ MANPAGES_HTML  = $(patsubst %.txt,%.html,$(MANPAGES_TXT))
+ MANPAGES_XML   = $(patsubst %.txt,%.xml,$(MANPAGES_TXT))
+@@ -511,7 +511,7 @@ man/%.xml: man/%.txt man/asciidoc.conf
+ man/%.3: man/%.xml
+       $(XSLTPROC_COMMAND_MAN)
+-man/%.8: man/%.xml
++man/%.1: man/%.xml
+       $(XSLTPROC_COMMAND_MAN)
+ man/%.html: man/%.txt man/asciidoc.conf
+diff --git a/man/libloc.txt b/man/libloc.txt
+index baf98c1..ec14e16 100644
+--- a/man/libloc.txt
++++ b/man/libloc.txt
+@@ -39,7 +39,7 @@ either version 2.1 of the License, or (at your option) any later version.
+ == See Also
+-link:location[8]
++link:location[1]
+ == Bug Reports
+diff --git a/man/location.txt b/man/location.txt
+index 3dfddf5..70352d2 100644
+--- a/man/location.txt
++++ b/man/location.txt
+@@ -1,4 +1,4 @@
+-= location(8)
++= location(1)
+ == NAME
+ location - Query the location database
+-- 
+2.37.3
+
diff --git a/libloc-0.9.15-Remove-shebangs-from-Python-modules.patch b/libloc-0.9.15-Remove-shebangs-from-Python-modules.patch
new file mode 100644 (file)
index 0000000..5a647b2
--- /dev/null
@@ -0,0 +1,88 @@
+From 61042cee994479d768649e75c08102bd6252773d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Tue, 4 Oct 2022 16:16:07 +0200
+Subject: [PATCH] Remove shebangs from Python modules
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Shebangs only belong to standalone executables.
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ src/python/location/__init__.py   | 1 -
+ src/python/location/database.py   | 2 --
+ src/python/location/downloader.py | 1 -
+ src/python/location/export.py     | 1 -
+ src/python/location/i18n.py       | 1 -
+ src/python/location/importer.py   | 1 -
+ src/python/location/logger.py     | 1 -
+ 7 files changed, 8 deletions(-)
+
+diff --git a/src/python/location/__init__.py b/src/python/location/__init__.py
+index 5d6710d..e0ba510 100644
+--- a/src/python/location/__init__.py
++++ b/src/python/location/__init__.py
+@@ -1,4 +1,3 @@
+-#!/usr/bin/python3
+ ###############################################################################
+ #                                                                             #
+ # libloc - A library to determine the location of someone on the Internet     #
+diff --git a/src/python/location/database.py b/src/python/location/database.py
+index 5d79941..b97d93a 100644
+--- a/src/python/location/database.py
++++ b/src/python/location/database.py
+@@ -1,5 +1,3 @@
+-#!/usr/bin/env python
+-
+ """
+       A lightweight wrapper around psycopg2.
+diff --git a/src/python/location/downloader.py b/src/python/location/downloader.py
+index b9e0c22..3618968 100644
+--- a/src/python/location/downloader.py
++++ b/src/python/location/downloader.py
+@@ -1,4 +1,3 @@
+-#!/usr/bin/python3
+ ###############################################################################
+ #                                                                             #
+ # libloc - A library to determine the location of someone on the Internet     #
+diff --git a/src/python/location/export.py b/src/python/location/export.py
+index 3f58498..25a532e 100644
+--- a/src/python/location/export.py
++++ b/src/python/location/export.py
+@@ -1,4 +1,3 @@
+-#!/usr/bin/python3
+ ###############################################################################
+ #                                                                             #
+ # libloc - A library to determine the location of someone on the Internet     #
+diff --git a/src/python/location/i18n.py b/src/python/location/i18n.py
+index 2161aa6..c97c51c 100644
+--- a/src/python/location/i18n.py
++++ b/src/python/location/i18n.py
+@@ -1,4 +1,3 @@
+-#!/usr/bin/python3
+ ###############################################################################
+ #                                                                             #
+ # libloc - A library to determine the location of someone on the Internet     #
+diff --git a/src/python/location/importer.py b/src/python/location/importer.py
+index 96f2218..d285162 100644
+--- a/src/python/location/importer.py
++++ b/src/python/location/importer.py
+@@ -1,4 +1,3 @@
+-#!/usr/bin/python3
+ ###############################################################################
+ #                                                                             #
+ # libloc - A library to determine the location of someone on the Internet     #
+diff --git a/src/python/location/logger.py b/src/python/location/logger.py
+index 0bdf9ec..62ad8fb 100644
+--- a/src/python/location/logger.py
++++ b/src/python/location/logger.py
+@@ -1,4 +1,3 @@
+-#!/usr/bin/python3
+ ###############################################################################
+ #                                                                             #
+ # libloc - A library to determine the location of someone on the Internet     #
+-- 
+2.37.3
+
diff --git a/libloc-0.9.15-Revert-perl-Remove-RPATH.patch b/libloc-0.9.15-Revert-perl-Remove-RPATH.patch
new file mode 100644 (file)
index 0000000..7ecc6fd
--- /dev/null
@@ -0,0 +1,35 @@
+From 3101c388bd5cd1032a95c38c4191b26d647c0677 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Tue, 4 Oct 2022 14:10:58 +0200
+Subject: [PATCH] Revert "perl: Remove RPATH"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This reverts commit fb574759cbd3a60e64ed2674f514037b9085f078 because
+LD_RUN_PATH='' creates empty DT_RPATH/DT_RUNPATH record. Fedora
+requires no record. rpmbuild fails with:
+
+ERROR   0010: file '/usr/lib64/perl5/5.36/auto/Location/Location.so' contains an empty runpath in []
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index ca37166..0d469d4 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -245,7 +245,7 @@ build-perl:
+       cd $(builddir)/src/perl && $(PERL) Makefile.PL \
+               INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 \
+               INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc"
+-      cd $(builddir)/src/perl && $(MAKE) LD_RUN_PATH=
++      cd $(builddir)/src/perl && $(MAKE)
+ .PHONY: check-perl
+ check-perl: testdata.db
+-- 
+2.37.3
+
diff --git a/libloc.spec b/libloc.spec
new file mode 100644 (file)
index 0000000..e3c85e5
--- /dev/null
@@ -0,0 +1,275 @@
+Name:       libloc
+Version:    0.9.15
+Release:    1%{?dist}
+Summary:    Library to determine a location of an IP address in the Internet
+# COPYING:                  LGPL-2.1 text
+# man/libloc.txt:           LGPL-2.1-or-later
+# po/de.po:                 "same as libloc"
+# src/address.c:            LGPL-2.1-or-later
+# src/as.c:                 LGPL-2.1-or-later
+# src/as-list.c:            LGPL-2.1-or-later
+# src/country.c:            LGPL-2.1-or-later
+# src/country-list.c:       LGPL-2.1-or-later
+# src/database.c:           LGPL-2.1-or-later
+# src/libloc.c:             LGPL-2.1-or-later
+# src/libloc/address.h:     LGPL-2.1-or-later
+# src/libloc/as.h:          LGPL-2.1-or-later
+# src/libloc/as-list.h:     LGPL-2.1-or-later
+# src/libloc/compat.h:      LGPL-2.1-or-later
+# src/libloc/country.h:     LGPL-2.1-or-later
+# src/libloc/country-list.h:    LGPL-2.1-or-later
+# src/libloc/database.h:    LGPL-2.1-or-later
+# src/libloc/format.h:      LGPL-2.1-or-later
+# src/libloc/libloc.h:      LGPL-2.1-or-later
+# src/libloc/network.h:     LGPL-2.1-or-later
+# src/libloc/network-list.h:    LGPL-2.1-or-later
+# src/libloc/private.h:     LGPL-2.1-or-later
+# src/libloc/resolv.h:      LGPL-2.1-or-later
+# src/libloc/stringpool.h:  LGPL-2.1-or-later
+# src/libloc/writer.h:      LGPL-2.1-or-later
+# src/network.c:            LGPL-2.1-or-later
+# src/network-list.c:       LGPL-2.1-or-later
+# src/perl/lib/Location.pm: GPL-1.0-or-later OR Artistic-1.0-Perl
+# src/python/as.h:          LGPL-2.1-or-later
+# src/python/country.c:     LGPL-2.1-or-later
+# src/python/country.h:     LGPL-2.1-or-later
+# src/python/database.c:    LGPL-2.1-or-later
+# src/python/database.h:    LGPL-2.1-or-later
+# src/python/location/__init__.py:      LGPL-2.1-or-later
+# src/python/location/downloader.py:    LGPL-2.1-or-later
+# src/python/location/export.py:    LGPL-2.1-or-later
+# src/python/location/i18n.py:      LGPL-2.1-or-later
+# src/python/location/importer.py:  LGPL-2.1-or-later
+# src/python/location/logger.py:    LGPL-2.1-or-later
+# src/python/locationmodule.c:  LGPL-2.1-or-later
+# src/python/locationmodule.h:  LGPL-2.1-or-later
+# src/python/network.c      LGPL-2.1-or-later
+# src/python/network.h:     LGPL-2.1-or-later
+# src/python/writer.c:      LGPL-2.1-or-later
+# src/python/writer.h:      LGPL-2.1-or-later
+# src/resolv.c:             LGPL-2.1-or-later
+# src/scripts/location.in:  LGPL-2.1-or-later
+# src/scripts/location-importer.in: LGPL-2.1-or-later
+# src/stringpool.c:         LGPL-2.1-or-later
+# src/writer.c:             LGPL-2.1-or-later
+# tests/python/test-database.py:    LGPL-2.1-or-later
+# tests/python/test-export.py:      LGPL-2.1-or-later
+## Used at build-time but not in any binary package
+# m4/attributes.m4:         GPL-2.0-or-later WITH Autoconf-exception-2.0 (?)
+# src/perl/Makefile.PL:     "lgpl" (probably a mistake)
+# src/test-address.c:       GPL-2.0-or-later
+# src/test-as.c:            GPL-2.0-or-later
+# src/test-country.c:       GPL-2.0-or-later
+# src/test-database.c:      GPL-2.0-or-later
+# src/test-libloc.c:        GPL-2.0-or-later
+# src/test-network.c:       GPL-2.0-or-later
+# src/test-network-list.c:  GPL-2.0-or-later
+# src/test-signature.c:     GPL-2.0-or-later
+# src/test-stringpool.c:    GPL-2.0-or-later
+## Unbundled, then used only at build-time, not in any binary package
+# m4/ax_prog_perl_modules.m4:   FSFAP
+# m4/ld-version-script.m4:  FSFULLR
+## Not used and not in any binary package
+# debian/copyright:         LGPL-2.1-or-later
+# src/cron/location-update.in:  LGPL-2.1-or-later
+License:    LGPL-2.1-or-later 
+URL:        https://location.ipfire.org/
+Source0:    https://source.ipfire.org/releases/%{name}/%{name}-%{version}.tar.gz
+# Install Python files into site Python module path, in upstream after 0.9.15
+Patch0:     libloc-0.9.15-Makefile-Reset-Python-path.patch
+# Install Perl files vendor Perl module path, proposed to the upstream,
+# <https://bugzilla.ipfire.org/show_bug.cgi?id=12954>
+Patch1:     libloc-0.9.15-Install-Perl-files-to-Perl-vendor-directory.patch
+# Remove empty RPATH, proposed to the upstream,
+# <https://bugzilla.ipfire.org/show_bug.cgi?id=12955>
+Patch2:     libloc-0.9.15-Revert-perl-Remove-RPATH.patch
+# Remove shebangs from Python modules, proposed to the upstream,
+# <https://bugzilla.ipfire.org/show_bug.cgi?id=12956>
+Patch3:     libloc-0.9.15-Remove-shebangs-from-Python-modules.patch
+# Move location(8) to location(1), proposed to the upstream,
+# <https://bugzilla.ipfire.org/show_bug.cgi?id=12957>
+Patch4:     libloc-0.9.15-Move-location-manual-from-section-8-to-section-1.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:  findutils
+BuildRequires:  gcc
+# grep is called from po/Makefile supplied with intltool
+BuildRequires:  grep
+# 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:  make
+BuildRequires:  openssl-devel
+BuildRequires:  perl-devel
+BuildRequires:  perl-generators
+BuildRequires:  perl-interpreter
+BuildRequires:  perl(ExtUtils::MakeMaker)
+BuildRequires:  pkgconf-m4
+# pkgconf-pkg-config for pkg-config program
+BuildRequires:  pkgconf-pkg-config
+BuildRequires:  pkgconfig(libsystemd)
+BuildRequires:  pkgconfig(python) >= 3.4
+# pkgconfig(systemd) no needed, we configure a value from systemd-rpm-macros
+BuildRequires:  python3-devel
+BuildRequires:  sed
+BuildRequires:  systemd-rpm-macros
+# Run-time:
+BuildRequires:  perl(Exporter)
+BuildRequires:  perl(strict)
+BuildRequires:  perl(warnings)
+BuildRequires:  perl(XSLoader)
+# python3-psycopg2 not used at tests
+# Tests:
+BuildRequires:  perl(Test::More)
+
+%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 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:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
+
+%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
+%py_provides python3-location
+
+%description -n python3-%{name}
+This is Python binding to libloc, a library to determine an IP adress location
+in the Internet.
+
+%package tools
+Summary:        Tools for downloading and querying IPFire Location database
+BuildArch:      noarch
+Requires:       python3-%{name} = %{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.
+
+%prep
+%autosetup -p1
+# Unbundle m4 macros
+rm m4/ax_prog_perl_modules.m4 m4/ld-version-script.m4
+
+%build
+autoreconf -fi -I%{_datadir}/gnulib/m4
+# Upstream moved to /var/lib/location/database.db in
+# 14e821d483017d86d9e12486c9d9a289f4e99b0e.
+%global default_database_file %{_sharedstatedir}/location/database.db
+%{configure} \
+    --disable-analyzer \
+    --with-database-path=%{default_database_file} \
+    --disable-debug \
+    --enable-largefile \
+    --enable-ld-version-script \
+    --enable-man_pages \
+    --enable-nls \
+    --enable-perl \
+    --enable-shared \
+    --disable-silent-rules \
+    --disable-static \
+    --with-systemd \
+    --with-systemdsystemunitdir=%{_unitdir}
+%{make_build}
+
+%install
+%{make_install}
+# Remove libtool archives
+find %{buildroot} -name '*.la' -delete
+# Correct Perl permissions
+%{_fixperms} %{buildroot}/*
+# Create Python dist-info metadata
+install -d -m 0755 %{buildroot}/%{python3_sitelib}/%{name}-%{version}.dist-info
+cat <<'EOF' >%{buildroot}/%{python3_sitelib}/%{name}-%{version}.dist-info/WHEEL
+Wheel-Version: 1.0
+Generator: handmade
+Root-Is-Purelib: false
+Tag: py3-none-any
+EOF
+chmod 0644 %{buildroot}/%{python3_sitelib}/%{name}-%{version}.dist-info/WHEEL
+cat <<'EOF' >%{buildroot}/%{python3_sitelib}/%{name}-%{version}.dist-info/METADATA
+Metadata-Version: 2.1
+Name: %{name}
+Version: %{version}
+Home-page: %{url}
+Requires-Dist: psycopg2
+EOF
+chmod 0644 %{buildroot}/%{python3_sitelib}/%{name}-%{version}.dist-info/METADATA
+# Gather NLS files
+%find_lang %{name}
+
+%check
+make check %{?_smp_mflags}
+
+%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
+%license COPYING
+%{_libdir}/libloc.so.1*
+
+%files devel
+%{_includedir}/libloc
+%{_libdir}/libloc.so
+%{_libdir}/pkgconfig
+%{_mandir}/man3/libloc.3*
+%{_mandir}/man3/loc_*.3*
+
+%files -n perl-%{name}
+%{perl_vendorarch}/auto/*
+%{perl_vendorarch}/Location*
+%{_mandir}/man3/Location.3pm*
+
+%files -n python3-%{name}
+%doc examples/python/*
+%{python3_sitelib}/location
+%{python3_sitelib}/%{name}-%{version}.dist-info
+%{python3_sitearch}/_location.so
+# TODO: writable for a dedicated, non-root user
+# The default path is compiled into _location.so Python module. Not into
+# C libloc.so. Thus the database belongs here, to Python package.
+%{_sharedstatedir}/location
+%ghost %attr(0444, root, root) %{default_database_file}
+
+%files tools
+%{_bindir}/location*
+%{_mandir}/man1/location.1*
+%{_unitdir}/*
+
+%changelog
+* Tue Oct 04 2022 Petr Pisar <ppisar@redhat.com> - 0.9.15-1
+- 0.9.15 packaged
+
diff --git a/sources b/sources
new file mode 100644 (file)
index 0000000..147b6a1
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (libloc-0.9.15.tar.gz) = aee14c4a1feba201b2b353ce919c6b2a04f80647ac9b632adf368eb9fc32da2d2a5010b52a700428f25bef21cb39e4657d055b0c028e8d7dd8ba271730fdfddd